This section states what a wallet does with a transaction between its creation and a terminal state: the encoding it submits and the identifier by which it tracks the transaction; the rule that a transaction is recorded before it is released, with the completeness of the record that follows; submission and rebroadcast; the status observations that update the record; and the terminal states, re-sending and the consensus branch. A transaction is created when it is built, proved and authorised from one step of a plan (Definition 11.2; Constructions 11.18 and 11.20). The record is that of Definition 9.11.
The wallet serialises a created transaction in the encoding of its version: version 5 (ZIP 225, “Transaction Format”) or version 6 (ZIP 229, “Transaction Format”), the only versions in force; a transaction with Ironwood-pool Actions has version 6 (Ironwood Guide, §“The transaction format”, Construction “Version-6 transaction”; protocol specification, §“Transaction Encoding and Consensus”). The argument of Submit (Definition 5.10) is this byte string. The encoding is cited, not restated.
The wallet tracks a transaction t by its transaction identifier txid (t) : the root of the BLAKE2b-256 digest tree of ZIP 244 over the effecting data of t ,
| txid (t) = h (ZcashTxHash_ ∥ β, d hdr ∥ d tr ∥ d Sap ∥ d Orc ∥ d Irw), |
where h (P, x) is BLAKE2b-256 of x under the 16 -byte personalisation P , β is the 4 -byte little-endian consensus branch identifier, and the child d Irw is absent in version 5 (Ironwood Guide, §“Transaction digests and signatures”, Definition “Transaction identifier”, for version 6 , and Remark “Version 5”; ZIP 244, “txid_digest”; ZIP 229, “Transaction Identifiers, Auth Digests, and Signature Digests”; protocol specification, §“Transaction Identifiers”). The header digest d hdr hashes, under ZTxIdHeadersHash, the 4 -byte little-endian encodings of header , nVersionGroupId , nConsensusBranchId , lock _ time and nExpiryHeight (ZIP 244, “T.1: header_digest”), so the expiry height N of Definition 9.8 is effecting data. The wallet computes txid (t) from t and needs no response of the server to know it.
Let t be a transaction of version 5 or 6 .
Replacing the authorising data of t , namely its proofs, signatures and transparent scripts and, in version 6 , its anchors ( anchorSapling , anchorOrchard and anchorIronwood , ZIP 229, “Anchor commitment (version 6)”; Ironwood Guide, §“Transaction digests and signatures”, Definition “Authorising-data digest; effecting and authorising data”), leaves txid (t) unchanged.
Under the Ironwood Guide’s Assumption “Collision resistance of BLAKE2b” (§“Transaction digests and signatures”), no efficient algorithm outputs, except with negligible probability, two transactions with different effecting data and equal identifiers.
Under the same assumption, a transaction built for one consensus branch and the same payment built for another have different identifiers, except with negligible probability.
(i) Authorising data lie under the authorising-data digest and under no node of the tree whose root is txid (Ironwood Guide, §“Transaction digests and signatures”, Definition “Authorising-data digest; effecting and authorising data”). (ii) Each node of the tree hashes an injective encoding (fixed-size fields and length-prefixed scripts, concatenated in order) of effecting data or of the digests of its children (ZIP 244, “txid_digest”). If the effecting data differ, the inputs of some node differ. A node whose inputs differ either has equal digests, which is a collision, or passes different digests to its parent, whose inputs then differ; at the root, equal identifiers from different inputs are a collision. (iii) The branch identifier enters both the root personalisation ZcashTxHash_ ∥ β and the header digest through nConsensusBranchId , so the two root pairs differ, and equal identifiers are a collision (Ironwood Guide, §“Transaction digests and signatures”, Remark “Consensus-branch binding”). □
By (i) and (ii), the identifier tracks a pending transaction from its creation on, before and after any re-signing or re-proving. The identifier of versions up to 4 , the double SHA-256 of the encoding (protocol specification, §“Transaction Identifiers”), is malleable; it belongs to no version in force and is not used.
The following rules are designed but unspecified (Definition 1.1).
Recording before release. The wallet enters each transaction t it creates into its transaction record (Definition 9.11), which locks the notes t spends (Definition 9.12), in storage that survives restarts and rollbacks (Definition 7.23, item (v)), before it submits t or releases its bytes to any other party. It never removes an entry of the record.
Multi-step plans. For a plan of
Submission. The wallet submits t by
Submit (bytes) , whose response is
accepted (txid) or rejected
(Definition 5.10). Neither response changes the record.
It submits at a tip T that leaves a margin of blocks, a wallet parameter,
before the last includable height N (Definition 9.8), rather
than at
Rebroadcast. While t is pending and unmined
(Definition 13.8), the wallet resubmits it at intervals
whenever, at its tip T ,
The semantics of the two responses of Submit are those of the server’s node and are fixed by no ZIP: accepted means that the node admitted t to its mempool, rejected that it refused it. Under clause (a) of Assumption 5.2, acceptance implies neither propagation to other nodes nor inclusion in a block, since relay policy is local to each node and may refuse a transaction that consensus still admits in the next block (Lemma 9.9); and rejection does not imply that t is invalid. Rule (L3) keeps a margin for this reason. Each submission is an observation of the server (Proposition 8.21).
Let the wallet follow rule (L1), and let no party other than the wallet
hold the bytes of a created transaction t before the wallet submits them.
Then, if a block of any chain includes a transaction with the effecting data
of t , the record contains t , and the included transaction has identifier
txid (t) , except with negligible probability. The converse fails: a
recorded transaction that the network never received is stale, not lost,
and, for
A block includes a transaction only if the party that assembled the block held its bytes. The first party other than the wallet to hold bytes of t received them by the wallet’s submission, by hypothesis; by (L1) the wallet recorded t before that event, and the entry survives restarts and rollbacks and is never removed. A valid transaction with the effecting data of t carries, for each spend of t other than a dummy, a signature under a key of the wallet on the signature digest those data fix; except with negligible probability no party obtains such a signature except from bytes the wallet released (Ironwood Guide, §“RedPallas unforgeability”, Proposition “Unforgeability under re-randomisation”, for Orchard-protocol spends; for transparent and Sapling spends the unforgeability of those schemes is assumed, as in §11.8, where no lower volume proves it). Bytes derived from those of t by another party with the effecting data of t differ from t at most in authorising data, so the included transaction has identifier txid (t) by part (i) of the lemma above. The converse fails because recording does not imply delivery. □
Where a partially created transaction is extracted by another party (“Spend finalisation and extraction”, §12.10), that party holds the bytes of t before any submission, and the hypothesis is arranged differently: the wallet records txid (t) , N and the inputs of t , locking them, before it releases the partially created transaction to any party that may extract it, and at a point where the effecting data of t are final. After IO finalisation (Construction 12.14) of a partially created transaction with shielded spends or outputs, or, for one that is transparent-only, once signatures without SIGHASH _ ANYONECANPAY and without SIGHASH _ NONE have cleared bits 0 and 1 of tx _ modifiable (ZIP 374, “Global”), the inputs and outputs are final, the lock time is determined by Definition 12.24, and the proofs and signatures still to be added are authorising data; by part (i) of the lemma the extracted transaction then has the recorded identifier, and the proof above applies with release in place of submission. The entry acquires the encoding of t when the wallet obtains it.
From creation until it is mined, t exists only in the wallet’s record, in remote mempools and, for an extracted partially created transaction, at the extracting party. Once the wallet holds the encoding of t (Definition 9.11, item (i)) the record keeps it, and rule (L4) needs it; before that the wallet does not rebroadcast t . It may hold data that the chain never will: a transaction that ends expired and unmined lies on no chain that agrees with the server’s up to N (Lemma 13.7), and its entry may be the only trace of it.
Scanning detects a transaction only through a nullifier of the watched set W (Definition 9.15) or an output accepted under the wallet’s scanning keys (Construction 6.8). A recorded transaction that spends no note of W and has no such output, every fully transparent transaction among them, is invisible to scanning. Its fate is learnt only by queries Status (txid) (Definition 5.9), each of which puts its identifier into the view of the server (Proposition 8.18).
For a recorded transaction t write N for its expiry height, h t for its mined height ( ⊥ while unmined), h t obs for its earliest observation height, and u t for the latest tip at which the server reported it unmined ( ⊥ initially): items (ii), (iv), (v) and (vi) of Definition 9.11. A status observation (s, T) is a response s of Status (txid (t)) received while the wallet’s view of the chain has tip T .
The record entry of t changes only as follows.
On an observation (s, T) with
On an observation (mined (h ′), T) :
Scanning a block of height h ′ in which t is wallet-relevant (Construction 6.8) has the effect of (ii).
A rollback to r (Definition 7.23) sets
Query termination. The wallet issues Status (txid (t))
for a pending transaction t with
Assume clause (a) of Assumption 5.2. Let t be a
transaction created by the wallet, with expiry height
The wallet’s view has tip
A reorganisation with fork point below N reopens the question, since the
new chain need not agree with C up to N . The wallet meets it as a
continuity error (Definition 6.10), and the rollback of
Construction 7.24 to some
Let B be the birthday of the wallet (Definition 6.2)
and H its retained block boundaries
(Definition 7.12). Write r min for the least element
of
A recorded transaction t is pending from its recording until it reaches one of the following states.
Mined:
Expired unmined:
For
The states and their transitions are designed but unspecified (Definition 1.1). The notification is specified: the wallet should notify the user of expired transactions that must be re-sent, and user interfaces and services must never rely on zero-confirmation transactions (ZIP 203, “Wallet behavior and UI”).
Re-sending an expired payment usually spends the same TXOs, and ZIP 315 lists which spends of given TXOs are repeated across transactions among the kinds of information leakage, the case arising when a previous transaction expired (ZIP 315, “Kinds of information leakage”): the repeated spends link the expired transaction to its replacement. Selecting other notes avoids that link, but the nullifiers that the expired transaction revealed still link it to any later transaction that spends those notes (ZIP 315, “Rationale for anchor selection”). A wallet that re-sends accepts one of the two links. ZIP 315, “Note selection”, records as a TODO, not as a rule, that such revealed nullifiers be spent in a note-management transaction; how to avoid both links is an open problem (Definition 1.1).
Consensus-branch bound. The consensus branch bounds a pending transaction
as well as its expiry height does. An authorisation binds the consensus branch
identifier through β and nConsensusBranchId , which must equal
the identifier of the branch under which t is validated, so a transaction
authorised for one branch is invalid under another whatever its expiry height
(Ironwood Guide, §“Transaction digests and signatures”, Remark
“Consensus-branch binding”, under its Assumption “Collision resistance of
BLAKE2b”; ZIP 244, “txid_digest” and “T.1: header_digest”; ZIP 259,
“Backward compatibility”; protocol specification, §“Transaction Consensus
Rules”). A pending transaction built for a branch that ends at a height X ,
with