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
Submission. The wallet submits by
, whose response is
or
(Definition 5.10). Neither response changes the record.
It submits at a tip that leaves a margin of blocks, a wallet parameter,
before the last includable height (Definition 9.8), rather
than at
Rebroadcast. While is pending and unmined
(Definition 13.8), the wallet resubmits it at intervals
whenever, at its tip ,
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
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 :
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
Query termination. The wallet issues
for a pending transaction with
Assume clause (a) of Assumption 5.2. Let be a
transaction created by the wallet, with expiry height
The wallet’s view has tip
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
Let be the birthday of the wallet (Definition 6.2)
and its retained block boundaries
(Definition 7.12). Write for the least element
of
A recorded transaction 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 , 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