Skip to content

feat(example): vault privacy provider reference example#354

Merged
rz1989s merged 8 commits into
mainfrom
feat/vault-privacy-provider-example
Jun 25, 2026
Merged

feat(example): vault privacy provider reference example#354
rz1989s merged 8 commits into
mainfrom
feat/vault-privacy-provider-example

Conversation

@rz1989s

@rz1989s rz1989s commented Jun 25, 2026

Copy link
Copy Markdown
Member

What

A reference example showing how to back a pluggable VaultPrivacyProvider interface with the sipher_vault program's native-SOL operations. Lives at examples/vault-privacy-provider/.

SipherVaultPrivacyProvider implements buildFundingTx / verifyFunding / deposit / privateWithdraw / refund / previewWithdraw, backed entirely by the @sipher/sdk native-SOL builders (buildDepositSolTx, buildPrivateSendSolTx, buildRefundSolTx). privateWithdraw demonstrates the full withdraw assembly — a one-time stealth address + Pedersen commitment + viewing-key encryption (mirroring the agent's private-send tool) — then calls buildPrivateSendSolTx.

Why

The vault is a pluggable privacy backend, but there was no end-to-end reference showing an integrator how to satisfy such an abstraction with the native-SOL instructions. This also serves as living documentation for the native-SOL builders shipped in @sipher/sdk.

Privacy model (honest by construction)

  • Depositor-as-vault: one shared depositor signs every flow (commingling). A per-user depositor would link each user's deposit→withdraw on-chain — the README states this and a test enforces it (the submitted tx is parsed; the depositor must be the sole signer across flows).
  • Commingling/decorrelation, not a cryptographic graph-break; amounts are visible (TIER_1 — the Pedersen commitment is for disclosure/audit, not amount-hiding). No overclaims in code or docs.

Scope

  • Native SOL only (SPL / Token-2022 noted as a one-paragraph extension).
  • No new SDK surface — consumes existing exports only. Additive: a new examples/* workspace entry.

Testing

21 unit tests (mocked RPC, real crypto): hex helpers, stealth-artifact assembly (round-trip decrypt), and the provider (incl. the depositor-as-vault invariant via tx-signer interception + rent-exempt-guard propagation). tsc --noEmit clean; naming/style gates clean.

Design spec and implementation plan are included under docs/superpowers/.

@vercel

vercel Bot commented Jun 25, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sipher Ready Ready Preview, Comment Jun 25, 2026 9:00am

@rz1989s rz1989s merged commit b48e8ed into main Jun 25, 2026
8 checks passed
@rz1989s rz1989s deleted the feat/vault-privacy-provider-example branch June 25, 2026 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant