aboutsummaryrefslogtreecommitdiffstats
path: root/genesis.go
diff options
context:
space:
mode:
Diffstat (limited to 'genesis.go')
-rw-r--r--genesis.go36
1 files changed, 36 insertions, 0 deletions
diff --git a/genesis.go b/genesis.go
new file mode 100644
index 000000000..aae9cd1cf
--- /dev/null
+++ b/genesis.go
@@ -0,0 +1,36 @@
+package main
+
+import (
+ "math"
+)
+
+/*
+ * This is the special genesis block.
+ */
+
+var GenisisHeader = []interface{}{
+ // Block number
+ uint32(0),
+ // Previous hash (none)
+ "",
+ // Sha of uncles
+ string(Sha256Bin(Encode([]interface{}{}))),
+ // Coinbase
+ "",
+ // Root state
+ "",
+ // Sha of transactions
+ string(Sha256Bin(Encode([]interface{}{}))),
+ // Difficulty
+ uint32(math.Pow(2, 36)),
+ // Time
+ uint64(1),
+ // Nonce
+ uint32(0),
+ // Extra
+ "",
+}
+
+var Genesis = []interface{}{ GenisisHeader, []interface{}{}, []interface{}{} }
+
+var GenisisBlock = NewBlock( Encode(Genesis) )