Closed JustinDrake closed 5 years ago
Adding an empty signature field to every SSZ object seems like a bad idea; it would just add a lot of hashing overhead. The cleanest would just be for every type T
have a type SignedT = {data: T, signature: Signature}
.
However there is another issue which is that for attestations, we need to have the attestation and custody bitfields not be signed over, because the signers don't know who each other are, so the signature mechanism is not going to fit it well no matter how it is done.
Another more general possibility that covers these cases and others is to establish a rule that the signature is the signature of all fields that come before it. This way we can just use order of appearance in the object to denote order of signing and what does and does not need to be signed.
Closing in favour of #649.
Right now the signature logic across SSZ object is ad-hoc. The following are dealt differently:
signature
field with 0x0Here's one way to unify the signature logic (discussed with Danny and Vitalik):
o
have a corresponding "signature header"h
and canonical signatureh.signature
.h
is defined below, whereh.root = tree_hash_root(o)
andh.signature = bls_sign(h)
of whereh.signature
is first set toEMPTY_SIGNATURE
.