2

Im running a full node and am developing an application that interacts with it. One of its features is users should be able to create a pair of Bitcoin PrivKey and PubKey. But for security reasons, I dont want to save them. Not on my wallet.dat, not on database. I want to create the keys programmatically and serve them for the user to manage them.

I don't see a way of doing this through bitcoin-core. How could I accomplish this? Is there a library I could use? Should I create my own methods? Can you think of a workaround?

0

I don't see a way of doing this through bitcoin-core. How could I accomplish this? Is there a library I could use? Should I create my own methods? Can you think of a workaround?

You can disable the wallet by passing --disable-wallet at compile time. I don't think that's what you're asking, though.

I'm guessing you want to be able to query the balance of an address, where the address unknown at the time of synchronization. Bitcoin Core can't do this efficiently, because it doesn't index transactions by address unless the address is in the wallet.

There are patches to Bitcoin Core that create an address index, but none are officially supported.

You could also try one of these non Bitcoin Core solutions.

(Another approach would be to import the public key as watch-only, which would let you do this with Bitcoin Core. I don't know if that satisfies your security requirements, though.)

  • This is useful data @Nick ODell. Would you still use bitcoin-core to sign transactions having the user provide the PrivKey? – ntonnelier Jul 11 '17 at 16:06
  • Yes. The signrawtransaction RPC command allows you to sign a transaction where you provide the RPC the private key. The private key will never enter the wallet. – Andrew Chow Jul 11 '17 at 16:11
  • 1
    We are currently maintaining branch of bitcoind with bitcore patches at github.com/satoshilabs/bitcoin . I don't want to put that into npm since I can't promise long term commitment (also we would need to rename it etc) – Karel Bílek Jul 11 '17 at 17:38
  • You can also use watch-only functionality (which implies storing the address in Bitcoin Core's wallet file, but not the private key). – Pieter Wuille Aug 11 '17 at 5:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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