DeltaChain Docs
Search…
βš™
Block
DeltaChain defines a block in Golang as:
1
// block.go
2
​
3
type Block struct {
4
header *Header
5
txs tx.Transactions
6
}
7
​
8
type Header struct {
9
body headerBody
10
}
11
​
12
type headerBody struct {
13
ParentID delta.Bytes32
14
Timestamp uint64
15
GasLimit uint64
16
Beneficiary delta.Address
17
​
18
GasUsed uint64
19
TotalScore uint64
20
​
21
TxsRoot delta.Bytes32
22
StateRoot delta.Bytes32
23
ReceiptsRoot delta.Bytes32
24
​
25
Signature []byte
26
}
27
​
28
type Transactions []*Transaction
Copied!
where ParentID is the ID of the parent block, Beneficiary is the address assigned by the block generator to receive reward (in DTHO), and TotalScore is the accumulated witness number of the chain branch headed by the block. We will describe what the score means when describing the Proof of Authority consensus algorithm.
Let denote headerBody. The block ID (delta.Bytes32) can be computed as:
where is the block number stored as a uint32 and the operation that discards the first four bytes.
Copy link