One private payment, from the 402 to the settled transfer
Alba holds value as notes in a pool. A grant is a note an agent can spend inside terms you set. Each part below shows the same moment twice: what anyone watching the chain sees, and what you see.
You deposit, and the amount becomes a note
You sign one transfer of USDC from your wallet into the pool. The program stores the deposit as a note: an amount, your key and a blinding value, kept as a single commitment in the pool’s tree.
Your Alba key comes from one wallet signature over a fixed message, so there is no second secret to store. The app finds your notes by scanning the pool with that key.
| The balance | Anyone watching | You |
|---|---|---|
| Deposit | 100.00 USDC from 5tRw…e9Lm | 100.00 USDC from 5tRw…e9Lm |
| Note | a commitment | 100.00 USDC, yours |
| Balance | sealed | 100.00 USDC |
You spend your notes into a grant
Creating a grant is a spend inside the pool: your notes go in, a grant note and your change come out. The grant note carries its terms, a second key for the agent and a seed.
The seed and the agent’s key are derived from your key and the grant’s index. With the terms they form the grant credential, the string you hand to the agent. You can show it again at any time.
| The grant | Anyone watching | You |
|---|---|---|
| Spend | two spend tags, two new commitments | 100.00 in, grant 50.00, change 50.00 |
| Label | sealed | research-agent |
| Cap per payment | sealed | 0.05 USDC |
| Expiry | sealed | 30 Nov 2026, 00:00 UTC |
| Sellers | sealed | Any |
The agent proves the payment is inside the grant
A seller answers the agent’s request with a 402 and its price. The SDK builds a proof of five statements and shows the verifier none of what they are about:
- the agent knows a grant note in the tree, and its agent key
- the amount is at most the cap per payment
- the expiry has not passed
- the seller’s address is on the grant’s seller list
- the remainder goes into a new grant note with the same terms
| The proof | Anyone watching | You |
|---|---|---|
| Tree root | shown | shown |
| Spend tag | shown | payment 38 of research-agent |
| New commitment | shown | the grant, 41.8200 remaining |
| Amount, seller | 0.0180 USDC to 7Kq2…x4Pn | 0.0180 USDC to 7Kq2…x4Pn |
| Cap, seller list | sealed | 0.05 USDC, any |
| Which grant | sealed | research-agent |
The program pays the seller from the pool
The seller’s middleware passes the proof to the facilitator, which checks it and submits the transaction. The program verifies the proof itself, records the spend tag, adds the new grant note, pays the seller from the vault and takes the protocol fee.
The seller serves the response once the payment has settled. A memo naming the resource travels with the payment, encrypted so that only you can open it.
| Settlement | Anyone watching | You |
|---|---|---|
| Payer | the pool | research-agent |
| Seller | 7Kq2…x4Pn | models.example |
| Amount | 0.0180 USDC | 0.0180 USDC |
| Memo | sealed | POST /v1/chat |
You read everything the agent paid for
Open the grant and the app derives its spend tags from the seed, in order. For each tag it finds the payment on chain, reads the amount and the seller from it, and decrypts the memo.
The ledger needs nothing from the agent and nothing from the facilitator that is not already public. It opens with your key alone.
| The ledger | Anyone watching | You |
|---|---|---|
| 14:03:20 UTC | sealed | models.example · POST /v1/chat · 0.0180 |
| 14:02:36 UTC | sealed | models.example · POST /v1/embeddings · 0.0006 |
| 14:02:07 UTC | sealed | papers.example · GET /doi/10.1016/… · 0.0300 |
| Remaining | sealed | 41.8200 of 50.00 USDC |
The rest of a grant’s life
Top up
You spend more of your notes into the grant’s next note. The agent keeps the same credential.
Revoke
You spend the grant’s current note back into your balance with your own key. The agent’s next proof names a spent note and fails.
Expiry
Takes no action. After the expiry, only your key spends what is left in the grant.
A payment that never completes
Leaves the grant as it was. Nothing is spent until the program accepts the proof.
Withdraw
A spend with a public recipient: the amount leaves the pool for a token account you name.