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 (ZIP 225, “Transaction Format”) or version (ZIP 229, “Transaction Format”), the only versions in force; a transaction with Ironwood-pool Actions has version (Ironwood Guide, §“The transaction format”, Construction “Version-6 transaction”; protocol specification, §“Transaction Encoding and Consensus”). The argument of (Definition 5.10) is this byte string. The encoding is cited, not restated.
The wallet tracks a transaction by its transaction identifier : the root of the BLAKE2b-256 digest tree of ZIP 244 over the effecting data of ,
where is BLAKE2b-256 of under the -byte personalisation , is the -byte little-endian consensus branch identifier, and the child is absent in version (Ironwood Guide, §“Transaction digests and signatures”, Definition “Transaction identifier”, for version , and Remark “Version 5”; ZIP 244, “txid_digest”; ZIP 229, “Transaction Identifiers, Auth Digests, and Signature Digests”; protocol specification, §“Transaction Identifiers”). The header digest hashes, under ZTxIdHeadersHash, the -byte little-endian encodings of , , , and (ZIP 244, “T.1: header_digest”), so the expiry height of Definition 9.8 is effecting data. The wallet computes from and needs no response of the server to know it.
Let be a transaction of version or .
Replacing the authorising data of , namely its proofs, signatures and transparent scripts and, in version , its anchors (, and , ZIP 229, “Anchor commitment (version 6)”; Ironwood Guide, §“Transaction digests and signatures”, Definition “Authorising-data digest; effecting and authorising data”), leaves 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 (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 and the header digest through , 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 , 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 it creates into its transaction record (Definition 9.11), which locks the notes spends (Definition 9.12), in storage that survives restarts and rollbacks (Definition 7.23, item (v)), before it submits or releases its bytes to any other party. It never removes an entry of the record.
Multi-step plans. For a plan of steps (Definitions 11.2 and 11.3), the wallet creates every step before it records any, records all transactions in one update of the record, and submits them after that update, in step order. A construction that fails at some step leaves no recorded, hence by (L1) no transmittable, prefix. Every step can be created before any is mined, since a well-formed plan chains steps only through transparent outputs (Proposition 11.4); the transfer to a TEX address of Construction 11.7 is the instance (ZIP 320, “Design considerations for Senders”).
Rebroadcast. While is pending and unmined (Definition 13.8), the wallet resubmits it at intervals whenever, at its tip , or (Lemma 9.9) and no transaction included in its view of the chain spends an input of . For this continues until is mined or an input of is spent by a mined transaction. The rule is motivated by ZIP 203, “Specification”, under which nodes drop a transaction from their mempools at its expiry.
The semantics of the two responses of are those of the server’s node and are fixed by no ZIP: means that the node admitted to its mempool, 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 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 before the wallet submits them. Then, if a block of any chain includes a transaction with the effecting data of , the record contains , and the included transaction has identifier , except with negligible probability. The converse fails: a recorded transaction that the network never received is stale, not lost, and, for , reaches the terminal state expired unmined of Definition 13.8; for it stays pending by item (c) until the end of its consensus branch is known, and then reaches expired unmined with the bound (“Consensus-branch bound” below).
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 received them by the wallet’s submission, by hypothesis; by (L1) the wallet recorded before that event, and the entry survives restarts and rollbacks and is never removed. A valid transaction with the effecting data of carries, for each spend of 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 by another party with the effecting data of differ from at most in authorising data, so the included transaction has identifier 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 before any submission, and the hypothesis is arranged differently: the wallet records , and the inputs of , 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 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 and without have cleared bits and of (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 when the wallet obtains it.
From creation until it is mined, 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 (Definition 9.11, item (i)) the record keeps it, and rule (L4) needs it; before that the wallet does not rebroadcast . 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 (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 (Definition 9.15) or an output accepted under the wallet’s scanning keys (Construction 6.8). A recorded transaction that spends no note of and has no such output, every fully transparent transaction among them, is invisible to scanning. Its fate is learnt only by queries (Definition 5.9), each of which puts its identifier into the view of the server (Proposition 8.18).
For a recorded transaction write for its expiry height, for its mined height ( while unmined), for its earliest observation height, and 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 is a response of received while the wallet’s view of the chain has tip .
The record entry of changes only as follows.
On an observation with : .
On an observation : , and .
Scanning a block of height in which is wallet-relevant (Construction 6.8) has the effect of (ii).
A rollback to (Definition 7.23) sets if , and if , since a report at a tip above concerned blocks that the rollback discards.
Query termination. The wallet issues for a pending transaction with : if , until , that is, until is reported unmined at a tip of at least ; if , for as long as is pending and unmined. No rule stops at a first report of or at a fixed depth after first observation. A rollback that lowers below , or sets , resumes the queries. The transitions and the termination rule are designed but unspecified (Definition 1.1); the termination rule rests on the consensus rule of Definition 9.8 (ZIP 203, “Specification”). For an entry with unknown (Definition 9.11), the wallet obtains the encoding by (Definition 5.10); until then it queries as for , does not rebroadcast, and its inputs are locked by condition (d) of Definition 9.12.
Assume clause (a) of Assumption 5.2. Let be a transaction created by the wallet, with expiry height , and let be an observation with and , answered from a best chain of the server (Consensus Guide, §“Work, and the best chain”) whose blocks at heights at most are those of the wallet’s view. Then no chain whose blocks at heights at most are those of includes .
The wallet’s view has tip , so has blocks at every height up to . By clause (a), is the status of on (Definition 5.9): no block of contains , so no block of height at most of a chain that agrees with up to does. The transaction is not a coinbase transaction, and by Lemma 9.9 the expiry rule permits it in no block of height greater than (protocol specification, §“Transaction Consensus Rules”; ZIP 203, “Specification”). □
A reorganisation with fork point below reopens the question, since the new chain need not agree with up to . The wallet meets it as a continuity error (Definition 6.10), and the rollback of Construction 7.24 to some sets by transition (iv), which resumes the queries.
Let be the birthday of the wallet (Definition 6.2) and its retained block boundaries (Definition 7.12). Write for the least element of , the lowest rollback point of the rollback window, and when that set is empty.
A recorded transaction is pending from its recording until it reaches one of the following states.
Mined: and , so that no rollback to a point of the window unmines . The state is terminal relative to the rollback window only, since consensus bounds no reorganisation depth (Remark 7.28); a deeper rollback, to or to a fetched chain state in steps (1) and (3) of Construction 7.24, returns to pending by transition (iv).
Expired unmined: , and , which gives the conclusion of Lemma 13.7 when the server’s chain agrees with the wallet’s view up to ; a disagreement surfaces as a continuity error (Definition 6.10), whose rollback to returns to pending by transition (iv). Its inputs are released (Proposition 9.13, every later target height exceeding ), its entry is kept, and the user is notified.
For , a value chosen explicitly: remains pending until it is mined, rebroadcast by rule (L4), or, once the end of its consensus branch is known, until it reaches state (b) with the bound of that branch (“Consensus-branch bound” below). Its mining is detected by scanning through , from which a spend, included, removes a nullifier only once mined (Definition 9.15), or by continued status queries.
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 , which must equal the identifier of the branch under which 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 , with or , can be mined only below . Once is known, write if or , and otherwise. Rule (L4), the query termination of Construction “Status transitions”, state (b) of Definition 13.8 and conditions (b) and (c) of Definition 9.12 apply with in place of , and Lemma 13.7 holds with , by the branch binding in place of the expiry rule. Thus becomes expired unmined from a report at a tip of at least , and its inputs are released for the rebuild at every target height . This rule is designed but unspecified (Definition 1.1). To pay across the activation of the next branch, the wallet rebuilds and re-authorises the payment for the branch in force at its target height (Definition 9.4): a new transaction, with a new identifier by part (iii) of the lemma of §13.1 and a new entry of the record.