-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CommitmentContainer: compatibility of KZG commitments and other commitment types in SSZ #2585
Conversation
4b6ef0f
to
d0e2049
Compare
d0e2049
to
2f0ff0d
Compare
*Fixed the TOC in the docs |
Looks like a good solution to me! Just a spontaneous idea: may be it could be done in a more generic way? I.e. by attributing any ssz member/structure with a custom # Some Python 'pseudo-code'
class DataCommitmentPoints(Container):
points: List[BLSPoint, POINTS_PER_SAMPLE * MAX_SAMPLES_PER_BLOB] (hash_fun = bls_commit_to_data)
samples_count: uint64
fun bls_commit_to_data(point: List[BLSPoint]) -> BLSCommitment
... I.e. Verification of the commitment could be a part of a higher-level spec (not SSZ spec). E.g. attesters from a shard committee should match Absolutely not sure if this approach is feasible and somewhat better than original. Just a slightly different view |
@Nashatyrev Thank you for the suggestion, but I think just containers should be sufficient, we can add it for other types later if necessary (better than removing later if unused/unwanted). Also, I opted for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting!
do we have any other types of commitments that we might use this on? just want to think through if the scheme will satisfy alternative usecases sufficiently
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
didn't meant to "approve" on the last comment
Not that I am aware of, but some examples of popular ones:
And more abstractly:
|
closing this PR because it seems outdated. |
This introduces a new type to SSZ, that is very similar to the existing
Container
, but allows two new things:hash_tree_root
computationIt still encodes/decodes the same.
With this type of container, we can implement two SSZ types that have the same output for
hash_tree_root
:The feature to embed the commitment may also be useful to samples, and other future commitment types that are cheaper to verify than to produce. This is not like a regular cache, as it is encoded and can then be quickly verified by another actor on the network, instead of computing the commitment.
When the bare commitment and data-backed commitment have the same
hash_tree_root
, this also means that the signing-root matches, and signatures over these two are the same. This enables the sharding spec to sign/verify headers everywhere, and use the signature for the full blob of shard-data. E.g. a data-tx (small header) is created based on the full data, then selected by a proposer (adds their signature), and that signature can then apply to the full blob of data, published by the builder.With sharding specifically, this reduces the contents in the shard header, and removes the trust assumption that the SSZ data-root matches the KZG data-root. I.e. data-sampling will be enough to ensure that commitment is good, which allows us to confirm data even with
< 2/3
attestations at the end of the 2 epoch attestation inclusion period (if the other header data does not have more votes, and the data sampling shows it is available, which is part of the forkchoice). Thanks to @vbuterin for finding this.This is a draft, feedback welcome. After ACK of general direction, I'll implement this functionality in
remerkleable
to enable the pyspec to utilize it.