{"id":29880311,"url":"https://github.com/solana-developers/confidential_balances_microsite","last_synced_at":"2025-07-31T09:40:56.627Z","repository":{"id":281743027,"uuid":"946106438","full_name":"solana-developers/confidential_balances_microsite","owner":"solana-developers","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-27T15:51:43.000Z","size":373,"stargazers_count":2,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-27T16:44:47.990Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://confidential-balances-microsite-peach.vercel.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/solana-developers.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-10T16:08:46.000Z","updated_at":"2025-06-27T15:51:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"4561d90f-f66f-4862-8634-9caecbe52448","html_url":"https://github.com/solana-developers/confidential_balances_microsite","commit_stats":null,"previous_names":["kilogold/confidential_balances_microsite","solana-developers/confidential_balances_microsite"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/solana-developers/confidential_balances_microsite","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solana-developers%2Fconfidential_balances_microsite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solana-developers%2Fconfidential_balances_microsite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solana-developers%2Fconfidential_balances_microsite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solana-developers%2Fconfidential_balances_microsite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/solana-developers","download_url":"https://codeload.github.com/solana-developers/confidential_balances_microsite/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solana-developers%2Fconfidential_balances_microsite/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268017357,"owners_count":24181669,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-31T02:00:08.723Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-31T09:40:54.485Z","updated_at":"2025-07-31T09:40:56.611Z","avatar_url":"https://github.com/solana-developers.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Confidential Balances Token Extension Reference Implementation\n\nA reference implementation demonstrating the **Confidential Balances features** from Solana Program Library's Token22. This project features a Rust backend (Axum) and a React frontend (Next.js).\n\n## Implementation Types\n\n### Trusted Implementation (This Project)\nThis is a **trusted** implementation that demonstrates UX possibilities for confidential balances operations on self-custodial wallets. The trust model works as follows:\n\n- The backend receives the user's wallet message signature\n- This signature serves as the seed for deriving ElGamal \u0026 AES encryption keys\n- The backend handles zero-knowledge proof generation using these derived keys\n- The backend returns partially signed transactions for the wallet to complete\n\n**Suitable For:**\n- Custodial wallet services\n- Wallet-as-a-Service (WaaS) providers\n- Trusted self-custodial wallets (read security considerations below)\n\n```mermaid\nsequenceDiagram\n    participant User\n    participant Wallet\n    participant Backend\n    participant Blockchain\n\n    User-\u003e\u003eWallet: Request confidential operation\n    Wallet-\u003e\u003eBackend: Send message signature\n    Backend-\u003e\u003eBackend: Derive encryption keys\n    Backend-\u003e\u003eBackend: Generate zk-proof\n    Backend-\u003e\u003eWallet: Return partially signed tx\n    Wallet-\u003e\u003eWallet: Complete transaction signing\n    Wallet-\u003e\u003eBlockchain: Submit transaction\n```\n\n### Trustless Implementation\nA trustless implementation would:\n- Generate and manage encryption keys entirely within the wallet\n- Handle zero-knowledge proof generation internally\n- Never expose encryption keys or their seeds to external services\n\n**Current Status:**\n- Rust-based wallets: Available now by implementing the [backend](backend) directly into the wallet client\n- TypeScript wallets: Coming soon with the release of the [ElGamal Proof library](https://github.com/solana-program/zk-elgamal-proof/tree/main/clients/js-legacy#solanazk-elgamal-proof)\n\n```mermaid\nsequenceDiagram\n    participant User\n    participant Wallet\n    participant Blockchain\n\n    User-\u003e\u003eWallet: Request confidential operation\n    Wallet-\u003e\u003eWallet: Generate encryption keys\n    Wallet-\u003e\u003eWallet: Generate zk-proof\n    Wallet-\u003e\u003eWallet: Sign transaction\n    Wallet-\u003e\u003eBlockchain: Submit transaction\n```\n\n## ⚠️ Important Security Considerations\n\nTrusted implementations require handling sensitive cryptographic operations on the backend. This introduces important security requirements:\n\n1. **Key Derivation Security**\n   - The backend derives encryption keys from user-provided seeds\n   - These seeds must be transmitted securely and never stored\n   - HTTPS is mandatory for all client-backend communication\n\n2. **Backend Security Requirements**\n   - Deploy in secure, restricted environments (e.g., Google Cloud Run, secure enclaves)\n   - No caching or persistence of sensitive cryptographic material\n   - Regular security audits and monitoring\n\n3. **Trust Implications**\n   - Users must trust the backend implementation\n   - Backend has theoretical capability to decrypt user balances\n   - Consider implementing additional audit mechanisms\n\n## Live Demo\n\nCheck out the deployed version here: https://confidential-balances-microsite-peach.vercel.app\n\n![](./frontend/static/preview.png)\n\n## Quick Start\n\n### Backend\n\n```bash\ncd backend\ncargo run\n```\n\n### Frontend\n\n```bash\ncd frontend\npnpm install\npnpm dev\n```\n\nFrontend runs at `http://localhost:3000`.\n\n## Deployment\n\nUpdate `frontend/.env`:\n\n```env\nNEXT_PUBLIC_BACKEND_API_ENDPOINT=https://your-hosted-backend-url.com\n```\n\nEnsure backend is accessible at this URL.\n\n## Aditional Resources\n\n- [Token extensions docs](https://solana.com/docs/tokens/extensions)\n- [Confidential Balances Cookbook](https://github.com/solana-developers/Confidential-Balances-Sample/tree/main)\n  - Additional Rust examples\n  - Product guide\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolana-developers%2Fconfidential_balances_microsite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsolana-developers%2Fconfidential_balances_microsite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolana-developers%2Fconfidential_balances_microsite/lists"}