{"id":15288281,"url":"https://github.com/davisdmitry/bitpursebot","last_synced_at":"2025-05-07T03:45:24.033Z","repository":{"id":199542912,"uuid":"703030629","full_name":"DavisDmitry/BitPurseBot","owner":"DavisDmitry","description":"Self-custody Bitcoin wallet within Telegram","archived":false,"fork":false,"pushed_at":"2024-10-01T03:58:31.000Z","size":228,"stargazers_count":6,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-07T03:45:13.650Z","etag":null,"topics":["bitcoin","bitcoin-wallet","telegram","telegram-bot","telegram-mini-app"],"latest_commit_sha":null,"homepage":"https://t.me/BitPurse_bot","language":"Zig","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/DavisDmitry.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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":"2023-10-10T13:15:33.000Z","updated_at":"2024-10-01T03:58:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"6400e4a9-98e8-49c9-827c-cadbdf11aa23","html_url":"https://github.com/DavisDmitry/BitPurseBot","commit_stats":null,"previous_names":["davisdmitry/bitpursebot"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavisDmitry%2FBitPurseBot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavisDmitry%2FBitPurseBot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavisDmitry%2FBitPurseBot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavisDmitry%2FBitPurseBot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DavisDmitry","download_url":"https://codeload.github.com/DavisDmitry/BitPurseBot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252810273,"owners_count":21807759,"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","bitcoin-wallet","telegram","telegram-bot","telegram-mini-app"],"created_at":"2024-09-30T15:46:18.279Z","updated_at":"2025-05-07T03:45:24.004Z","avatar_url":"https://github.com/DavisDmitry.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eBitPurseBot\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\u003ca href=\"https://t.me/BitPurse_bot\"\u003eBitPurseBot\u003c/a\u003e - a self-custody opensource Bitcoin wallet within Telegram.\u003c/p\u003e\n\n---\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://t.me/BitPurse_bot\"\u003e\u003cimg alt=\"BitPurseBot\" src=\"https://img.shields.io/badge/Testnet_bot-gray?logo=telegram\"\u003e\u003c/a\u003e\n\u003ca href=\"https://kit.svelte.dev\"\u003e\u003cimg alt=\"SvelteKit\" src=\"https://img.shields.io/badge/SvelteKit-gray?logo=svelte\"\u003e\u003c/a\u003e\n\u003ca href=\"https://sveltequery.vercel.app/\"\u003e\u003cimg alt=\"Static Badge\" src=\"https://img.shields.io/badge/Svelte_Query-gray\"\u003e\u003c/a\u003e\n\u003ca href=\"https://tailwindcss.com/\"\u003e\u003cimg alt=\"TailwindCSS\" src=\"https://img.shields.io/badge/TailwindCSS-gray?logo=tailwindcss\"\u003e\u003c/a\u003e\n\u003ca href=\"https://m3.material.io/\"\u003e\u003cimg alt=\"Material You\" src=\"https://img.shields.io/badge/Material_You-gray\"\u003e\u003c/a\u003e\n\u003ca href=\"https://ziglang.org/\"\u003e\u003cimg alt=\"Zig lang\" src=\"https://img.shields.io/badge/Zig-gray?logo=zig\"\u003e\u003c/a\u003e\n\u003ca href=\"https://webassembly.org/\"\u003e\u003cimg alt=\"Web Assembly\" src=\"https://img.shields.io/badge/WASM-gray?logo=webassembly\"\u003e\u003c/a\u003e\n\u003ca href=\"https://blockstream.info/\"\u003e\u003cimg alt=\"BlockStream\" src=\"https://img.shields.io/badge/BlockStream-gray\"\u003e\u003c/a\u003e\n\u003ca href=\"https://grammy.dev\"\u003e\u003cimg alt=\"Grammy\" src=\"https://img.shields.io/badge/Grammy-gray\"\u003e\u003c/a\u003e\n\u003ca href=\"https://pocketbase.io/\"\u003e\u003cimg alt=\"PocketBase\" src=\"https://img.shields.io/badge/PocketBase-gray?logo=pocketbase\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n## Run locally\n\n### Requirements\n\n- You have [yarn](https://yarnpkg.com/getting-started/install) installed\n\n- You have bot registered via [@BotFather](https://t.me/botfather)\n\n### Instruction\n\n- Clone this repository:\n\n  ```bash\n  git clone https://github.com/DavisDmitry/BitPurseBot\n  ```\n\n- Install dependencies\n\n  ```bash\n  yarn\n  ```\n\n- Copy `.env.example` as `.env`\n\n  ```bash\n  cp .env.example .env\n  ```\n\n- Make the app public available\n\n  ```bash\n  yarn expose\n  ```\n\n- Edit your `.env` (see [Configuration](#Configuration)).\n\n- Build\n\n  ```bash\n  yarn build\n  ```\n\n- Set webhook url (replace `\u003cVALUE\u003e` with values from [Configuration](#Variables))\n\n  ```bash\n  curl -d \"url=\u003cPUBLIC_APP_URL\u003e/api/bot\u0026secret_token=\u003cWEBHOOK_SECRET\u003e\" -X POST https://api.telegram.org/bot\u003cBOT_TOKEN\u003e/setWebhook\n  ```\n\n- Run\n\n  ```bash\n  yarn preview\n  ```\n\n## Configuration\n\nEverything is configured using environment variables. All settings can be divided into two types:\n\n- Static (build time)\n- Dynamic (runtime)\n\n\u003e [About SvelteKit environment variables](https://joyofcode.xyz/sveltekit-environment-variables)\n\n### Variables\n\n- **`PUBLIC_NET`**: Bitcoin network (`main` or `test`) - _static_\n- **`PUBLIC_BOT_USERNAME`**: Username of your bot (without `@`) - _static_\n- **`PUBLIC_APP_URL`**: Base path of your mini app - _static_\n  \u003e must start with `https://`\n- **`BOT_TOKEN`**: Token of your bot - _dynamic_\n  \u003e You can get it from [@BotFather](https://t.me/botfather)\n- **`WEBHOOK_SECRET`**: Secret token for webhooks from Telegram Bot API - _dynamic_\n  \u003e [Bot API #sendWebhook](https://core.telegram.org/bots/api#setwebhook)\n- **`PB_URL`**: PocketBase backend URL - _dynamic_, optional (set empty string if you don't need it)\n  \u003e [Optional PocketBase backend](#Optional%20backend)\n- **`PB_EMAIL`**: PocketBase admin email - _dynamic_, required if **`PB_URL`** provided (set empty string if you don't need it)\n- **`PB_PASSWORD`**: PocketBase admin password - _dynamic_, required if **`PB_URL`** provided (set empty string if you don't need it)\n\n## Optional backend\n\nIf you want to save bot users to a database, you can run the [PocketBase](https://pocketbase.io/) backend. But this is not necessary, the bot will work without it.\n\n### Instruction\n\n- [Download PocketBase binary](https://github.com/pocketbase/pocketbase/releases)\n\n- Apply migrations (stored in `pb_migrations`)\n\n  ```bash\n  ./pocketbase migrate\n  ```\n\n- Start the web server\n\n  ```bash\n  ./pocketbase server\n  ```\n\n- Go to PocketBase admin UI and setup admin account\n\n- Configure **`PB_*`** variables in your `.env`\n\n## Production deploy\n\nBitPurseBot can be deployed like any other SvelteKit application. See [SvelteKit documentation](https://kit.svelte.dev/docs/adapters)\n\n## For developers\n\nWASM code for signing transactions has already been compiled (stored in `static`). You can also compile it yourself if you have [Zig](https://ziglang.org/) installed\n\n```bash\nyarn build-zig\n```\n\n### Supported Telegram Mini App features\n\n- Scanning a QR-code: [`src/routes/wallet/send/+page.svelte`](https://github.com/DavisDmitry/BitPurseBot/blob/master/src/routes/wallet/send/+page.svelte)\n\n- Popups, closing confirmation\n\n- Dynamic theme changing: [`src/routes/+layout.ts`](https://github.com/DavisDmitry/BitPurseBot/blob/master/src/routes/+layout.svelte)\n\n- Main button\n\n- Back button\n\n- Haptic feedback\n\n## Current state and limitations\n\nSince I had a little time to develop, the functionality of BitPurseBot is quite limited at the moment.\n\n- BIP-44 and BIP-84 have been partially implemented. BitPurseBot creates a hierarchy of keys, but uses only one account and one key for incoming transactions and change (`m/84'/0'/0'/0/0` for mainnet, `m/84'/1'/0'/0/0` for testnet)\n\n- Only one address type can be created: Native SegWit (bech32)\n\n- Only one type of outgoing transactions is supported: P2WPKH (native SegWit)\n\n- The seed phrase cannot be imported and is generated randomly when the Mini App is first launched\n\n- The seed phrase is stored in localStorage (wallet's TON Space does the same, but has the ability to make a cloud backup)\n\nBecause of all this, the mainnet version has not yet been launched.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavisdmitry%2Fbitpursebot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavisdmitry%2Fbitpursebot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavisdmitry%2Fbitpursebot/lists"}