A payment, end to end
Status: on Arctic. One shape for every payment is planned.
A Styx payment is a version 7 transaction whose Zuring bundle spends notes and creates new ones. This page follows one from the sender's wallet to the recipient's.
The sender builds it
- Actions. The wallet picks the notes to spend and the outputs to create. Each action spends one note and creates one. A bundle has at least 2 actions, because a lone action would show a spend without an output, or the reverse; it has at most 64. Unused halves are dummies.
- Channels. For each output, the wallet takes the next payment number on its channel to the recipient. If it has no channel to that recipient yet, the payment opens one with a first contact.
- Memos. Each action gets a tagged memo: the channel's tag for that payment, then the note's plaintext, sealed under that payment's key.
- The proof. The Zuring proof shows that the bundle's actions follow Ironwood's rules, and runs the bundle's program in every action. Δ, the commitment to that program, goes next to the proof (Programs).
- Signatures. The wallet signs, and every signature covers Δ.
- The fee pays for the actions and the bytes (Fees and weight).
What it looks like on the chain
| Part | Bytes | |
|---|---|---|
| Header: version, version group, branch ID, lock time, expiry height | 20 | kept |
| Transaction type: 0, a payment | 1 | kept |
| Transparent inputs and outputs | 2 when there are none | kept |
| Number of Zuring bundles: 0 or 1 | 1 | kept |
| The bundle: its proof system and layout, the actions (265 bytes each), the first contacts (1,090 bytes each), flags, value balance, anchor, a 64-byte signature per action and a binding signature | 767 with 2 actions and no first contacts | kept |
| Backups | 1 when there are none; 1,057 or more each | kept |
| Δ | 768 | witness |
| The proof | 2,848, plus 2,528 per action | witness |
The witness comes last, so a parser can tell kept bytes from witness bytes without understanding either.
Three common payments, with two actions each:
| Payment | Kept bytes | Witness bytes | Weight | Fee, in zatoshis |
|---|---|---|---|---|
| On an open channel | 792 | 8,672 | 21,344 | 10,000 |
| Opening a channel: one first contact | 1,882 | 8,672 | 38,784 | 20,000 |
| Opening a channel, with a backup | 2,939 | 8,672 | 55,696 | 25,000 |
The recipient finds it
The recipient knows its channels, so it knows the tags its next payments will carry. It asks a node for those tags, opens the memos that come back, and checks each note against its commitment on the chain. A new sender reaches it through a first contact, which it finds by looking up its address's bucket (First contacts and buckets).
Backups
A payment may carry a backup of the sender's wallet state, under a tag and a key from the wallet's self channel. Only the wallet's spending key can derive them. A wallet restored from its seed finds its backups by tag, and rebuilds its channels from them.
One shape for every payment (planned)
Today a first contact or a backup makes a payment heavier, and so tells it apart from one on an open channel. A planned format gives every payment one shape: two actions, a first-contact slot in every payment, the sender's record in the change memo in place of backups, and one fee. It isn't built.