KIP-21: Partitioned sequencing commitment with O(activity) proving#36
KIP-21: Partitioned sequencing commitment with O(activity) proving#36michaelsutton wants to merge 5 commits intokaspanet:masterfrom
Conversation
|
|
||
| This KIP replaces the current per-chain-block linear sequencing commitment recurrence with a partitioned sequencing commitment scheme. | ||
|
|
||
| Instead of committing to all accepted transactions in every chain block as one global append-only stream, consensus maintains a commitment over the tips of active application lanes. Each active lane has its own recursive tip hash and last-touch blue score. Global order remains reconstructible via `merge_idx` (Section 10.1), but is no longer directly committed as one monolithic per-block list. The block header continues to expose a single `accepted_id_merkle_root` value (consumed by `OpChainblockSeqCommit`), but post-activation it commits to (i) the active-lanes sparse Merkle tree (SMT) root and (ii) per-block context and mergeset miner payloads, chained through selected-parent recursion. |
There was a problem hiding this comment.
You mention the term "lane" a lot. I think you should write "(as defined below)" or something similar after the first usage.
| This document mixes consensus rules and proving/operations guidance. Use this reading path: | ||
|
|
||
| * Consensus implementers: read *Terminology* through *Script Semantics*, then *Reorg-Safe Incremental Maintenance* and *Purge Index*, then *Relationship to Covenants++ Workstream* and *Backward Compatibility*. | ||
| * Proving/witness implementers: read *Per-Lane Block Activity Digest (§4.2)*, *Update or Initialize Lane Tips (§5.2)*, and *Commitment Structure (§6)* (especially §6.3-§6.7), then *Complexity (§10)* and *Optional Persistent Witness Store (§11)*. |
There was a problem hiding this comment.
Consider using links every time you use a section number
|
|
||
| ### 1. Terminology | ||
|
|
||
| * Lane (`lane`): the logical application lane tracked by this commitment scheme. (In this KIP, lanes are extracted from `tx.subnetwork_id`; future KIPs may define finer-grained lane extraction such as account-level lanes.) |
There was a problem hiding this comment.
Maybe add something like "a lane is some ordered subset of mergeset's accepted transactions" or "a lane defines a predicate to filter mergeset transactions"
| Rationale for keying: | ||
|
|
||
| * The committed SMT key is `lane_key(lane) = H_lane_key(lane_id_bytes(lane))` (Section 6.1). | ||
| * Because key width is normalized by `H_lane_key`, zero-padding lane IDs is unnecessary. |
There was a problem hiding this comment.
This paragraph is not very clear. Do you mean that zero-padding might be needed to accommodate for SMT leaf requirements? I think the standard is that leaves are always hashed items, so there's no need to mention it (I mean, padding would violate the standard and would require justification)
|
|
||
| Rationale for keying: | ||
|
|
||
| * The committed SMT key is `lane_key(lane) = H_lane_key(lane_id_bytes(lane))` (Section 6.1). |
There was a problem hiding this comment.
What is lane here? Is it just an abstract concept? I think it's clearer to write lane_key(lane_id) = ...
I think the whole document will be easier to reason about if you'll replace lane with lane_id in many places (mainly in code snippets).
|
|
||
| ``` | ||
| TipUpdateHash(parent_ref, lane_id_bytes(lane), activity_digest, MergesetContextHash(B)) = | ||
| H_lane_tip(parent_ref || lane_id_bytes(lane) || activity_digest || MergesetContextHash(B)) |
There was a problem hiding this comment.
Just a thought: maybe add here SeqCommit(parent(B)) and replace parent_ref with ZERO_HASH when inactive? This way the structure will be more "deterministic"
|
|
||
| Current encoding (subnetwork lanes): | ||
|
|
||
| * Let `subnetwork_id` be the canonical 20-byte `tx.subnetwork_id`. |
There was a problem hiding this comment.
So users are now allowed to use freely any non-reserve subnetwork ID? I think it's worth writing it explicitly - it's another consensus change triggered by this KIP
| Consensus sets: | ||
|
|
||
| ``` | ||
| B.header.accepted_id_merkle_root = SeqCommit(B) |
There was a problem hiding this comment.
This seems unrelated - the previous sentence doesn't mention SeqCommit(B). Maybe it shoule be part of "6.6 Sequencing State Root (Normative)"?
| H_mergeset_context( | ||
| le_u64(B.header.timestamp) | ||
| || le_u64(B.header.daa_score) | ||
| || le_u64(B.header.blue_score) |
There was a problem hiding this comment.
Maybe it's a little far-fetched, but utxo_commitment might also be relevant for an L2 application that needs to get the full L1 UTXO set.
| 1. `peek_oldest_score()` | ||
| 2. `pop_oldest_while(score <= purge_cutoff)` |
There was a problem hiding this comment.
Maybe change score -> blue_score? (Also below)
|
|
||
| Rationale for keying: | ||
|
|
||
| * The committed SMT key is `lane_key(lane) = H_lane_key(lane_id_bytes(lane))` (Section 6.1). |
There was a problem hiding this comment.
do we really need hashing here? Cant we reuse lane_id_bytes and add 20 zeroes as padding?
Summary
This PR adds KIP-21 as a draft consensus spec for replacing the current linear per-block seqcommit recurrence with a partitioned, lane-based commitment scheme.
The design keeps a single header commitment (
accepted_id_merkle_root) while enabling lane-local proving that scales with lane activity (O(activity)), via two global anchors plus lane-local witnesses/diff.Scheme illustration:
This PR includes
ActiveLanesRootas an SMT over active lane tips.SeqStateRootand selected-parent recurrence forSeqCommit(B).merge_idxplus lane witnesses/SMT-diff proofs underSeqCommitanchors.timestamp,daa_score,blue_score).For prior research context, see "Subnets sequencing commitments": https://research.kas.pa/t/subnets-sequencing-commitments/274