Title: What is the safest way to convert a base6 number into a WIF private key? Post by: findftp on August 27, 2015, 11:36:49 AM So I'm planning to throw 99 times with a dice and punch the number into a metal strip or engrave it into marble to produce some bullet proof single address wallet.
Before I go such lengths I want to make sure this approach works. So I want to test each step and even fill this address with a few satoshis and spend them as well before I fill it with more serious amounts. Throwing a dice is easy, but converting it into a WIF private key isn't. The only way I found is through www.bitaddress.org, but I am not able to review the source and I don't want to rely at one source only. Is there anyone who can give me some other suggestions? Title: Re: What is the safest way to convert a base6 number into a WIF private key? Post by: hexafraction on August 27, 2015, 01:32:06 PM While I have not validated the source of bitaddress myself, it has been validated by others. You can also just generate a private exponent from dice rolls and encode it into Base58Check using an appropriate library and programming language. You'd only need to audit a single function, namely that for Base58Check encoding.
Title: Re: What is the safest way to convert a base6 number into a WIF private key? Post by: tspacepilot on August 27, 2015, 03:17:41 PM So I'm planning to throw 99 times with a dice and punch the number into a metal strip or engrave it into marble to produce some bullet proof single address wallet. Wow, seriously? Marble engraving?Quote Before I go such lengths I want to make sure this approach works. So I want to test each step and even fill this address with a few satoshis and spend them as well before I fill it with more serious amounts. Throwing a dice is easy, but converting it into a WIF private key isn't. The only way I found is through www.bitaddress.org, but I am not able to review the source and I don't want to rely at one source only. Is there anyone who can give me some other suggestions? I assume you can figure out how to convert your number into 256bit hex? If so, the following works fine for me: Code: b58 = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' ^^^ That's python, but you could use another language if you want. In the above, key_hex is a string. Here's an example of me using it.: Code: >>> k="1111111111111111111111111111111111111111111111111111111111111111" Title: Re: What is the safest way to convert a base6 number into a WIF private key? Post by: dserrano5 on August 27, 2015, 07:05:19 PM Throwing a dice is easy, but converting it into a WIF private key isn't. […] Is there anyone who can give me some other suggestions? You're on a real operating system, right? If so, you can use bc, the calculator. Code: $ bc My paper wallets have been created from dice rolls. Chinese ones, so I'm free from any tinkering from the NSA :P. Title: Re: What is the safest way to convert a base6 number into a WIF private key? Post by: findftp on August 28, 2015, 08:08:05 AM So I'm planning to throw 99 times with a dice and punch the number into a metal strip or engrave it into marble to produce some bullet proof single address wallet. Wow, seriously? Marble engraving?I should expand on this. I own a metal detector and for a hobby I go to public or private places to scan the soil for historic metallic artifacts. Very often I find metal discs which people used as some sort of value token (coins ;) ) I would like to bury this marble engraved bitcoin address in a public place (a park, a forest, a field) and make sure it's not detectable with a metal detector. If I use metal I'm not so sure about my hobby collegues not finding it. I think it would be pretty safe if only I know where it is burried (and some trusties). It's not like I want to put all my coins on that address, just a few. I like the idea that whatever happens to me or my trusties the address is still accesible. I like the idea that it is possible for someone (a kid digging a hole) to find this thing in let's say 200 years and know what it is and what to do with it. Quote Quote Before I go such lengths I want to make sure this approach works. So I want to test each step and even fill this address with a few satoshis and spend them as well before I fill it with more serious amounts. Throwing a dice is easy, but converting it into a WIF private key isn't. The only way I found is through www.bitaddress.org, but I am not able to review the source and I don't want to rely at one source only. Is there anyone who can give me some other suggestions? I assume you can figure out how to convert your number into 256bit hex? If so, the following works fine for me: Code: b58 = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' ^^^ That's python, but you could use another language if you want. In the above, key_hex is a string. Here's an example of me using it.: Code: >>> k="1111111111111111111111111111111111111111111111111111111111111111" Thanks for the code, I go and play with it. Title: Re: What is the safest way to convert a base6 number into a WIF private key? Post by: findftp on August 28, 2015, 08:09:22 AM Throwing a dice is easy, but converting it into a WIF private key isn't. […] Is there anyone who can give me some other suggestions? You're on a real operating system, right? If so, you can use bc, the calculator. Well, I hope linux mint 17.2 is real enough :) Quote Code: $ bc My paper wallets have been created from dice rolls. Chinese ones, so I'm free from any tinkering from the NSA :P. Great! This looks even more promising to me. Thanks. Title: Re: What is the safest way to convert a base6 number into a WIF private key? Post by: findftp on September 04, 2015, 12:30:00 PM I assume you can figure out how to convert your number into 256bit hex? Yes, I could do it manually but dserrano5 above pointed me to function 'bc' (https://bitcointalk.org/index.php?topic=1163521.msg12259931#msg12259931) which I can use on my linux machine. Quote If so, the following works fine for me: Code: b58 = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' ^^^ That's python, but you could use another language if you want. In the above, key_hex is a string. Here's an example of me using it.: So I've put that code into a file called 'bitoin.py' Then I entered python and figured I had to import that code as a module(?) I did this Code: import bitcoin Quote Code: >>> k="1111111111111111111111111111111111111111111111111111111111111111" This is where I'm stuck. I can enter the 'k', but then I get this: Code: >>> privateKeyToWif(k) What am I doing wrong? I don't have any experience with python. (too many languages to know them all) Title: Re: What is the safest way to convert a base6 number into a WIF private key? Post by: siameze on September 04, 2015, 01:28:44 PM Throwing a dice is easy, but converting it into a WIF private key isn't. […] Is there anyone who can give me some other suggestions? You're on a real operating system, right? If so, you can use bc, the calculator. Code: $ bc My paper wallets have been created from dice rolls. Chinese ones, so I'm free from any tinkering from the NSA :P. I like the bc method best, it reeks of simplicity. Thanks for the share. :) Title: Re: What is the safest way to convert a base6 number into a WIF private key? Post by: tspacepilot on September 04, 2015, 03:05:47 PM findftp, if I recall corrctly, to import a python script as a module you need to have it in a directory along with a file calld __init__.py (which is sometimes empty but can include init routines for classes). To run the code snippet I sent you, you could do one of two things pretty easily:
1) open a python intepreter and just copy/paste in the function defs 2) run the python executable with the -i flag But, actually, I went ahead and tried it and realized there were two missing methods (countLeadingChars, base256decode) and a missing import (hashlib) in the snippet I gave you. Here's the entire snippet again with the missing methods included and a shebang line for good measure. Code: #!/usr/bin/env python ^^That should work for defining methods, if, say, you put that into a file called bitcoin.py you should now be able to do this to load those definitions and play at the intepreter: Code: tsp@computer:/tmp$ python -i bitcoin.py Let me know if you're still stuck. Title: Re: What is the safest way to convert a base6 number into a WIF private key? Post by: findftp on September 04, 2015, 03:54:07 PM Let me know if you're still stuck. Excellent. I already found out the hashlib myself :) but you greatly helped me with the rest. I tested it with a Base6 number, converted to 256hex through 'bc' and then your script. The result was the same when I used the strings at bitaddress.org. I'll donate you and dserrano5 some symbolic satoshis, thanks again. Title: Re: What is the safest way to convert a base6 number into a WIF private key? Post by: tspacepilot on September 04, 2015, 04:01:58 PM Excellent. I already found out the hashlib myself :) but you greatly helped me with the rest. I tested it with a Base6 number, converted to 256hex through 'bc' and then your script. The result was the same when I used the strings at bitaddress.org. I'll donate you and dserrano5 some symbolic satoshis, thanks again. Glad you got it working! I find that -i (to drop you into the interpreter after execution) particularly helpful when debugging python programs. Satoshis always apprecated (profile address works fine), symbolic or otherwise :) Title: Re: What is the safest way to convert a base6 number into a WIF private key? Post by: findftp on September 04, 2015, 07:40:56 PM Excellent. I already found out the hashlib myself :) but you greatly helped me with the rest. I tested it with a Base6 number, converted to 256hex through 'bc' and then your script. The result was the same when I used the strings at bitaddress.org. I'll donate you and dserrano5 some symbolic satoshis, thanks again. Glad you got it working! I find that -i (to drop you into the interpreter after execution) particularly helpful when debugging python programs. Satoshis always apprecated (profile address works fine), symbolic or otherwise :) Do you also have a routine to create a bitcoin public address with python? Too bad, way too much source code. I'm still interested in a routine for public key generation Title: Re: What is the safest way to convert a base6 number into a WIF private key? Post by: tspacepilot on September 04, 2015, 08:21:14 PM Sure, to be fair, most of this code was from Ken Sherrif's bitcoins the hard way blog and the linked repo. I did some modifications myself to make it generate both the compressed and compressed versions and I started modifying it to work on testnet. Here's the entire script I've been playing with. You can see that if you just run it it's going to generate a random bitcoin address. However, if you do as we discussed before, calling it with python -i then you can call the methods you're interested in one-at-time. Or, you could make your own script at the bottom. Or, you could go ahead and convert it into a python module. In any case, here's all the methods I've been using/playing around with.
The method you're looking for are privateKeyToPublicKey, see the bottom of the script for how I call it. Code: #!/usr/bin/env python2.7 Title: Re: What is the safest way to convert a base6 number into a WIF private key? Post by: findftp on September 04, 2015, 09:46:02 PM Lol, bussy for hours reading stuff and trying things.
Nice to figure out you can just feed this script a private hex key as an argument ;D But, always nice to learn the inner workings of bitcoin. Thanks again, this was precisely what I wanted. Title: Re: What is the safest way to convert a base6 number into a WIF private key? Post by: dserrano5 on September 05, 2015, 07:27:45 AM I'll donate you and dserrano5 some symbolic satoshis, thanks again. Thank you! |