KIP-24: Transaction Version 1: New Fields and Hashing#41
Open
biryukovmaxim wants to merge 4 commits into
Open
Conversation
Expand beyond txid to compute budget, covenant bindings, and user-lane subnetworks; specify how txid, tx::hash, and sighash each treat them, with a v0/v1 commitment matrix.
Correct KIP-21 seq-commit path for txid, v0 mass exclusion, gas rules, ECDSA sighash wrap, and benchmark provenance; remove the test-vectors section.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
KIP-24: Transaction Version 1: New Fields and Hashing
Specifies version 1 transactions: the new fields they carry and how all three transaction hashing contexts treat them.
Scope
New v1 fields (vs v0):
u16) replacing the v0 sig-op count (u8) as the input's committed resource budget;authorizing_input,covenant_id);gas), which v0 transactions may not use.New v1 txid hashing:
txid_v1 = TransactionV1Id(payload_digest || rest_digest)using keyedBLAKE3, hashing the payload independently from the rest of the body so ZK/L2 provers can address (or skip) the payload without the full transaction.How each hash context treats the fields: the KIP states, field by field, how the txid (identity),
tx::hash(block-level commitment), and sighash (what a spender signs) handle the new v1 fields, with an explicit v0/v1 commitment matrix.Design highlights
BLAKE3) is presented as a two-domain tradeoff: native execution (whereBLAKE3wins and dominates ecosystem cost) vs ZK-guest execution (where RISC0's SHA-256 precompile wins). The payload/rest split keeps in-guest hashing small, and the v1 txid plus the KIP-21 sequencing-commitment hashers are allBLAKE3, so a prover's full flow avoidsBLAKE2b. The choice is explicitly conditional and documented as such.Status
Implemented in rusty-kaspa across PRs #835 (covenant fields), #849 (v1 txid), #884 (compute budget), and #943 (KIP-21 user-lane subnetworks). Verified against the current implementation in
consensus/core/src/hashing/{tx,sighash}.rs,consensus/core/src/tx.rs, and the transaction validator.References