Recognising a program

Status: on Arctic for the format: every payment carries Δ, with blinds from the channel. Recognition in wallet sync is planned.

A payment's Δ is its program's commitment under blinds. Whoever knows the blinds and the program can check that Δ commits to that program. Without the blinds, Δ hides it.

Where the blinds come from

A bundle's blinds come from one 32-byte seed. Which recipients get the seed is up to the sender:

  • The designated output's recipient derives the seed itself. The designated output is the first action, in the bundle's order, whose output was built on a channel. Its seed is BLAKE2b-256("Zuring_DSeedChan", kΔ ‖ i ‖ cmx), with kΔ the channel's Δ key (Channels), i the payment's index on the channel as a 64-bit little-endian integer, and cmx the output's note commitment. The sender derives the same seed, so it never travels.
  • Other outputs carry the seed in their memo's delta_seed slot if they were built with share_program, the last argument of the builder's add_zuring_output. Otherwise the slot is random.
  • A bundle with no output on a channel has a random seed, and nobody can recognise its program.

Change goes on the sender's self channel, and actions are shuffled, so the designated output may be the change. A sender that wants a recipient to recognise the program sets share_program on that recipient's output.

Recognising

With the seed, a recipient:

  1. derives the blinds, DeltaBlinds::from_seed(&seed);
  2. strips them from Δ, strip(vk, &delta, &blinds), which leaves the program's commitment without blinds;
  3. compares that with program_commitment(vk, &program) for each program it expects.

A match means every action of the bundle ran that program. A program with other parameters is another program, with another commitment.

Δ is in the transaction, which the recipient can fetch by the height and index its memo's entry gives (The lookup RPCs). A node that has pruned the witness keeps Δ's digest instead (Storage modes). The recipient then computes Δ for each program it expects, commit_program(vk, &program, &blinds), and compares digests.

Who can recognise

Δ hides the program from anyone without the seed: the chain, nodes, and the bundle's other recipients. Whoever holds the seed can test any program it can guess, so the seed goes only to recipients the sender chooses, sealed in their memos.

Status

The functions are in the orchard crate's zuring module, whose source isn't published yet. The wallet's sync doesn't use them yet: it pays with the no-op program, and it doesn't check what other wallets' payments ran.