CoinDiver (OP)
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
August 28, 2012, 02:37:38 AM |
|
How would one go about generating creating custom private keys? My specific need is for one in all caps. The idea is to create a private key that can be punched in to a solid block of aluminum with a simple set of metal punches. That way the key is never out of my possession.
Thanks!
|
|
|
|
DeathAndTaxes
Donator
Legendary
Offline
Activity: 1218
Merit: 1079
Gerald Davis
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
August 28, 2012, 02:48:28 AM |
|
private keys are simply random numbers encoded in various formats (there are more than one). Understand you are significantly reducing the entropy of your private key by eliminating all the incompatible digits.
One method would be to randomly generate each digit (A-Z) and concatenate the values.
|
|
|
|
casascius
Mike Caldwell
VIP
Legendary
Offline
Activity: 1386
Merit: 1140
The Casascius 1oz 10BTC Silver Round (w/ Gold B)
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
August 28, 2012, 02:55:06 AM |
|
The checksum value at the end is outside of your control, but given that it's only 32 bits (~5 characters) you can simply try different keys until you get a value that meets your needs, which should be relatively easy.
|
Companies claiming they got hacked and lost your coins sounds like fraud so perfect it could be called fashionable. I never believe them. If I ever experience the misfortune of a real intrusion, I declare I have been honest about the way I have managed the keys in Casascius Coins. I maintain no ability to recover or reproduce the keys, not even under limitless duress or total intrusion. Remember that trusting strangers with your coins without any recourse is, as a matter of principle, not a best practice. Don't keep coins online. Use paper or hardware wallets instead.
|
|
|
kjj
Legendary
Offline
Activity: 1302
Merit: 1026
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
August 28, 2012, 03:13:38 AM |
|
Don't let anyone trick you into posting pictures here on the forums when you are done.
|
17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8 I routinely ignore posters with paid advertising in their sigs. You should too.
|
|
|
payb.tc
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
August 28, 2012, 03:29:50 AM |
|
private keys are simply random numbers encoded in various formats (there are more than one). Understand you are significantly reducing the entropy of your private key by eliminating all the incompatible digits.
One method would be to randomly generate each digit (A-Z) and concatenate the values.
*very* rough code with lots of bugs: function upper_key($num) { $key = '';
while ($num > 26) { $char_num = $num % 26; $num = ($num - $char_num) / 26;
$key = chr($char_num+65) . $key; }
$key = chr($num+65) . $key;
return $key; }
|
|
|
|
casascius
Mike Caldwell
VIP
Legendary
Offline
Activity: 1386
Merit: 1140
The Casascius 1oz 10BTC Silver Round (w/ Gold B)
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
August 28, 2012, 03:46:01 AM |
|
Here is an example private key:
5JABCDEFGHJKLMNPQRSTUVWXYZABCDEFGHJKLMNPQRSTPRQDTCD
Its corresponding Bitcoin address:
16XGpiDjnSq6H7bXuxAJiYQYGjpvz4BCh6
To get it, I just used the sequential letters you see as a private key (ignoring the invalid checksum at first), and then incremented it until it satisfied the capital letter condition with its correctly computed checksum.
I assume you don't mind the leading 5, you can't really get rid of it if you want to use this format.
|
Companies claiming they got hacked and lost your coins sounds like fraud so perfect it could be called fashionable. I never believe them. If I ever experience the misfortune of a real intrusion, I declare I have been honest about the way I have managed the keys in Casascius Coins. I maintain no ability to recover or reproduce the keys, not even under limitless duress or total intrusion. Remember that trusting strangers with your coins without any recourse is, as a matter of principle, not a best practice. Don't keep coins online. Use paper or hardware wallets instead.
|
|
|
CoinDiver (OP)
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
August 28, 2012, 04:53:57 AM |
|
Thanks everyone. Letters and numbers are fine, but the stamps/punches come in uppercase.
I will take a look at the code tomorrow at my desk. I'm sure I can whip something up real quick to generate a key.
I will be happy to post the final result... Without the private or public key of course.
|
|
|
|
casascius
Mike Caldwell
VIP
Legendary
Offline
Activity: 1386
Merit: 1140
The Casascius 1oz 10BTC Silver Round (w/ Gold B)
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
August 28, 2012, 06:20:20 AM |
|
A hidden feature of Casascius Bitcoin Utility: add a question mark to the end of any Base58-encoded string to disregard the checksum. https://casascius.com/btcaddress.zipQuick way to generate an uppercase private key: 1. generate a normal private key 2. manually change all the lowercase letters to uppercase (except O and I, which are not allowed as uppercase but are allowed as lowercase - change them to something else of your choice)... make sure the length is not changed. 3. Add a question mark to the end (that increases the length by 1) 4. Convert it to hex by clicking the button 5. Convert it back to a WIF private key (which calculates the correct checksum) 6. If correcting the checksum caused lowercase letters to be added, then start changing (incrementing) the last hex digit or two, and convert to WIF again, until you find something without lowercase letters.
|
Companies claiming they got hacked and lost your coins sounds like fraud so perfect it could be called fashionable. I never believe them. If I ever experience the misfortune of a real intrusion, I declare I have been honest about the way I have managed the keys in Casascius Coins. I maintain no ability to recover or reproduce the keys, not even under limitless duress or total intrusion. Remember that trusting strangers with your coins without any recourse is, as a matter of principle, not a best practice. Don't keep coins online. Use paper or hardware wallets instead.
|
|
|
etotheipi
Legendary
Offline
Activity: 1428
Merit: 1093
Core Armory Developer
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
August 28, 2012, 03:07:11 PM |
|
Just a comment:
Addresses and keys are usually expressed as Base58. This doesn't have to be the case.
Take your regular key, and instead of encoding it as base 58, encode it as Base26, with [A-Z] ~ [0-25]. Or Base36: [A-Z,0-9]~[0,35]. Add an extra line or in parentheses "BASE26" to the plate, to identify how it was created. Regardless of whether it is Base58 or Base26, it still needs to end up in Base256 before it is interpreted by the computer. If someone knows it's a private key, it will be recoverable...
Also, if you are etching this in metal, the checksum isn't quite as important: I imagine this is going to be extremely resilient, so the extra checksum characters won't make much of a difference -- you're much more likely to lose the whole thing, or have it completely destroyed by accident, than somehow losing only one or two characters. But you can add it anyway: just start with your binary (Base256) private key, add the four-byte checksum, then convert all 36 bytes to Base26. Done.
|
|
|
|
MatthewLM
Legendary
Offline
Activity: 1190
Merit: 1004
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
August 28, 2012, 03:13:07 PM |
|
An easy way may be to convert to hex and then modify the hex so that 0-9 becomes A-J and A-F becomes K-P.
|
|
|
|
casascius
Mike Caldwell
VIP
Legendary
Offline
Activity: 1386
Merit: 1140
The Casascius 1oz 10BTC Silver Round (w/ Gold B)
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
August 28, 2012, 03:27:47 PM |
|
An easy way may be to convert to hex and then modify the hex so that 0-9 becomes A-J and A-F becomes K-P.
I am guessing he has access to print numbers, so he could just as well express the entire key in hex.
|
Companies claiming they got hacked and lost your coins sounds like fraud so perfect it could be called fashionable. I never believe them. If I ever experience the misfortune of a real intrusion, I declare I have been honest about the way I have managed the keys in Casascius Coins. I maintain no ability to recover or reproduce the keys, not even under limitless duress or total intrusion. Remember that trusting strangers with your coins without any recourse is, as a matter of principle, not a best practice. Don't keep coins online. Use paper or hardware wallets instead.
|
|
|
thebaron
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
August 28, 2012, 03:31:40 PM |
|
Thanks everyone. Letters and numbers are fine, but the stamps/punches come in uppercase.
Then just turn them sideways for lowercase.
|
|
|
|
CoinDiver (OP)
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
August 28, 2012, 04:06:29 PM |
|
An easy way may be to convert to hex and then modify the hex so that 0-9 becomes A-J and A-F becomes K-P.
I am guessing he has access to print numbers, so he could just as well express the entire key in hex. Yep, A-Z, 0-9.
|
|
|
|
maaku
Legendary
Offline
Activity: 905
Merit: 1012
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
August 29, 2012, 12:42:26 AM |
|
base32?
|
I'm an independent developer working on bitcoin-core, making my living off community donations. If you like my work, please consider donating yourself: 13snZ4ZyCzaL7358SmgvHGC9AxskqumNxP
|
|
|
|