{"id":17781600,"url":"https://github.com/keep-starknet-strange/cashubrew","last_synced_at":"2025-03-15T23:30:57.498Z","repository":{"id":257855434,"uuid":"859263440","full_name":"keep-starknet-strange/cashubrew","owner":"keep-starknet-strange","description":"Cashu Mint, written in Elixir.","archived":true,"fork":false,"pushed_at":"2024-11-12T18:05:11.000Z","size":853,"stargazers_count":16,"open_issues_count":8,"forks_count":8,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-15T07:13:38.191Z","etag":null,"topics":["bitcoin","cashu","cashubtc","ecash","elixir","elixir-phoenix","lightning-network"],"latest_commit_sha":null,"homepage":"https://cashubrew.app","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/keep-starknet-strange.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/CONTRIBUTING.md","funding":null,"license":"LICENSE","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}},"created_at":"2024-09-18T11:19:26.000Z","updated_at":"2025-03-10T03:19:50.000Z","dependencies_parsed_at":"2024-10-27T04:03:41.664Z","dependency_job_id":null,"html_url":"https://github.com/keep-starknet-strange/cashubrew","commit_stats":null,"previous_names":["keep-starknet-strange/cashubrew"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keep-starknet-strange%2Fcashubrew","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keep-starknet-strange%2Fcashubrew/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keep-starknet-strange%2Fcashubrew/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keep-starknet-strange%2Fcashubrew/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/keep-starknet-strange","download_url":"https://codeload.github.com/keep-starknet-strange/cashubrew/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243806122,"owners_count":20350773,"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","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":["bitcoin","cashu","cashubtc","ecash","elixir","elixir-phoenix","lightning-network"],"created_at":"2024-10-27T04:03:40.249Z","updated_at":"2025-03-15T23:30:57.182Z","avatar_url":"https://github.com/keep-starknet-strange.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003cimg src=\"./docs/resources/img/cashubrew-logo.png\" alt=\"cashubrew-logo\" height=\"260\"/\u003e\n\n\u003ca href=\"https://github.com/keep-starknet-strange/cashubrew/actions/workflows/ci.yml\"\u003e\u003cimg alt=\"GitHub Workflow Status\" src=\"https://img.shields.io/github/actions/workflow/status/AbdelStark/cashubrew/ci.yml?style=for-the-badge\" height=30\u003e\u003c/a\u003e\n\u003ca href=\"https://elixir-lang.org/\"\u003e \u003cimg alt=\"Elixir\" src=\"https://img.shields.io/badge/elixir-%234B275F.svg?style=for-the-badge\u0026logo=elixir\u0026logoColor=white\" height=30\u003e\u003c/a\u003e\n\u003ca href=\"https://bitcoin.org/\"\u003e \u003cimg alt=\"Bitcoin\" src=\"https://img.shields.io/badge/Bitcoin-000?style=for-the-badge\u0026logo=bitcoin\u0026logoColor=white\" height=30\u003e\u003c/a\u003e\n\u003ca href=\"https://lightning.network/\"\u003e\u003cimg src=\"https://img.shields.io/badge/Ligthning Network-000.svg?\u0026style=for-the-badge\u0026logo=data:image/svg%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NyAxMzUuNzI0NCAxMTYuNjYwNyBDIDEzNS43MjQ0IDExNi42NjA3IDEzNS43MjQ0IDExOS44MzkzIDEzOC45MDgxIDExOS44MzkzIEwgMjA0LjE3NDcgMTE5LjgzOTMgQyAyMDQuMTc0NyAxMTkuODM5MyAyMDQuMTc0NyAxMjEuNDI4NiAyMDUuNzY2NyAxMjMuMDE3OSBMIDExMC4yNTQ1IDIyOS41IEMgMTA4LjY2MjYgMjI3LjkxMDcgMTA4LjY2MjYgMjI2LjMyMTQgMTA4LjY2MjYgMjI0LjczMjEgTCAxNDIuMDkxOSAxNTMuMjE0MyBMIDE0Mi4wOTE5IDE0Ni44NTcxIEwgNzUuMjMzMyAxNDYuODU3MSBMIDc1LjIzMzMgMTQwLjUgTCAxNTYuNDE4NyA1MS41IEwgMTYxLjE5NDMgNTEuNSBaIiBmaWxsPSIjZmZmZmZmIi8%2BDQo8L3N2Zz4%3D\" alt=\"Bitcoin Lightning\" height=\"30\"\u003e\u003c/a\u003e\n\n\u003c/div\u003e\n\n# 🌟 Cashubrew: Cashu Mint with Elixir Magic ✨\n\n\u003e 💡 Cashubrew: Where Elixir meets Cashu, creating a symphony of secure, scalable, and lightning-fast ecash transactions!\n\n\u003e ⚠️ Disclaimer: This is a proof of concept and is not ready for production use.\n\n[Why Elixir ?](https://whyelixirlang.com/) - [Learn Elixir](https://elixir-lang.org/learning.html)\n\n## 📚 Learn about Cashu\n\nBefore diving into Cashubrew, it's essential to understand Cashu.\n\nCashu is a free and open-source Chaumian ecash protocol built for [Bitcoin](https://bitcoin.org/bitcoin.pdf).\n\nEssentially, it is a privacy-preserving ecash protocol that enables instant, nearly free, and private transactions.\n\nTo learn more about Cashu:\n\n- 📖 [Cashu Specifications (NUTs)](https://cashubtc.github.io/nuts/): Dive deep into the technical details of the Cashu protocol.\n- 🔍 [Cashu Documentation](https://docs.cashu.space/): Comprehensive guide to understanding and implementing Cashu.\n- 🎨 [Cashu Visual Explainer](https://lconf.gandlaf.com/): An interactive visual guide to help you grasp Cashu concepts.\n\nUnderstanding Cashu will help you appreciate the magic behind Cashubrew and contribute more effectively to the project!\n\n## 🚀 Quick Start\n\nEmbark on your Cashubrew journey with these simple steps:\n\n1. **Clone the Treasure Map**\n\n   ```bash\n   git clone https://github.com/keep-starknet-strange/cashubrew.git\n   cd cashubrew\n   ```\n\n2. **Summon the Dependencies**\n\n   ```bash\n   mix deps.get\n   ```\n\n3. **Prepare the Vault (Database)**\n\n   - Start the PostgreSQL database using Docker Compose (optional, you can connect to an existing database if you already have one):\n\n     ```bash\n     docker-compose -f infra/docker-compose.yml up -d\n     ```\n\n   - Adjust the incantation in `config/dev.exs` if needed\n   - Create and migrate your vault:\n\n     ```bash\n     mix ecto.setup\n     ```\n\n## 🎭 Running the Show\n\nLaunch your Cashubrew server with a single command:\n\n```bash\nmix phx.server\n```\n\n🌈 Voilà! Your mint is now live at `http://localhost:4000`.\n\n## 🧙‍♂️ Wallet CLI Magic\n\nInteract with your Cashubrew instance using the Wallet CLI:\n\n1. **Mint Tokens**\n\n   To mint 42 tokens:\n\n   ```bash\n   mix run -e 'Cashubrew.Wallet.CLI.main([\"mint\", \"42\"])'\n   ```\n\n2. **Check Balance**\n\n   To view your current balance:\n\n   ```bash\n   mix run -e 'Cashubrew.Wallet.CLI.main([\"balance\"])'\n   ```\n\nThese commands allow you to interact with your Cashubrew instance directly from the command line, making it easy to test and manage your ecash transactions.\n\n## 🔮 Conjuring the Release Binary\n\nHarness the full power of Cashubrew by creating a production-ready release binary:\n\n1. **Craft the Magical Artifact**\n\n   Invoke this powerful incantation to forge your release binary:\n\n   ```bash\n   MIX_ENV=prod mix release\n   ```\n\n   This spell will weave together all the necessary components, creating a self-contained magical artifact ready for deployment.\n\n2. **Unleash the Magic**\n\n   To bring your Cashubrew release to life, chant the following:\n\n   ```bash\n   SECRET_KEY_BASE=$(mix phx.gen.secret) \\\n   DATABASE_URL=\"ecto://postgres:postgres@localhost/cashubrew_dev\" \\\n   _build/prod/rel/cashubrew/bin/cashubrew start\n   ```\n\n   Adjust the `DATABASE_URL` as needed for your mystical realm.\n\n   \u003e 🧙‍♂️ Pro Tip: For enhanced security in production environments, avoid using default credentials. Craft unique incantations (environment variables) for each deployment.\n\n3. **Customizing Your Magical Realm**\n\n   Fine-tune your Cashubrew instance by adjusting these mystic variables:\n   - `SECRET_KEY_BASE`: The secret key for your realm. Generate a new one for each deployment.\n   - `DATABASE_URL`: The sacred text to connect to your data vault.\n   - `PORT`: The gateway through which users will access your mint (default: 4000).\n\n   Example of a fully customized summoning:\n\n   ```bash\n   SECRET_KEY_BASE=$(mix phx.gen.secret) \\\n   DATABASE_URL=\"ecto://username:password@localhost/cashubrew_prod\" \\\n   PORT=8080 \\\n   _build/prod/rel/cashubrew/bin/cashubrew start\n   ```\n\nMay your Cashubrew instance thrive and bring forth a new era of magical transactions! 🌟\n\n## 🛠️ Developer's Toolkit\n\n- **Test the Waters**: `mix test`\n- **Polish Your Code**: `mix format`\n- **Manage Your Vault**:\n  - Create: `mix ecto.create`\n  - Migrate: `mix ecto.migrate`\n  - Reset: `mix ecto.reset`\n\n### 🧪 Testing Magic\n\n- **Run All Tests**: `mix test`\n- **Mock the Database**:\n  To use a mock database for testing, set the `MOCK_REPO` environment variable:\n\n```bash\nMOCK_REPO=true mix test\n```\n\n- **Test Coverage**:\n  Unveil the secrets of your test coverage:\n\n```bash\nMIX_ENV=test mix coveralls\n```\n\nFor a detailed HTML report, cast this spell:\n\n```bash\nMIX_ENV=test mix coveralls.html\n```\n\nThe mystical report will appear in `cover/excoveralls.html`.\n\n### 🔍 Code Quality and Security\n\nEnsure your code is top-notch with these magical incantations:\n\n- **Security Checks**: `mix sobelow`\n- **Elixir Best Practices**: `mix credo`\n- **Static Analysis**: `mix dialyzer`\n\nRun these spells regularly to keep your code base clean and secure!\n\n## 🐳 Docker Deployment\n\nSail the high seas with Cashubrew in a Docker container:\n\n1. **Build your ship**:\n\n   ```bash\n   docker build -t cashubrew:latest .\n   ```\n\n2. **Set sail**:\n\n   ```bash\n   docker run \\\n     --name cashubrew \\\n     --network host \\\n     -e DATABASE_URL=\"ecto://postgres:postgres@localhost/cashubrew_dev\" \\\n     -e SECRET_KEY_BASE=$(mix phx.gen.secret) \\\n     -e PORT=4000 \\\n     -e MIX_ENV=prod \\\n     cashubrew:latest\n   ```\n\n   Adjust the `DATABASE_URL` and other environment variables as needed for your voyage.\n\n## 🕵️ Phoenix Live Dashboard\n\nPeek behind the curtain at `http://localhost:4000/dashboard`. Don't forget your secret key!\n\n```bash\nSECRET_KEY_BASE=$(mix phx.gen.secret) MIX_ENV=dev mix phx.server\n```\n\n\u003e 💡 Note: The dashboard is only available in the `dev` environment.\n\n## 🏎️ Turbocharge with Benchmarks\n\nRev up your engines:\n\n```bash\nmix bench\n```\n\n## 🧩 Supported NUTs\n\nHere's a table of the currently supported mandatory NUTs:\n\n| NUT                                           | Description             | Supported |\n| --------------------------------------------- | ----------------------- | --------- |\n| [NUT-00](https://cashubtc.github.io/nuts/00/) | Cryptography and Models | ✅         |\n| [NUT-01](https://cashubtc.github.io/nuts/01/) | Mint public keys        | ✅         |\n| [NUT-02](https://cashubtc.github.io/nuts/02/) | Keysets and fees        | ✅         |\n| [NUT-03](https://cashubtc.github.io/nuts/03/) | Swapping tokens         |           |\n| [NUT-04](https://cashubtc.github.io/nuts/04/) | Minting tokens          |           |\n| [NUT-05](https://cashubtc.github.io/nuts/05/) | Melting tokens          |           |\n| [NUT-06](https://cashubtc.github.io/nuts/06/) | Mint info               | ✅         |\n\nHere's a table of the currently supported optional NUTs:\n\n| NUT                                           | Description                       | Supported |\n| --------------------------------------------- | --------------------------------- | --------- |\n| [NUT-07](https://cashubtc.github.io/nuts/07/) | Token state check                 |           |\n| [NUT-08](https://cashubtc.github.io/nuts/08/) | Overpaid Lightning fees           |           |\n| [NUT-09](https://cashubtc.github.io/nuts/09/) | Signature restore                 |           |\n| [NUT-10](https://cashubtc.github.io/nuts/10/) | Spending conditions               |           |\n| [NUT-11](https://cashubtc.github.io/nuts/11/) | Pay-To-Pubkey (P2PK)              |           |\n| [NUT-12](https://cashubtc.github.io/nuts/12/) | DLEQ proofs                       |           |\n| [NUT-13](https://cashubtc.github.io/nuts/13/) | Deterministic secrets             |           |\n| [NUT-14](https://cashubtc.github.io/nuts/14/) | Hashed Timelock Contracts (HTLCs) |           |\n| [NUT-15](https://cashubtc.github.io/nuts/15/) | Partial multi-path payments (MPP) |           |\n| [NUT-16](https://cashubtc.github.io/nuts/16/) | Animated QR codes                 |           |\n| [NUT-17](https://cashubtc.github.io/nuts/17/) | WebSocket subscriptions           |           |\n\n## 🤝 Join the Cashubrew Community\n\nWe're always looking for fellow wizards to join our quest. Check out our [contribution guidelines](docs/CONTRIBUTING.md) and let's make magic together!\n\n## 📜 License\n\nCashubrew is released under the MIT License. See the [LICENSE](LICENSE) file for more details.\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/AbdelStark\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/45264458?v=4?s=100\" width=\"100px;\" alt=\"A₿del ∞/21M\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eA₿del ∞/21M\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/keep-starknet-strange/cashubrew/commits?author=AbdelStark\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/MSghais\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/59928086?v=4?s=100\" width=\"100px;\" alt=\"MSG\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eMSG\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/keep-starknet-strange/cashubrew/commits?author=MSghais\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/tdelabro\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/34384633?v=4?s=100\" width=\"100px;\" alt=\"Timothée Delabrouille\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eTimothée Delabrouille\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/keep-starknet-strange/cashubrew/commits?author=tdelabro\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/alkhulaifi\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/434157?v=4?s=100\" width=\"100px;\" alt=\"Abdullah Al-Khulaifi\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eAbdullah Al-Khulaifi\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/keep-starknet-strange/cashubrew/commits?author=alkhulaifi\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/green-john\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/896768?v=4?s=100\" width=\"100px;\" alt=\"John Yellow\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eJohn Yellow\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/keep-starknet-strange/cashubrew/commits?author=green-john\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeep-starknet-strange%2Fcashubrew","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeep-starknet-strange%2Fcashubrew","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeep-starknet-strange%2Fcashubrew/lists"}