Skip to content

Conversation

sipa
Copy link
Member

@sipa sipa commented Jan 12, 2014

This adds a 'hdderive' RPC command, which allows arbitrary BIP32 chains/addresses to be computed.

It supports starting from a seed, or from an xpub/xprv specification, and computes for the provided root or any derivation thereof the depth, index, chaincode, public key, address, fingerprint, parent fingerprint, private key, extended public key, and extended private key.

Note that this does not add HD functionality to the wallet itself.

@luke-jr
Copy link
Member

luke-jr commented Jan 12, 2014

This is pretty stateless. What do you think of making/using a shared library with stuff like this?

@sipa
Copy link
Member Author

sipa commented Jan 12, 2014

I'm sure tons of such libraries already exist.

@sipa
Copy link
Member Author

sipa commented Jan 12, 2014

You're right of course, but it's pretty nice to have this available in the client (perhaps mostly inside the GUI; for RPC you can use a python library or something easily too), and the code is already there.

@laanwj
Copy link
Member

laanwj commented Jan 13, 2014

Edit: I take back my recommendation to not merge. The point about confusion still stands, the solution may be just to document better that this is not part of wallet functionality:

Also offering per-key functionality unrelated to the wallet is bound to confuse people with the current wallet. People will try to use this, then possibly importprivkey, then forget about change addresses that still get generated the random way.

@sipa
Copy link
Member Author

sipa commented Jan 13, 2014

Three points from discussing this in #bitcoin-dev:

  • Let's wait until some form of deterministic wallets are implemented as well, so this feature doesn't confuse people into thinking their wallets are deterministic.
  • Move this to rcpmisc, as it's a utility that may be useful without having a live wallet.
  • Document clearly in the help message that this is only a utility, and does not interact with the wallet.

@jgarzik
Copy link
Contributor

jgarzik commented Jun 20, 2014

I think this is more appropriate outside bitcoind, in an in-tree utility.

PR #4332 adds the "bitcoin-tx" utility. I was also thinking about adding simple "bitcoin-script" and "bitcoin-key" utilities along similar lines. hdderive would find a perfect home among such utilities.

In general, I would prefer to move all "utility RPCs" completely outside bitcoind. e.g. with #4332 we can eliminate "createrawtransaction", "decoderawtransaction" and other RPCs that touch neither wallet nor blockchain.

@sipa
Copy link
Member Author

sipa commented Jun 20, 2014

Agree.

@laanwj
Copy link
Member

laanwj commented Jun 23, 2014

Agree @jgarzik

@BitcoinPullTester
Copy link

Automatic sanity-testing: FAILED MERGE, see http://jenkins.bluematt.me/pull-tester/p3520_5e447ad9b71a2b40431acc0f99967ba14b014cb5/ for test log.

This pull does not merge cleanly onto current master
This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/
Contact BlueMatt on freenode if something looks broken.

@jgarzik
Copy link
Contributor

jgarzik commented Jul 29, 2014

Closing this, with the presumption that a similar feature will be added to a utility like bitcoin-tx (and a PR opened for that at that time)

@jgarzik jgarzik closed this Jul 29, 2014
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants