3 ms·
No server should hold any bitcoins, that's not necessary (and a huge systemic risk). The server just needs to be able to interact with the Bitcoin blockchain, a
by runeks 12y ago
No server should hold any bitcoins, that's not necessary (and a huge systemic risk). The server just needs to be able to interact with the Bitcoin blockchain, and create transactions that a player can pay using a standard Bitcoin wallet (or one that's built into the game, but where the private keys are stored locally).
1. Player 1 wants to trade a shovel with Player 2 in exchange for 10 mBTC, and tells this to the server by generating a bitcoin address that he wishes to receive the funds at, and sending this to the server.
2. The server generates a bitcoin transaction with an output that points to Player 1's address, and asks Player 2 to add an input to the transaction, and pay 10 mBTC from that input to the output added by the server (Player 1's address). The signed transaction is then broadcast.
3. The server keeps an eye on the blockchain, and when the signed transaction makes it into the blockchain (waiting on the number of confirmations that Player 1 and Player 2 agree on), the item is transferred from Player 1 to Player 2 inside the game.