Add 'hdderive' RPC, a generic BIP32 calculator #3520

pull sipa wants to merge 1 commits into bitcoin:master from sipa:hdderive changing 5 files +146 −1
  1. sipa commented at 11:00 PM on January 12, 2014: member

    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.

  2. luke-jr commented at 11:23 PM on January 12, 2014: member

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

  3. sipa commented at 11:30 PM on January 12, 2014: member

    I'm sure tons of such libraries already exist.

  4. sipa commented at 11:32 PM on January 12, 2014: member

    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.

  5. Add 'hdderive' RPC, a generic BIP32 calculator 5e447ad9b7
  6. laanwj commented at 7:16 AM on January 13, 2014: member

    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.

  7. sipa commented at 10:45 AM on January 13, 2014: member

    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.
  8. jgarzik commented at 10:09 PM on June 20, 2014: contributor

    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.

  9. sipa commented at 10:11 PM on June 20, 2014: member

    Agree.

  10. laanwj commented at 8:03 AM on June 23, 2014: member

    Agree @jgarzik

  11. BitcoinPullTester commented at 4:19 PM on June 23, 2014: none

    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.

  12. jgarzik commented at 5:11 PM on July 29, 2014: contributor

    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)

  13. jgarzik closed this on Jul 29, 2014

  14. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-19 09:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me