rpc method to get address for private key #5763

issue y opened this issue on February 6, 2015
  1. y commented at 6:10 AM on February 6, 2015: none

    I need the inverse of dumpprivkey. Given a private key, I need to get the corresponding address.

  2. paveljanik commented at 6:32 AM on February 6, 2015: contributor

    I need the inverse of dumpprivkey. Given a private key, I need to get the corresponding address.

    If you have the private key, you can use several utilities to get the address (google for sx, ku, pybitcointools, ...). This surely doesn’t belong to RPC. Private key is cryptographic material!!!

    Please close this issue.

  3. laanwj commented at 9:45 AM on February 6, 2015: member

    Agree with @paveljanik . What you are proposing is a pure utility function, which does not require any of bitcoind's state. A better place for it would be in a library, and indeed there are various such libraries available for different programming languages (e.g. bitcoin-pythonlib for python). There is no advantage (and insecurity through potential interception) to using RPC, and also bottleneck issues.

  4. laanwj closed this on Feb 6, 2015

  5. y commented at 4:45 PM on February 6, 2015: none

    I disagree. I'm trying to implement a script that sweeps cold storage private keys and am using the rpc methods createrawtransaction/signrawtransaction. You might as well argue that signrawtransaction belongs outside of bitcoind because the same reasoning applies.

  6. theuni commented at 5:36 PM on February 6, 2015: member

    Agree with @paveljanik and @laanwj above.

    signrawtransaction has logic to pick the correct private key based on the transaction and the available keys. privkey -> pubkey is a state-less calculation.

    If anything (not actually suggesting, only an example), a separate bitcoin-util cli app would make more sense for these types of simple conversions, similar to pycoin's ku.

  7. MarcoFalke 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-21 18:15 UTC

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