hash_tree_root merkleizes all fieldssigning_root merkleizes all fields except the last.class BeaconBlock(Container):
slot: Slot
parent_root: Hash
state_root: Hash
body: BeaconBlockBody
signature: BLSSignature
hash_tree_root: H(H(slot, parent_root), H(state_root, body))signing_root: H(H(H(slot, parent_root), H(state_root, body)), H(H(signature, Z[0]), Z[1]))signing_root on-chain in case of data types with a signature, since the signature is already verified (as part of block processing)signing_root provides the hash to sign and create signature with.block_root, but expanding it into a block header or full block is not possible without knowing that it's a signing root.some_msg_root: Root[FieldTypeWithoutSig]some_msg_root: SigRoot[FieldTypeWithSig], some_signed_msg_root: HashRoot[FieldTypeWithSig]. BeaconBlock as a tree you have hash_tree_root and singing_root trees.a and b, cache H(a,b) at the tree node.BeaconBlock, but only as a by-product of current field count).No signing_root:
Define BeaconBlock and SignedBeaconBlock.
class BeaconBlock(Container):
slot: Slot
parent_root: Hash
state_root: Hash
body: BeaconBlockBody
class SignedBeaconBlock(Container):
data: BeaconBlock
signature: BLSSignature
hash_tree_root(SignedBeaconBlock) == H(hash_tree_root(BeaconBlock), signature)SigRoot/HashRoot confusion or duplicate choices of representation.Signed[MsgType] helper type to wrap any container with a signaturesigning_root stays.HashRoot and SigRoot, both derived from Bytes32HashRoot / SigRootBeaconBlock still has two different tree representations.SigRoot does not fit due to different message / signature requirements.DepositData in the spec: hash-tree-roots with signatures included are part of the deposits list root. But processing the signature is done with signing root.process_deposit: We do not like to change the spec here: but removal of signing root doesn't require a change to the deposit contract. We just need to define a DepositMsg with the fields that were signed over, functionally producing the same old signing_root behavior.Expansions/summaries are difficult with two root variants and effectively different trees:
Root[UnderlyingType] to easily expand to UnderlyingType (and its further expansions). With two root types this gets difficult.Since SSZ itself is not quite frozen, but the core functionality for Phase 0 was, so this proposal will go slower and through more review.
Yes! +1 for alternative 1
[data, signature] throughout as a pattern, or indeed use a generic notation for it - either is fine.BeaconBlockHeader in BeaconState containing an always-zeroed signaturesigning_root or hash_tree_root in the network protocol (there were a few back-and-forths and signing-roots were chosen)+1 for alternative 1
+1 for alternative 1
Support alternative 1.
Optional: less repetitive definitions, add a Signed[MsgType] helper type to wrap any container with a signature
This would definitely be useful!
Most helpful comment
Yes! +1 for alternative 1
[data, signature]throughout as a pattern, or indeed use a generic notation for it - either is fine.BeaconBlockHeaderinBeaconStatecontaining an always-zeroed signaturesigning_rootorhash_tree_rootin the network protocol (there were a few back-and-forths and signing-roots were chosen)