feat(example): vault privacy provider reference example#354
Merged
Conversation
A public, naming-clean reference showing how to back a pluggable VaultPrivacyProvider interface with the sipher_vault native-SOL builders (deposit/withdraw_private/refund), including the full stealth + Pedersen commitment + viewing-key assembly. Design only; implementation follows.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A reference example showing how to back a pluggable
VaultPrivacyProviderinterface with thesipher_vaultprogram's native-SOL operations. Lives atexamples/vault-privacy-provider/.SipherVaultPrivacyProviderimplementsbuildFundingTx/verifyFunding/deposit/privateWithdraw/refund/previewWithdraw, backed entirely by the@sipher/sdknative-SOL builders (buildDepositSolTx,buildPrivateSendSolTx,buildRefundSolTx).privateWithdrawdemonstrates the full withdraw assembly — a one-time stealth address + Pedersen commitment + viewing-key encryption (mirroring the agent's private-send tool) — then callsbuildPrivateSendSolTx.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)
Scope
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 --noEmitclean; naming/style gates clean.Design spec and implementation plan are included under
docs/superpowers/.