{"id":18743250,"url":"https://github.com/anthonybudd/spot","last_synced_at":"2025-10-30T23:25:40.979Z","repository":{"id":130731781,"uuid":"343525704","full_name":"anthonybudd/Spot","owner":"anthonybudd","description":"Bitcoin HD Wallet Billing Microservice","archived":false,"fork":false,"pushed_at":"2021-04-11T00:19:08.000Z","size":2633,"stargazers_count":4,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T15:43:10.230Z","etag":null,"topics":["bitcoin","hd-wallet","hdwallet-provider","node"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/anthonybudd.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}},"created_at":"2021-03-01T19:01:25.000Z","updated_at":"2023-03-22T04:34:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"af3aa011-5cfa-4b74-b93f-3c68da9a190e","html_url":"https://github.com/anthonybudd/Spot","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anthonybudd%2FSpot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anthonybudd%2FSpot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anthonybudd%2FSpot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anthonybudd%2FSpot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anthonybudd","download_url":"https://codeload.github.com/anthonybudd/Spot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248635885,"owners_count":21137328,"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","hd-wallet","hdwallet-provider","node"],"created_at":"2024-11-07T16:10:45.965Z","updated_at":"2025-10-30T23:25:35.944Z","avatar_url":"https://github.com/anthonybudd.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Spot - Bitcoin HD Wallet Billing Microservice\n\nSpot is a Bitcoin billing microservice that provides your infrastructure with an endpoint for generating an infinite amount of addresses to handle transactions between your application and users without the need for 3rd parties.\n\n- 🔑 **Secure By Design** - Spot only requires your public key.\n- ☁️ **Production Ready** - Stateless microservice designed for production.\n- 🌳 **HD Wallets** - Billing system that implements [BIP 32 HD Wallets.](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki)\n-  🐳 **DockerHub** - Available on [Docker Hub.](https://hub.docker.com/r/anthonybudd/spot)\n\n\u003cp  align=\"center\"\u003e\n\u003cimg  width=\"200\" src=\"https://raw.githubusercontent.com/anthonybudd/spot/master/docs/img/qr-scan.gif\"  alt=\"Scanning GIF\"\u003e\n\u003c/p\u003e\n\n## Quick Start\nTo start a local instance of Spot you will first need to create a `ROOT_PUBLIC_KEY`. This is the public key for the root HD wallet, all accounts will be derived from this key. Once you have created a public key, pass it to the container as an ENV and run it using Docker.\n\n```sh\nexport ROOT_PUBLIC_KEY=`node -e \"console.log(require('hdkey').fromMasterSeed(Buffer.from(require('bip39').mnemonicToSeedSync(require('bip39').generateMnemonic()).toString('hex'), 'hex')).publicExtendedKey);\"`\n\ndocker run -p 8888:8888 --env ROOT_PUBLIC_KEY=$ROOT_PUBLIC_KEY anthonybudd/spot\n\nopen http://localhost:8888/api/v1/generate/0/0/0.svg?amount=0.005\n```\n\u003csub\u003e\u003csup\u003e⚠️ Do not use the above code to create production keys!\u003c/sub\u003e\u003c/sup\u003e\n\n\n\n## REST API\n\n### `GET - /api/v1/generate/:account/:wallet/:address`\n\nEndpoint for generating the receiving address. The `account`, `wallet` and `address` URL parameters represent the derivation path for the BIP 32 tree node.  \n\n### Response\nBy default the response will be a plain JSON object containing the address.\n\n```json\n{\n\t\"addresss\": \"13sDzEE3L8LeB3Af9SWiNxxY71ZjgqceHB\",\n}\n```\n\n### Response - QR Codes\nTo create a QR code of the address add the file extension `.png` or `.svg` to the endpoint, for example `/api/v1/generate/0/0/0.png`.\n\nIf you would like to prompt the user to pay a specific amount when they scan the QR code use the query parameter `amount`, this value will be in BTC.  Example `/api/v1/generate/0/0/0.png?amount=0.0005`.\n\n\n\u003cp  align=\"center\"\u003e\n\u003cimg  width=\"192\" src=\"https://raw.githubusercontent.com/anthonybudd/spot/master/docs/img/qr.png\"  alt=\"QR Code Example\"\u003e\n\u003c/p\u003e\n\u003csub\u003e\u003csup\u003e⚠️ Do not send Bitcoin here.\u003c/sub\u003e\u003c/sup\u003e\n\n## Implementation\nSpot is a stateless microservice designed to be deployed along with the rest of your containers in your infrastructure. Your application will make an HTTP request to Spot to generate an address.\n\nTo maximise security Spot does not use your private key. This means if your servers get hacked no sensitive information can be compromised. Even with these security measures you should never allow Spot to be publicly open to the internet.\n\nEach user on your application will need their own corresponding `account` in spot. If your user ID column is unsigned int you could use this. Alternatively if you use UUID, you may need to add a new int column to the users table called `account_id` for storing the spot account.\n\nIn production you should only use one `address` for each transaction. So on the first transaction the derivation path will be `.../0/0/0`, the second will be  `.../0/0/1`, the third `.../0/0/2` and so on. \n\n\n```\nROOT_PUBLIC_KEY\n│  \n└─── Account 0\n│   └─── Chain 0\n│       │   Address 0: 1PYvjSG6sHzHbiw19DXsbRqe6tvEU8X294\n│       │   Address 1: 13uZtpZN8gQr7yypD5G5u4Y6sghiBBmAjC\n│       │   Address 2: 1M1cb4EWwRSeGwNCrTtVXiDKzkdPBznzdd\n│       │   ...\n│   \n└─── Account 1\n│   └─── Chain 0\n│       │   Address 0: 17mcx19MzsPAWx18f6RLsB8c66TDHR66aS\n│       │   Address 1: 19f3ExY2LuuYH8nxuP1pPSTaTFLjHYDXn5\n│       │   ...\n│...   \n```\n\n\n###  Example\nBelow is a basic example of how Spot works in practice.\n1. A user incurs a charge on your website, such as a one-off payment or a monthly fee.\n2. The backend of your application will send a request to the Spot microservice `/api/v1/generate/:account/:wallet/:address`. \n3. In your application you will need to prompt the user to send bitcoin to the address. You can use the QR code feature and the  `amount` param to return an image. For example `/api/v1/generate/0/0/15266.png?amount=0.0005`\n4. You will need to externally verify the payment and confirm that correct amount was sent using a Bitcoin full node or an API.\n\n### Why \"Spot\"?\nIt's the furthest thing from Stripe.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanthonybudd%2Fspot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanthonybudd%2Fspot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanthonybudd%2Fspot/lists"}