DeltaChain Docs
DeltaChain defines a block in Golang as:
// block.go
type Block struct {
header *Header
txs tx.Transactions
type Header struct {
body headerBody
type headerBody struct {
ParentID delta.Bytes32
Timestamp uint64
GasLimit uint64
Beneficiary delta.Address
GasUsed uint64
TotalScore uint64
TxsRoot delta.Bytes32
StateRoot delta.Bytes32
ReceiptsRoot delta.Bytes32
Signature []byte
type Transactions []*Transaction
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