Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quittance

Quittance is a confidential payment layer for AI agents on Starknet. When an agent pays for an API, data, compute, or another agent, Quittance hides the amount and the counterparty on the public ledger while the payment still settles and the payee can confirm receipt. A viewing-key path lets an operator disclose its own payment history to an auditor when required.

The problem

Agents that pay on public chains leak a vendor map. Every payment shows who paid whom and how much. Anyone watching the chain can reconstruct which APIs an agent uses, which vendors it depends on, how it prices work, and how much it spends. For an autonomous business running on agents, that is the operating playbook in the open.

Proving a payment happened is not the same as hiding it. Existing Starknet x402 work proves payment conditions but leaves the amount and counterparty public. Confidential payment work that does hide them lives on other chains. Quittance closes that gap on Starknet.

How it works

Quittance adds a confidential scheme to the x402 payment handshake. The payment leg is a shielded transfer on STRK20, Starknet's confidential-token standard, so the public ledger sees a valid shielded transfer and nothing else: no amount, no sender, no recipient.

%%{init: {'theme':'base', 'themeVariables': {'primaryColor':'#1e293b','primaryTextColor':'#e2e8f0','primaryBorderColor':'#475569','lineColor':'#64748b','secondaryColor':'#0f172a','fontFamily':'monospace'}}}%%
flowchart TD
    Op[Operator] -->|shield funds| Bal[Agent confidential balance]
    Agent[Agent] -->|1 - request resource| Server[Resource server / API]
    Server -->|2 - HTTP 402 + payment reqs| Agent
    Agent -->|3 - build confidential payment| Core[Confidential settlement core]
    Core -->|4 - verify + settle| Fac[Confidential facilitator]
    Fac -->|private transfer| Chain[Starknet: valid shielded transfer only]
    Agent -->|5 - settlement reference| Server
    Server -->|6 - confirm note + release resource| Agent
    Op -.->|7 - viewing-key disclosure| Auditor[Auditor]
Loading
  1. The operator shields funds into the agent's confidential balance.
  2. The agent requests a resource. The server returns HTTP 402 with payment requirements: amount, asset, recipient, and scheme set to confidential.
  3. The agent builds a confidential payment. It spends a note, creates a recipient note, and generates the validity proof.
  4. The facilitator verifies the payment and settles it on Starknet as a private transfer. The public ledger sees a valid shielded transfer only.
  5. The agent presents the settlement reference to the server.
  6. The server confirms the incoming note and releases the resource.
  7. When required, the operator discloses the payment to an auditor through a viewing key scoped to its own history.

Project status

Working concept. Quittance is being built in the Starknet Proof cohort. This repository holds the public documentation and the code skeleton. The product logic (confidential settlement, proof generation, the x402 confidential scheme, note discovery) is not implemented yet and is marked with TODO where the interfaces live.

Two dependencies gate real settlement and are tracked as open questions in the internal design:

  • STRK20 SDK access. The confidential-transfer integration targets the STRK20 Privacy Wallet API (spec v0.10.3) and its prover. The SDK repository opens after the STRK20 v0.14.3 upgrade. Integration points are marked TODO(STRK20).
  • Note discovery. How a payee detects an incoming shielded note is an open problem in STRK20. It is stubbed behind an interface and marked TODO(OQ2).

Repository layout

quittance/
├── README.md              This file.
├── LICENSE                MIT.
├── docs/
│   └── one-pager.md       The thesis and the wedge.
├── contracts/             Cairo contracts (Scarb + Starknet Foundry).
│   ├── src/               Agent account, settlement core, facilitator, interfaces.
│   └── tests/             snforge tests, one per happy path and failure state.
├── sdk/                   TypeScript SDK (starknet.js).
├── mcp-server/            MCP server exposing Quittance as agent tools.
└── examples/
    └── agent-pays-api/    Demo skeleton: an agent pays a 402-protected API.

Getting started

Prerequisites:

Contracts:

cd contracts
scarb build
snforge test

The contracts compile as interfaces and skeletons. Tests are named for the happy path and each failure state and are marked as TODO bodies until the logic lands.

SDK:

cd sdk
npm install
npm run build

The SDK exposes typed interfaces. Methods throw NotImplemented until each component is built.

MCP server:

cd mcp-server
npm install
npm run dev

Exposes the shield, pay_confidential, confirm_settlement, and disclose tools. Handlers are TODO.

Learn more

See docs/one-pager.md for the thesis, the wedge, and the milestone.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages