Skip to content

KIP-24: Transaction Version 1: New Fields and Hashing#41

Open
biryukovmaxim wants to merge 4 commits into
kaspanet:masterfrom
biryukovmaxim:kip-24-txid-v1
Open

KIP-24: Transaction Version 1: New Fields and Hashing#41
biryukovmaxim wants to merge 4 commits into
kaspanet:masterfrom
biryukovmaxim:kip-24-txid-v1

Conversation

@biryukovmaxim

@biryukovmaxim biryukovmaxim commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator

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):

  • per-input compute budget (u16) replacing the v0 sig-op count (u8) as the input's committed resource budget;
  • optional per-output covenant binding (authorizing_input, covenant_id);
  • non-native user-lane subnetworks (and their gas), which v0 transactions may not use.

New v1 txid hashing:

  • txid_v1 = TransactionV1Id(payload_digest || rest_digest) using keyed BLAKE3, 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

  • Resource commitments (mass, compute budget) are kept out of transaction identity and, for v1, out of the sighash, so miners/relayers can fill or adjust them before mining without invalidating txids or signatures (the deliberate fix from v0, where the sig-op count was committed in the sighash).
  • Covenant bindings, being part of what an output is, are committed by all three contexts.
  • The hash-function choice (BLAKE3) is presented as a two-domain tradeoff: native execution (where BLAKE3 wins 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 all BLAKE3, so a prover's full flow avoids BLAKE2b. 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

  • KIP-15 — canonical transaction ordering and sequencing commitments
  • KIP-20 — covenant IDs
  • KIP-21 — partitioned sequencing commitment, lanes, gas, subnetwork namespace

@biryukovmaxim biryukovmaxim changed the title Add KIP-24: Transaction ID v1 hashing (BLAKE3, payload/rest split) KIP-24: Transaction ID v1 Hashing (BLAKE3, payload/rest split) Jun 1, 2026
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.
@biryukovmaxim biryukovmaxim changed the title KIP-24: Transaction ID v1 Hashing (BLAKE3, payload/rest split) KIP-24: Transaction Version 1: New Fields and Hashing Jun 2, 2026
@biryukovmaxim biryukovmaxim marked this pull request as ready for review June 2, 2026 11:45
Correct KIP-21 seq-commit path for txid, v0 mass exclusion, gas rules,
ECDSA sighash wrap, and benchmark provenance; remove the test-vectors
section.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant