How can I send bitcoins in my web app without running the daemon on my server? Is there a way to do it? Do third parties allow you to send through them?


Yes this is completely possible. There are services which run fully featured API's that provide almost everything that the client can do.


There are other merchant processors which have similar functionality depending on exactly what you want to do also.

| improve this answer | |
  • but these require that you keep your private keys with them, do they not? – ekkis Jan 3 at 4:20

If you could somehow track the outputs at your disposal (which you may therefor send in an outgoing transaction you could in fact create a transaction, sign it and submit it to a bitcoind daemon or blockchain.info (via the sendrawtransaction API call) to get it into the network.

Tracking outputs is the sole reason you likely have to run a daemon. Even if you create a single output for 100 BTC and then start creating transactions from that output, by splitting off small amounts and send the change back, it makes the transactions dependent on each other. As soon as a single transaction is not validated (due to a bug, incomplete fees or a double spend), all following transactions will also fail.

Spending bitcoins without being connected to the network overlay is possible, but at some point you'll have to synchronize with the network to ensure the transactions have been accepted and to get fill up the output pool for future spends.

| improve this answer | |

To send bitcoins you need:

  • Private key(s) for the address(es) being spent
  • Transaction hash + index for each transaction previously received to those addresses whose funds will be used for spending in this transaction
  • Bitcoin address(es) to send to, including change address if there will be change.

The Bitcoin.org client does all this elegantly without the user needing to know anything except what address(es) to pay and the amount. To construct a transaction manually means obtaining data from the blockchain, performing a cryptographic signature using the private key, and broadcasting that transaction to peer nodes.

The Raw Transactions API article on the Bitcoin.it Wiki describes this further.

~~This is done using Javascript code from Brainwallet.org~~ [Update: this is defunct, link removed]:

Now if you simply need to send from a node that is not on a live connection (but has a current blockchain), you can do this using the Armory client:

Also the Electrum client apparently can be used to provide to you the raw transaction that could then be broadcast to spend a coin. Electrum uses a back-end server that does all the work that the Bitcoin.org client would do in building the transaction.

Once you have a raw transaction to broadcast, you can use the PushTx API on blockchain.info or BrainWallet.org will let you [broadcast a transaction][3] as well.

| improve this answer | |
  • brainwallet.org doesn't resolve. there's brainwallet.io but that seems like something else – ekkis Jan 3 at 3:24

Not the answer you're looking for? Browse other questions tagged or ask your own question.