Radacoin (OP)
|
|
April 09, 2013, 07:31:01 AM |
|
I don't trust (online) paper wallet generators. That's why I like to generate keys only using the command line.
I know how to import a private key (with the "importprivatekey" command).
How do I create a private key?
Can I create a temporary private key, that's not stored in my wallet - but only visible on the command line?
|
|
|
|
jackjack
Legendary
Offline
Activity: 1176
Merit: 1260
May Bitcoin be touched by his Noodly Appendage
|
|
April 09, 2013, 07:34:48 AM |
|
If hexadecimal private key is ok for you: tr -dc a-f0-9 < /dev/urandom | head -c 64 Otherwise: tr -dc a-f0-9 < /dev/urandom | head -c 64 | xargs ./pywallet.py --info --importhex --importprivkey
|
Own address: 19QkqAza7BHFTuoz9N8UQkryP4E9jHo4N3 - Pywallet support: 1AQDfx22pKGgXnUZFL1e4UKos3QqvRzNh5 - Bitcointalk++ script support: 1Pxeccscj1ygseTdSV1qUqQCanp2B2NMM2 Pywallet: instructions. Encrypted wallet support, export/import keys/addresses, backup wallets, export/import CSV data from/into wallet, merge wallets, delete/import addresses and transactions, recover altcoins sent to bitcoin addresses, sign/verify messages and files with Bitcoin addresses, recover deleted wallets, etc.
|
|
|
Radacoin (OP)
|
|
April 09, 2013, 07:39:30 AM |
|
If hexadecimal private key is ok for you: tr -dc a-f0-9 < /dev/urandom | head -c 64 Otherwise: tr -dc a-f0-9 < /dev/urandom | head -c 64 | xargs ./pywallet.py --info --importhex --importprivkey
Thanks! Is there an equivalent for Litecoin?
|
|
|
|
jackjack
Legendary
Offline
Activity: 1176
Merit: 1260
May Bitcoin be touched by his Noodly Appendage
|
|
April 09, 2013, 07:42:23 AM |
|
I don't know how Litecoin handles addresses but I think it's the same way, so yeah I think so
|
Own address: 19QkqAza7BHFTuoz9N8UQkryP4E9jHo4N3 - Pywallet support: 1AQDfx22pKGgXnUZFL1e4UKos3QqvRzNh5 - Bitcointalk++ script support: 1Pxeccscj1ygseTdSV1qUqQCanp2B2NMM2 Pywallet: instructions. Encrypted wallet support, export/import keys/addresses, backup wallets, export/import CSV data from/into wallet, merge wallets, delete/import addresses and transactions, recover altcoins sent to bitcoin addresses, sign/verify messages and files with Bitcoin addresses, recover deleted wallets, etc.
|
|
|
Radacoin (OP)
|
|
April 09, 2013, 10:32:42 AM |
|
Can I use the Bitcoin/Litecoin client to temporarily create a private key that's not put in the wallet.dat? -> because I only need it for my paper wallet.
|
|
|
|
jackjack
Legendary
Offline
Activity: 1176
Merit: 1260
May Bitcoin be touched by his Noodly Appendage
|
|
April 09, 2013, 11:20:44 AM |
|
No
|
Own address: 19QkqAza7BHFTuoz9N8UQkryP4E9jHo4N3 - Pywallet support: 1AQDfx22pKGgXnUZFL1e4UKos3QqvRzNh5 - Bitcointalk++ script support: 1Pxeccscj1ygseTdSV1qUqQCanp2B2NMM2 Pywallet: instructions. Encrypted wallet support, export/import keys/addresses, backup wallets, export/import CSV data from/into wallet, merge wallets, delete/import addresses and transactions, recover altcoins sent to bitcoin addresses, sign/verify messages and files with Bitcoin addresses, recover deleted wallets, etc.
|
|
|
deepceleron
Legendary
Offline
Activity: 1512
Merit: 1036
|
|
April 09, 2013, 11:25:02 AM |
|
vanitygen will make an address and private key that is only printed to the console.
|
|
|
|
twmz
|
|
April 09, 2013, 04:11:09 PM |
|
Can I use the Bitcoin/Litecoin client to temporarily create a private key that's not put in the wallet.dat? -> because I only need it for my paper wallet.
No, but you can use the bitcoin client on a disconnected machine to generate a new address, dump the private key, and then delete the wallet.dat file when you are done.
|
Was I helpful? 1 TwmzX1wBxNF2qtAJRhdKmi2WyLZ5VHRs WoT, GPGBitrated user: ewal.
|
|
|
pc
|
|
April 09, 2013, 05:12:33 PM |
|
I threw together a shell script, based on other posts on this forum, which is what I use. It just uses OpenSSL and some simple shell commands to convert to an address.
|
|
|
|
HighInBC
Member
Offline
Activity: 85
Merit: 10
|
|
April 09, 2013, 05:18:49 PM |
|
I wrote this to create a deterministic wallet based on any string: #!/usr/bin/perl use strict; use Digest::SHA qw( sha256 );
my $phrase = $ARGV[0]; my $iter = $ARGV[1] || 10;
my $hash = ''; foreach ( 1 .. $iter ) { $hash = sha256( $hash.$phrase ); my( $key, $address ) = string2keypair( $hash ); print "$key\t$address\n"; }
sub string2keypair { my $key = chr(0x80).shift; my $hash = substr( sha256( sha256( $key ) ), 0, 4 ); $key = unpack( 'H*', $key.$hash ); $key = `./base58encode.sh $key`; `./keyconv $key` =~ m|Address: (1.*)|; my $address = $1; return ( $key, $address ); }
__END__ ./base58encode.sh: #!/bin/bash base58=({1..9} {A..H} {J..N} {P..Z} {a..k} {m..z}) bc <<<"ibase=16; n=${1^^}; while(n>0) { n%3A ; n/=3A }" | tac | while read n do echo -n ${base58[n]} done
It uses "keyconv" from vanitygen.
|
|
|
|
Radacoin (OP)
|
|
April 10, 2013, 07:25:34 AM |
|
vanitygen will make an address and private key that is only printed to the console.
I am just a little bit paranoid Afraid of Backdoors and stuff. This is why I prefer the original client. Was hoping there is a way to generate temporary (private) keys. Thanks for all your replies guys!
|
|
|
|
DannyHamilton
Legendary
Offline
Activity: 3472
Merit: 4798
|
|
April 10, 2013, 01:52:19 PM |
|
vanitygen will make an address and private key that is only printed to the console.
I am just a little bit paranoid Afraid of Backdoors and stuff. This is why I prefer the original client. Was hoping there is a way to generate temporary (private) keys. Thanks for all your replies guys! A private key is just a 256 bit number generated randomly and converted to Wallet Import Format. Here's a suggestion: Flip a well balanced coin 256 times. Write down a 1 every time it lands on heads. Write down a 0 every time it lands on tails. When you are done you will have a private key in binary. Convert from binary (base 2) to hex (base 16). Follow these instructions here to convert to Wallet Import Format... https://en.bitcoin.it/wiki/Wallet_import_format- Add a 0x80 byte in front of it, this is the extended key
- Perform SHA-256 hash on the extended key
- Perform SHA-256 hash on result of SHA-256 hash
- Take the first 4 bytes of the second SHA-256 hash, this is the checksum
- Add the 4 checksum bytes from the previous setp at the end of the extended key from the first step
- Convert the result from a byte string into a base58 string using Base58Check encoding. This is the Wallet Import Format
|
|
|
|
|