import key from PEM file #245

pull jtobey wants to merge 3 commits into bitcoin:master from jtobey:master changing 5 files +52 −0
  1. jtobey commented at 9:46 pm on May 19, 2011: none

    Motivation: Create keys on a secure system using only OpenSSL or similar software. Receive BTC, then when ready to spend them, use importkey in a running client.

    importkey <file> <account> Reads a PEM-encoded keypair from file and adds it to the wallet. To create a keypair with OpenSSL, use: openssl ecparam -name secp256k1 -out NEW_KEY.pem -genkey Returns the key’s bitcoin address.

    $ bitcoind importkey ~/NEW_KEY.pem TestAcct mt5M3Qa7fXsUV3bK6WtWTZEvXY2M1UPEgv

    Bug: I’d like to safeguard against overwriting a key in the wallet with bogus data. Bug: I don’t understand what has to be mutexed. Bug: Should do anything possible to make sure the imported key is valid.

    Note: I did not implement the corresponding export function, because my use case does not require it. I will be happy to implement it if this will improve the patch’s chance of acceptance.

    Note: To make this convenient, one (I) would write a little script to read one of these PEM files and print a Bitcoin address. All key handling would be possible offline, and certainly in the absence of a block chain, until spend time. For my next trick, expect offline transaction signing and an importtx function.

    Forum topic: http://forum.bitcoin.org/index.php?topic=9046.0

  2. importkey and ImportPemFile, sans safeguards 9b8f98ad8f
  3. importkey: better help text 4ae5c4588d
  4. Avoid FILE* leak. 9a03627f89
  5. jgarzik commented at 9:05 am on June 14, 2011: contributor
    I think we would prefer this pull request: #220
  6. jtobey commented at 3:33 pm on June 14, 2011: none

    I’m happy with it. I think a simple tool could convert PEM to Sipa’s format. I appreciate your digging through this stuff!

    -John

    On Tue, Jun 14, 2011 at 5:05 AM, jgarzik < reply@reply.github.com>wrote:

    I think we would prefer this pull request: #220

    Reply to this email directly or view it on GitHub: #245 (comment)

  7. gavinandresen commented at 3:48 pm on June 24, 2011: contributor
    I’m going to close this; a tool to convert PEM to sipa’s format would be nifty (and could be shipped with bitcoin in the contrib/ folder).
  8. gavinandresen closed this on Jun 24, 2011

  9. sipa referenced this in commit a591d98c32 on Apr 22, 2015
  10. TheBlueMatt referenced this in commit 582b2934e6 on Oct 20, 2015
  11. deadalnix referenced this in commit 22f60a6280 on Jan 19, 2017
  12. ptschip referenced this in commit ac26645daa on Jan 31, 2017
  13. deadalnix referenced this in commit f63ae558ee on May 10, 2017
  14. lateminer referenced this in commit fa34fddd1c on Dec 9, 2017
  15. classesjack referenced this in commit cfd34e634b on Jan 2, 2018
  16. attilaaf referenced this in commit cde67b0f5d on Jan 13, 2020
  17. Losangelosgenetics referenced this in commit 4fe92794ac on Mar 12, 2020
  18. rajarshimaitra referenced this in commit 4b3e67ed4b on Aug 5, 2021
  19. 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: 2024-11-24 00:12 UTC

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