How a run works

One run is one Solana transaction. This page takes a swap of 100 USDC through jupiter.swap apart, from the notes it spends to what an explorer shows afterwards. The amounts are an example.

  1. 1Proof
  2. 2Spend
  3. 3Call
  4. 4Check
  5. 5Deposit
Before

Your notes

A private balance is made of notes. A note is an amount of one asset inside Solana Privacy Rings, owned by two things together: Pook’s authority, and a one-time key that only you hold. Pook’s program signs for the first only against a valid proof. The proof shows you hold the second.

60 USDC75 USDC7.5 SOL
Every note in Pook carries the same public owner tag, so a note does not point at a wallet. The amounts are encrypted.
Before

The hook

A hook is an account on chain that describes one instruction of a program that already exists: the program, the bytes of the instruction with slots marked in them, the list of accounts with slots marked in it, the mints in and out, and its author. A run fills the slots. Everything else was fixed when the hook was published, and a published hook never changes.

amount inminimum outcaller argumentsstage accountsseat

For jupiter.swap the route is a caller argument, filled from Jupiter’s own quote. Read its record.

Proof

Your browser builds a proof and hands it to a relayer. The relayer pays the network fee and submits the transaction, so your wallet signs nothing and appears nowhere. Pook verifies the proof first. It binds seven things to this one transaction:

  • the hook
  • the accounts and data
  • the amount in
  • the minimum out
  • the owner of the output
  • the relayer’s fee
  • an expiry

A relayer cannot change any of them. A proof past its expiry is refused, and a relayer that never submits costs you nothing: the same proof can go to another relayer until it expires.

Spend

Pook calls the Solana Privacy Program. The notes you chose are nullified, the change comes back as a new note, and the amount in moves to the stage: token accounts owned by a Pook address that hold a run’s funds for the length of one transaction.

60 USDC75 USDC
35 USDC changeStage: 100 USDC

Call

Pook calls Jupiter exactly as the hook describes, signing as the stage. Jupiter sees a caller with 100 USDC and swaps it. Jupiter’s program was not changed for this.

The protocol is handed the stage accounts and no others, so the most a hook can touch is one run’s input.

Check

Pook measures what arrived in the stage’s out account. If it is less than the minimum out your proof fixed, the whole transaction fails and your notes are as they were.

0.6034 SOL arrived0.6004 SOL minimum outPasses

Deposit

The run fee and the relayer’s fee come off what arrived, in SOL, because SOL is what the run produced. The rest is deposited into Rings as a new note for the owner your proof fixed.

Stage: 0.6034 SOL
SOL, to youRun feeRelayer’s fee
The run fee is split between the hook’s author and the protocol. Fees and POOK has the rates.

What an explorer shows

  1. What you knowYou know who ran it, which notes paid for it and what you hold now.
  2. What the chain keepsThe hook, the amounts in and out, and the relayer that paid.
  3. What stays yoursWho ran it and what anyone holds inside Pook are encrypted. Your wallet shows only when you enter from it or leave to it.
Your run, as you know it
Who ran it
you
Notes spent
60 + 75 USDC
Fee payer
a relayer
Hook
jupiter.swap
In
100 USDC
Out
0.6034 SOL
Your balance
35 USDC, 8.1 SOL
Your run, as an explorer shows it
Who ran it
Notes spent
Fee payer
a relayer
Hook
jupiter.swap
In
100 USDC
Out
0.6034 SOL
Your balance

Example amounts.

Figures

Why it fits in one transaction

4,096
bytes in a Solana transaction
64
addresses it can name
1,400,000
compute units it can spend

The private spend takes about 140,000 compute units and verifying the proof about 95,000. The rest of the budget goes to the protocol being called.