Abstract
The post-quantum fork of the consensus layer (the PQ fork) replaces BLS signatures with leanXMSS, which has no native aggregation. An aggregator instead proves the signatures of its committee with a leanVM proof of several hundred kilobytes, and broadcasts it in a SignedAggregateAndProof on the beacon_aggregate_and_proof gossipsub topic. This EIP, WOOF (Waggle Proofs), replaces that topic with a Waggle topic of the same name. The aggregator splits the proof into TOTAL_PROOF_CHUNKS chunks, builds a Merkle tree over them, and signs an AggregateHeader that holds its root in place of the proof, so that one leanXMSS signature commits to the aggregate and to every chunk of its proof. Peers push chunks to each other, announce and request them until each of them holds every chunk, and verify each chunk with an inclusion proof against the signed root. The signed header, most of which is the signature, is sent to a peer along with a chunk, and only while that peer may not hold it yet.
Motivation
A BLS aggregate of a committee is a few hundred bytes. In the PQ fork, an aggregate carries a leanVM proof of the leanXMSS signatures of its attesters, which is a few hundred kilobytes (about 360 KiB for 1,400 signatures in the current leanVM benchmarks) and bounded by MAX_STARK_PROOF_SIZE. A slot has up to MAX_COMMITTEES_PER_SLOT_PQ committees with AGGREGATORS_PER_COMMITTEE aggregators each.
The beacon_aggregate_and_proof gossipsub topic scales poorly with messages of that size. Two effects dominate:
- Once a peer has received a large message, it is hard to cancel in-flight duplicates, so the same bytes arrive several times and consume bandwidth that could carry new data.
- A peer must download the full message before it can forward any of it, so each hop adds a full transfer, leading to increased latency proportional to message size multiplied by hop count.
Both effects are mitigated when the proof is chunked, as EIP-8411 does for the execution payload. A proof differs from a payload in what its chunks are verified against. The chunks of a payload are verified against a root in the bid, which a node holds, with the beacon block, before it accepts the first chunk. Nothing commits to a proof before it is broadcast: the commitment is a signature of the aggregator, and has to travel with the chunks. A leanXMSS signature is 2,404 bytes. A 200,000-byte proof split into 64 chunks has chunks of 3,125 bytes, so a signature in every chunk message would add 77% to it.
On gossipsub, a node that publishes or forwards a chunk does not know which chunks of the same proof its mesh peers hold, so every chunk message would have to carry the signature. Waggle makes the proof the unit of dissemination instead: peers exchange bitmaps of the chunks they hold, push new chunks to peers that lack them, and request missing chunks directly. The same bitmaps tell a node whether a peer holds the signature, so the node sends it to a peer with the first chunk only, not with every chunk.
Specification
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 and RFC 8174.
In this document, the proof is the AttestationProof of an aggregate, the header is its SignedAggregateHeader, and the aggregate is both together.
PQ fork definitions
This EIP builds on the PQ fork, and uses the following of its definitions.
| Name | Value | Description |
|---|---|---|
XMSS_SIGNATURE_SIZE | 2404 | Size of a leanXMSS signature, in bytes |
MAX_STARK_PROOF_SIZE | 2**20 (1,048,576) | Maximum size of a leanVM proof, in bytes |
MAX_COMMITTEES_PER_SLOT_PQ | 2**4 (16) | Maximum number of committees in a slot |
AGGREGATORS_PER_COMMITTEE | 2**2 (4) | Number of aggregators of a committee |
MIN_ATTESTATION_INCLUSION_DELAY_PQ | 2 | Minimum number of slots from the slot of an attestation to that of the block that includes it |
LEAF_OFFSET_AGGREGATE_AND_PROOF | 1 | Offset, among the leanXMSS leaves of a slot, of the leaf at which an aggregator signs its aggregate |
| Name | SSZ equivalent | Description |
|---|---|---|
XMSSSignature | ByteVector[XMSS_SIGNATURE_SIZE] | leanXMSS signature |
AttestationProof | ByteList[MAX_STARK_PROOF_SIZE] | leanVM proof of the leanXMSS signatures of the attesters of an aggregate |
CommitteeBits | Bitvector[MAX_COMMITTEES_PER_SLOT_PQ] | Committees of a slot that an attestation covers |
An attestation carries no signature. Attestation is the progressive container of Gloas without its signature field, whose position stays inactive, so that the other fields keep their positions in the Merkle tree:
class Attestation(ProgressiveContainer):
aggregation_bits: AggregationBits
data: AttestationData
committee_bits: CommitteeBitsAn aggregator broadcasts its aggregate in a SignedAggregateAndProof, which carries the proof of the aggregate in place of an aggregate signature, and no selection proof:
class AggregateAndProof(Container):
aggregator_index: ValidatorIndex
aggregate: Attestation
proof: AttestationProof
class SignedAggregateAndProof(Container):
message: AggregateAndProof
signature: XMSSSignatureThe following functions are used:
compute_xmss_leaf_index(slot, leaf_offset)returns the leanXMSS leaf at which a message of the type given byleaf_offsetis signed forslot. Each slot has its own leaves, one per message type.get_aggregation_committee(state, slot, index)returns the aggregation committee of the beacon committeeindexatslot: up toAGGREGATORS_PER_COMMITTEEdistinct validators of the committee, sampled by effective balance, which are its aggregators.stark_verify_aggregates(statements, proof)returns whetherproofproves, for each statement and each of its public keys, a valid leanXMSS signature of the message of the statement at its leaf. The statement of an aggregate holds the public keys of its attesters, the signing root of its attestation data, and the leaf of its target epoch.
Parameters
| Constant | Value |
|---|---|
TOTAL_PROOF_CHUNKS | 64 |
PROOF_CHUNK_INCLUSION_PROOF_DEPTH | 6 |
MAX_PROOF_CHUNK_SIZE | MAX_STARK_PROOF_SIZE // TOTAL_PROOF_CHUNKS (16,384 bytes) |
Custom types
| Name | SSZ equivalent | Description |
|---|---|---|
ChunkIndex | uint8 | Index of a chunk, 0 through TOTAL_PROOF_CHUNKS - 1 |
Chunk | ByteList[MAX_PROOF_CHUNK_SIZE] | Contiguous slice of the serialized AttestationProof |
Commitment
The aggregator signs an AggregateHeader, which is the AggregateAndProof of the PQ fork with a commitment to the chunked proof in place of the proof:
class AggregateHeader(Container):
aggregator_index: ValidatorIndex
aggregate: Attestation
proof_chunks_root: Root
class SignedAggregateHeader(Container):
message: AggregateHeader
signature: XMSSSignatureThey replace AggregateAndProof and SignedAggregateAndProof, which nodes no longer broadcast.
proof_chunks_root is computed by compute_proof_chunks_root in the Chunking section. get_aggregate_header replaces get_aggregate_and_proof: it takes the same arguments, and sets proof_chunks_root from the proof.
get_aggregate_header_signature replaces get_aggregate_and_proof_signature, with the AggregateHeader in place of the AggregateAndProof. The domain and the leaf are not modified: the aggregator signs the signing root of the AggregateHeader under DOMAIN_AGGREGATE_AND_PROOF with leanXMSS, at the leaf compute_xmss_leaf_index(aggregate.data.slot, LEAF_OFFSET_AGGREGATE_AND_PROOF). This one signature thus commits to the attestation data, the aggregation bits, the aggregator and, through proof_chunks_root, every chunk of the proof. No leaf is added: an aggregator has one leaf per slot for its aggregate. It therefore MUST NOT sign two different AggregateHeaders for the same slot, as two signatures at the same leaf expose the leaf and let others forge signatures at it.
A header does not contain the proof. A committee of 2,048 validators has a header of 2,843 bytes, of which 2,404 are the signature. Its type-specific bound is:
| Name | Value |
|---|---|
MAX_SIGNED_AGGREGATE_HEADER_SIZE | 6683 |
This is the bound of a SignedAggregateAndProof in the PQ fork, 1,055,231 bytes, less the proof and its offset (1,048,576 + 4 bytes), plus the root (32 bytes).
Chunking
The aggregator MUST derive the chunks, and therefore proof_chunks_root, as follows, where serialize is SSZ serialization and hash is SHA-256. As AttestationProof is a ByteList, its serialization is the bytes of the proof, without a length prefix, so a chunk is at most MAX_PROOF_CHUNK_SIZE bytes. No padding is added: the last non-empty chunk can be shorter, and trailing chunks can be empty.
def compute_proof_chunks(
proof: AttestationProof,
) -> Vector[Chunk, TOTAL_PROOF_CHUNKS]:
data = serialize(proof)
chunk_size = (len(data) + TOTAL_PROOF_CHUNKS - 1) // TOTAL_PROOF_CHUNKS
chunks = []
for i in range(TOTAL_PROOF_CHUNKS):
start = i * chunk_size
chunks.append(Chunk(data[start:start + chunk_size]))
return chunks
def compute_proof_chunks_root(proof: AttestationProof) -> Root:
leaves = Vector[Bytes32, TOTAL_PROOF_CHUNKS](
[hash(chunk) for chunk in compute_proof_chunks(proof)]
)
return hash_tree_root(leaves)The Merkle tree has the hashes of the TOTAL_PROOF_CHUNKS chunks as its leaves, and proof_chunks_root as its root. Each chunk is disseminated in a ProofChunk, along with its index and its inclusion proof:
class ProofChunk():
index: ChunkIndex
chunk: Chunk
chunk_inclusion_proof: Vector[Bytes32, PROOF_CHUNK_INCLUSION_PROOF_DEPTH]chunk_inclusion_proof is the Merkle branch of the chunk's leaf:
def verify_proof_chunk_inclusion_proof(
proof_chunk: ProofChunk,
proof_chunks_root: Root,
) -> bool:
return is_valid_merkle_branch(
leaf=hash(proof_chunk.chunk),
branch=proof_chunk.chunk_inclusion_proof,
depth=PROOF_CHUNK_INCLUSION_PROOF_DEPTH,
index=proof_chunk.index,
root=proof_chunks_root,
)Receivers concatenate chunks 0 through TOTAL_PROOF_CHUNKS - 1 and deserialize the result as an AttestationProof.
Networking
This EIP removes the beacon_aggregate_and_proof gossipsub topic. Nodes MUST NOT subscribe to it or publish on it under the fork digests of the fork that activates this EIP and of later forks. Aggregates are instead disseminated over Waggle, on the Waggle topic beacon_aggregate_and_proof.
Waggle
Waggle is the libp2p publish-subscribe protocol for objects that peers reconstruct incrementally from pieces, with the protocol ID /waggle/1.0. Nodes MUST implement it as specified, and this EIP assumes familiarity with that specification. Each Waggle message is about one object, and carries its objectID and, optionally, piecesMetadata and pieces. Waggle leaves the meaning of these fields to the application, and neither validates nor forwards messages itself. The following sections define them for aggregates, along with how nodes validate and disseminate them.
Topic
The topic ID is the UTF-8 encoding of /eth2/{fork_digest}/beacon_aggregate_and_proof/ssz_snappy, with fork_digest formatted as in gossipsub topic names. Nodes subscribe to and unsubscribe from the topic of each fork digest as they do for gossipsub topics around fork transitions.
An aggregate is disseminated on the topic of the fork digest of the epoch of aggregate.data.slot.
Messages
Each message on the topic is about one aggregate, and carries the following:
| Waggle field | Content |
|---|---|
objectID | The AggregateID of the aggregate, SSZ serialized |
piecesMetadata | If present, a ProofChunkMetadata, SSZ serialized |
pieces | If present, a single AggregatePiece, SSZ serialized and compressed with Snappy block compression |
class AggregateID():
slot: Slot
aggregator_index: ValidatorIndex
header_root: Root
class ProofChunkMetadata():
have: Bitvector[TOTAL_PROOF_CHUNKS]
request: Bitvector[TOTAL_PROOF_CHUNKS]
class AggregatePiece():
signed_header: List[SignedAggregateHeader, 1]
chunk: ProofChunkIn an AggregateID, slot is aggregate.data.slot, aggregator_index is the index of the aggregator, and header_root is the hash_tree_root of the AggregateHeader. It is 48 bytes long.
In a ProofChunkMetadata, have marks the chunks the sender holds, all of which it validated, and request the chunks the sender asks the receiver to send.
In an AggregatePiece, chunk is one chunk of the proof, and signed_header is either empty or holds the header of the aggregate. The Header section defines when it is included.
Each AggregatePiece is compressed on its own, and the commitment covers the uncompressed chunks. Let max_piece_length be the length of the largest valid AggregatePiece, which holds a header of MAX_SIGNED_AGGREGATE_HEADER_SIZE bytes and a chunk of MAX_PROOF_CHUNK_SIZE bytes (23,276 bytes), and max_compressed_len the worst-case length of Snappy compression, as defined for gossipsub. Nodes MUST NOT send messages on the topic that exceed the following limits, and MUST treat messages that exceed them as malformed:
- The encoded Waggle message, including its framing, is at most
max_compressed_len(max_piece_length) + 1024bytes long, which leaves room forobjectID,piecesMetadataand the framing. Nodes MUST set the maximum message size of Waggle for the topic to this limit. - The uncompressed length in the Snappy header of
piecesis at mostmax_piece_length. Nodes MUST check it before decompressingpieces. piecesis at mostmax_compressed_len(n)bytes long, wherenis the uncompressed length in its Snappy header.
Aggregate state
A node starts to track an aggregate when it receives the first message about it whose AggregateID passes the checks in the Validation section. It tracks the aggregate until MAXIMUM_GOSSIP_CLOCK_DISPARITY after the end of slot slot + MIN_ATTESTATION_INCLUSION_DELAY_PQ, the slot of the first block that can include it. This is the aggregate's tracking window; afterwards the node MAY discard its state.
For each tracked aggregate, a node keeps:
- the header, once it received a valid one;
- the valid chunks it holds, verified against the
proof_chunks_rootof the header; - per peer, the chunks the peer is known to hold: those it announced in
have, sent to the node, or received from the node; - per peer, whether it is known to hold the header, as described in the Header section.
A node only keeps a header that arrived with a valid chunk, and only keeps chunks it verified against a header. It thus holds the header of an aggregate if and only if it holds at least one of its chunks.
A node holds the header of at most one aggregate per slot and aggregator_index, the first valid one it received. Once it holds one, it stops tracking the other aggregates with that slot and aggregator_index. Until then, peers can announce several aggregates with the same slot and aggregator_index, of which an honest aggregator signed at most one. What a node keeps about them MUST be bounded, for example to the latest such aggregate each peer announced.
An aggregator constructs its aggregate and decides whether to broadcast it as in the PQ fork. To broadcast it, at the time it was due on the gossipsub topic, it computes the chunks of its proof, signs the AggregateHeader, tracks the aggregate with its header and all chunks valid, and disseminates the chunks as described in the Dissemination section.
Once a node holds every chunk of an aggregate, it reconstructs the proof as described in the Chunking section, and checks that compute_proof_chunks_root(proof) equals the proof_chunks_root of the header. Instead of recomputing the root, it MAY check that each chunk has the length that compute_proof_chunks gives it. It then checks the aggregate as the beacon_aggregate_and_proof gossip validation of the PQ fork did, with proof in place of aggregate_and_proof.proof, except for the checks it made when it received the header. In particular, this is where stark_verify_aggregates verifies the proof. If the aggregate passes these checks, the node updates seen as that validation did, and processes the aggregate as it did an aggregate that passed that validation. If the proof does not match proof_chunks_root, or a [REJECT] check fails, the aggregate is invalid. The node does not penalize its peers for it, SHOULD stop pushing and requesting its chunks, and MAY stop serving them.
Validation
There is no gossipsub validation on Waggle topics. Instead, a node checks each message it receives as follows. [IGNORE] means the node drops the message. [REJECT] means the node drops the message and SHOULD penalize the sender. Nothing from a dropped message is used or forwarded, with one exception: a ProofChunk that passes the checks on chunks below MAY be used and forwarded even if the message is dropped for its ProofChunkMetadata, as the inclusion proof makes the chunk valid whoever sent it, and whatever else the message carries.
state is the one the beacon_aggregate_and_proof gossip validation of the PQ fork used: the state of the head block, advanced to the start of the epoch of the slot if that epoch is beyond its lookahead.
For a message with the AggregateID aggregate_id:
- [REJECT] The message is well-formed: it is within the size limits above,
objectIDdeserializes as anAggregateID,piecesMetadata, if present, deserializes, andpieces, if present, decompresses and deserializes. - [IGNORE]
aggregate_id.slotis not from a future slot (with aMAXIMUM_GOSSIP_CLOCK_DISPARITYallowance), and the tracking window of the aggregate has not ended. - [IGNORE] The message arrived on the topic of the fork digest of the epoch of
aggregate_id.slot. - [REJECT]
aggregate_id.aggregator_indexis in the aggregation committee of one of the committees ofaggregate_id.slot, as returned byget_aggregation_committee(state, aggregate_id.slot, index). - [IGNORE] The node does not hold the header of another aggregate with the same
slotandaggregator_index.
For a message carrying an AggregatePiece with the header signed_header, if the node does not hold the header of the aggregate yet:
- [REJECT]
hash_tree_root(signed_header.message)equalsaggregate_id.header_root. - [REJECT]
signed_header.message.aggregate.data.slotequalsaggregate_id.slot, andsigned_header.message.aggregator_indexequalsaggregate_id.aggregator_index. - [REJECT] The header passes the following checks of the
beacon_aggregate_and_proofgossip validation of the PQ fork: the data index is 0 or 1, exactly one committee is specified, the epoch matches the target, the committee index is in range, the number of aggregation bits matches the committee size, the aggregate has participants, the validator is one of the committee's aggregators, and the aggregator signature is valid, with theAggregateHeaderas the signed message.
If the node already holds the header, it ignores signed_header without checking it.
For a message carrying an AggregatePiece with the ProofChunk chunk:
- [IGNORE] The node holds the header of the aggregate, or the message carries one that passed the checks above.
- [REJECT]
chunk.indexis less thanTOTAL_PROOF_CHUNKS. - [REJECT] The sender has not sent the node a chunk with index
chunk.indexof this aggregate before. - [REJECT] The inclusion proof is valid as verified by
verify_proof_chunk_inclusion_proof(chunk, proof_chunks_root), with theproof_chunks_rootof that header. A node that already holds the chunk atchunk.indexMAY compare the chunks instead.
A header is kept only if the chunk it arrived with passes these checks.
For a message carrying the ProofChunkMetadata metadata:
- [REJECT]
metadata.haveincludes every chunk the sender announced in earlierProofChunkMetadataabout this aggregate. - [REJECT]
metadata.requestincludes none of the chunks the sender announced inhave, or sent to the node.
A node cannot verify the have of a peer, nor the header_root of an aggregate whose header it does not hold. Both only decide which chunks the node pushes to that peer and requests from it.
Header
A node cannot verify a chunk without the header, and no other message brings it. Each node that sends a chunk therefore decides whether the header goes along, from what it knows about the peer. A peer is known to hold the header of an aggregate if any of the following is true:
- The peer announced a
haveabout the aggregate that is not empty. A node that holds a chunk verified it against the header. - The peer sent the node a valid chunk of the aggregate.
- The node sent the peer the header before.
A node MUST include the header in every AggregatePiece it sends to a peer that is not known to hold it, and SHOULD NOT include it otherwise. For a given peer and aggregate, this is the first chunk the node sends, unless the peer showed before that it holds a chunk.
A node that holds no chunk of an aggregate requests its first chunk with an empty have. Unless the peer sent it the header before, the peer is not known to hold it, and the chunk it gets brings the header.
A node that receives a chunk without the header while it holds none ignores the chunk, as described in the Validation section. It gets the header with the first chunk of another peer.
Dissemination
The following parameters tune the dissemination. They are not part of consensus, and nodes MAY use different values, though they SHOULD NOT use a lower PUSH_PEERS, nor a different MAX_REQUESTS_PER_PEER, as it also limits the requests a peer has to serve.
| Name | Recommended value | Description |
|---|---|---|
PUSH_PEERS | 2 | Number of peers each valid chunk is pushed to |
PUSH_PHASE | 0 milliseconds | Time after the first chunk of an aggregate arrives during which a node pushes its chunks |
ANNOUNCE_INTERVAL | 50 milliseconds | Longest time a node waits after a chunk becomes valid before it announces the chunk, so that one announcement covers several chunks |
MAX_REQUESTS_PER_PEER | 1 | Maximum number of chunks of an aggregate requested from a peer at a time, beyond which the peer need not serve requests |
REQUEST_DELAY | 0 milliseconds | Time after a node starts tracking an aggregate before it requests missing chunks |
REQUEST_TIMEOUT | 500 milliseconds | Time after which a requested chunk can be requested again, not counting the time to send it |
REQUEST_TIMEOUT_PER_BYTE | 16 microseconds | Time added to REQUEST_TIMEOUT for every byte of the chunk |
With
PUSH_PHASEandREQUEST_DELAYset to0, only the aggregator pushes chunks. Every other node announces the chunks it holds and requests those it lacks as soon as it learns of them, so the protocol is essentially a segmented announce-and-pull protocol.
A node disseminates the chunks of the aggregates it tracks to the peers that are subscribed to the topic:
- Push. When a chunk becomes valid, the node SHOULD send it right away to
PUSH_PEERSpeers that are not known to hold the chunk, preferring those with the fewest pending messages. A peer need not have announced the aggregate: the first chunk a peer gets brings the header. The node MAY send the chunk to more peers. It MAY limit how many chunks of an aggregate it pushes to one peer, so that the chunks spread over its peers.PUSH_PHASEafter the first chunk of an aggregate became valid, the node stops pushing its chunks; they are then only announced and served on request.PUSH_PHASEdoes not apply to the aggregator. - Announce. The node MUST send its
ProofChunkMetadatato each peer whenever itshavechanged since it last told that peer. It need not send one announcement per chunk: it MAY wait up toANNOUNCE_INTERVALafter a chunk becomes valid, and then announce every chunk that became valid in the meantime with a singleProofChunkMetadata. A node that holds no chunk of an aggregate has nothing to announce, and only sendsProofChunkMetadataabout it to request chunks. - Request. The node SHOULD request the chunks it lacks from peers that announced them, through
request, with at mostMAX_REQUESTS_PER_PEERrequests outstanding per peer and aggregate. It SHOULD first request the chunks that the fewest of its peers announced. A chunk not received withinREQUEST_TIMEOUT, plusREQUEST_TIMEOUT_PER_BYTEfor every byte of the chunk, SHOULD be requested again, from another peer if one announced it. A node SHOULD NOT send requests withinREQUEST_DELAYafter it starts tracking the aggregate. - Serve. The node MUST send requested chunks it holds right away, unless it sent them to the requester before. It is not required to serve more than
MAX_REQUESTS_PER_PEERrequests of a peer about an aggregate at a time: while it has yet to finish sending that many requested chunks of the aggregate to a peer, it MAY ignore further requests of that peer about it.
To avoid being penalized, a node MUST NOT send a peer a chunk it sent the peer before, MUST NOT request a chunk from a peer it announced or sent that chunk to, and MUST NOT remove a chunk from have once announced.
A node MAY stop requesting the chunks of an aggregate once it holds a valid aggregate with the same attestation data and committee whose attesters include all attesters of the former, which the beacon_aggregate_and_proof gossip validation would ignore. It still serves the chunks it holds.
Open questions and future considerations
- Nodes fetch every aggregate, although a proposer includes one per committee. A node that holds a valid aggregate of a committee could stop fetching the others of that committee, beyond the case above. Whether this is safe depends on how aggregates of the same committee are ranked.
- A peer can get the header of an aggregate from several nodes, as each of them pushes it a first chunk before the announcement of the peer reaches them. Announcing the first chunk without delay, or pushing to fewer peers, may lower this.
- The dissemination parameters are those proposed for execution payloads over Waggle, and were not tuned for proofs. In particular, a node requests one chunk of an aggregate per peer at a time.
- The networking scheme could be extended by erasure coding the chunks, so that a receiver can reconstruct the proof from a subset of chunks. Waggle does not require pieces to be slices of the object, so it can carry erasure-coded chunks as well.
- The same scheme applies to other leanVM proofs that are broadcast with a signature of their producer, for example proofs that merge the proofs of several committees.
Rationale
Why a Merkle root signed with leanXMSS. A receiver has to verify each chunk on its own, so that it can forward the chunk before the proof is complete. Signing each chunk is not an option: a leanXMSS key signs one message per leaf, and each signature is 2,404 bytes. A Merkle tree over the chunks is cheap to build once the proof exists, and its root lets one signature authenticate every chunk, with an inclusion proof of 192 bytes per chunk. The commitment thus relies on hash functions only, like the rest of the PQ fork.
Why the root is signed in place of the proof. In the PQ fork, the aggregator already signs an AggregateAndProof, at the one leaf it has for the slot. Signing the same fields with the root in place of the proof needs no second signature and no second leaf, and binds the chunks to the attestation data, the aggregation bits and the aggregator. A receiver also knows the committee and the attesters of an aggregate from its first chunk, before it has downloaded the proof. The container has a new name, as it no longer holds a proof, and its hash_tree_root differs from that of the AggregateAndProof with the same proof.
Why only the proof is chunked. The rest of the aggregate is what a receiver needs to check that the signature is by an aggregator of the committee. A receiver has to check this before it verifies and forwards chunks, so it cannot be spread over the chunks.
Why a tree over chunks and not the SSZ tree of the proof. The hash_tree_root of the AggregateAndProof of the PQ fork also commits to the proof, so a subtree of the proof could serve as a chunk without any change to the signed message. However, the SSZ tree of a ByteList has 32-byte leaves at a depth set by its limit, so chunks would have a fixed size whatever the length of the proof, and a receiver would recompute a subtree for each chunk instead of one hash.
Why the header travels with a chunk. A chunk is of no use to a peer that lacks the header, and the header is of no use without a chunk. Sending them together lets a node verify, keep and forward the first chunk it receives of an aggregate it never heard of. It also keeps the invariant that a node holds the header exactly when it holds a chunk, which is what lets a non-empty have stand for the header.
Why the header is not sent with every chunk. The header would take a large part of every chunk message. It is 2,843 bytes for a committee of 2,048 validators, while a chunk of a 200,000-byte proof is 3,125 bytes, so a header in every chunk message would be almost half of the bytes sent. With the rules of the Header section, a node sends the header to a peer once per aggregate at most.
Why the object ID names the slot, the aggregator and the header root. The slot and the aggregator index let a node drop messages about aggregates that no eligible aggregator can have signed before it holds a header, and bound its state by the number of aggregators per slot. An aggregator must not sign two headers for the same slot, but a faulty one can. The header root keeps its aggregates apart. With one object ID for both, peers holding different ones would send each other chunks that do not verify, and penalize each other for it.
Why aggregates are tracked for two more slots. A block includes attestations from at least MIN_ATTESTATION_INCLUSION_DELAY_PQ slots before it, so the aggregates of a slot are first included two slots later. Tracking them through that slot lets a node that did not get an aggregate during its own slot still get it over Waggle, from the peers that hold it, in time for that block or the next. There is no request/response method for aggregates.
Backwards Compatibility
The beacon_aggregate_and_proof gossipsub topic is removed, SignedAggregateAndProof is replaced by SignedAggregateHeader, and nodes must support Waggle, so this change is not backwards compatible and requires a fork. It can be activated with the PQ fork or after it. No container of the beacon state or of the beacon block is modified.
Reference Implementation
TBD.
Security Considerations
Chunks are not individually signed; their authenticity derives entirely from the aggregator's signature via proof_chunks_root. A node verifies chunks only against a header whose signature it verified and whose signer is an aggregator of the committee, and only forwards valid chunks, so unsigned chunk spam is filtered at the first hop.
Valid chunks do not imply a valid proof. On gossipsub, a node verified the proof before it forwarded the aggregate, so an invalid proof stopped at the first hop. Here chunks are forwarded before the proof can be verified, so an aggregator can make the network disseminate an invalid proof of up to MAX_STARK_PROOF_SIZE bytes. Each of the AGGREGATORS_PER_COMMITTEE aggregators of a committee can do so once per slot it is selected for. A node only finds the proof invalid once it holds every chunk, by which time its peers hold most of them, so such a proof reaches most nodes. The aggregator is not penalized for it.
An aggregator MUST NOT sign two different headers for the same slot. Both would be signed at the same leanXMSS leaf, which exposes that leaf and lets others forge signatures at it. Nodes cannot stop a faulty aggregator from doing so, and the protocol does not rely on it. A node keeps the header of at most one aggregate per slot and aggregator, the first valid one it receives, and ignores messages about any other, including one whose header was forged at the exposed leaf. The object IDs of such aggregates differ, so their chunks do not mix. Nodes that track different ones cannot complete them from each other, so none of them may reach every node. The aggregates of the other aggregators of the committee are not affected.
Before a node holds a header, it cannot verify the header_root a peer announces. A malicious peer can thus announce an aggregate that does not exist, under the index of an eligible aggregator, and the node requests a chunk of it from that peer. The peer then either ignores the request, or serves a chunk with a header that does not match the header_root or is not validly signed. In the second case the node penalizes the peer. In both cases the node loses one request and the state it keeps about the made-up aggregate, which is bounded. The have of a peer is a claim of the peer about itself: it only decides which chunks the node pushes to that peer and requests from it, and whether the node sends it the header. A peer that announces chunks it does not hold gets chunks it cannot verify.
Leaving out the header relies on the stream delivering messages in order. A peer that nevertheless lacks the header ignores the chunks it cannot verify, and the sender is not penalized. It gets the header with the first chunk of another peer.
Per-index equivocation is not possible: two distinct chunks that both verify at the same index against the same proof_chunks_root would imply a collision in the Merkle tree, so at most one chunk per index can propagate for a given aggregate.
The chunk.index bound is load-bearing: is_valid_merkle_branch reads only the low PROOF_CHUNK_INCLUSION_PROOF_DEPTH bits, so an unbounded index would let the same chunk propagate again at index + k * TOTAL_PROOF_CHUNKS.
Waggle does not interpret requests, so it cannot bound them. As a node sends a peer each chunk at most once, a peer can make it upload at most one copy of each aggregate.
The size limits on messages are checked before parsing and decompressing, so a peer cannot make a node allocate more than a valid message requires.
The check of proof_chunks_root after reconstruction rejects proofs that the aggregator did not split as specified in the Chunking section, so the proof of an aggregate has one valid set of chunks.
Copyright
Copyright and related rights waived via CC0.
