3 ms·
The process goes something like this. 1. A user clicks on a link to buy an item 2. Web application generates a new bitcoin address. This can be done by sendin
by weavejester 16y ago
The process goes something like this.
1. A user clicks on a link to buy an item
2. Web application generates a new bitcoin address. This can be done by sending a command to the official BitCoin daemon, or by calling a method on the BitCoinJ Java library.
3. The web application asks the user to send a sum of money to the recently generated address. If the user is using the official Bitcoin client, they'd do this by clicking "Send Coins", then copy-pasting the address and the correct amount of money into the dialog box.
4. The web application then either polls the Bitcoin daemon to see if the transaction has come through yet, or sets up an event handler if the web app is using BitcoinJ. The transaction must obviously be sent to the right address with the right amount of bitcoins.
5. When the transaction has come through, you can now deliver the product to the user. If there's no particular hurry, or if the product is high-value, you may want to wait until a certain number of Bitcoin nodes have confirmed the transaction.
As far as I'm aware, there aren't yet any drop-in plugins for common web frameworks, but it wouldn't be hard to make one.
- ericflo 16y agoDoes step three involve copy-pasting by design, or can that experience be improved?
- weavejester 16y agoIt could be improved with a browser plugin, or perhaps by registering a URL protocol with the browser. For instance, there could be a link like: bitcoin://1MvtfpuCtfDb2EfbevDB1Ep6Z2X1h5nskf?amount=10.00 This could open up your Bitcoin client with the "Send Coins" dialog box open with the address and amount already filled out. Then the user could just hit the "Send" button to confirm the transaction. However, this is just an example, and nothing like this has been implemented yet to my knowledge.