0

I'm trying to build a good security for my online bitcoin based application. Is something like this possible?

send_bitcoin(address)
create_address()
sweep_balances()
       +
       |
       |
       v         New transactions
+-------------+  <----------------   +--------------+
|             |                      |              |
| Wallet keys +--------------------->+ Bitcoin core |
|             |                      |              |
+-------------+   Submit signed tx   +--------------+

The "Wallet keys" will be my hot wallet. There will be another wallet store which would be used for cold storage. The "bitcoin core" will be some trusted public node that I don't control.

Does using this architecture have any disadvantages over running a full bitcoin core to keep addresses?

I need to get callbacks for new transactions on the list of addresses in my store, that is not managed by bitcoin core. Is it possible using this method?

My reason is that running a full "bitcoin core" takes up too much computing resources & disk which is expensive on cloud and by doing this I can avoid having to run and maintain a bitcoin node. I can submit a signed transaction to any trusted node.

Thanks.

2 Answers 2

0

Does using this architecture have any disadvantages over running a full bitcoin core to keep addresses?

Yes.

The "bitcoin core" will be some trusted public node that I don't control.

That is a huge disadvantage.

As Satoshi Nakamoto wrote:

What is needed is an electronic payment system based on cryptographic proof instead of trust, allowing any two willing parties to transact directly with each other without the need for a trusted third party.

(my emphasis)

Every time someone tries to undo this they are kicking the founder of Bitcoin in the teeth!


Other references

2
  • I understand this hurts the idea behind bitcoin! Otherwise, since the transactions are signed from my side, it doesn't seem like the third party node can act maliciously, the worst that they can do is ignore my transaction. Is there any other possible attack scenario?
    – viko
    Feb 6, 2019 at 16:30
0

Yes you can use this architecture, provided that the bitcoin node you don't control doesn't know your private keys for any address you use.

What you want to do is use a reputable library, for instance electrum client, but there are many libraries in many languages available to do basic things.

From electrum client for instance, you can:

  • create address (wallet, keep private)
  • create raw transaction (unsigned, and just collection of utxos basically)
  • sign transactions (keep private keys private), output hex of signed tx is safe to then broadcast
  • broadcast transactions

Electrum client is sometimes called SPV mode (simple payment verification). This is the protocol used for lite clients, mobile wallets etc.

Once you sign your transaction, it can be broadcast via the bitcoin node you don't control, a public electrum server, or an explorer that offers relay via an api. Some mining pools offer transaction broadcasting as well.

The main thing to be hyper-vigilant about is that you keep your private keys (wif) secret.

As for getting a "callback" about transactions to your wallet, you can use an explorer to poll your addresses for new transactions. Also using an electrum wallet will give you the ability to do all of this as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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