How to Create a Bitcoin Address from a Coin Flip

Standard

In this tutorial you will learn how to create a bitcoin address from coin flips. You can do the whole tutorial either offline or online.  You can take either the end-user approach (easy)  or the programmers / mathematicians approach (HARD! fun fun fun!).

End-user approach  (the non technical approach)

Step 1: Flip a coin 256 times. 

Write a one (1) on heads and a zero (0) on tails. An example result:

 Step 2: Convert it to a bitcoin private key.
Open the page https://brainwallet.github.io/#converter   paste the numbers from above. Press Source Encoding: Bin,  Convert To:  Base58Check. Copy the result, its your private key.

Step 3: Import bitcoin private key
Import the bitcoin private key in your wallet. Please see your wallet homepage to import a private key. If you use bitcoind use:

And That’s how it’s done! If you like my tutorial, please share it with the buttons on the bottom of this post.

Programmers & Mathematicians approach

Step 1: Flip a coin 256 times
A bitcoin private key is a very large number. Every number can be represented in base 2 (binary) number.  Get a coin and label one side (1 or positive) and one side (0 or negative).  Flip the coin 256 times. The results could is a 256 bit sequence such as the one below (groups of4 for readability):

Step 2: Convert to decimal
Convert this huge binary number to decimal.   In our case its  the number 43256275986101861753551728768377656999160759540966415653480512874123449605855.

Example run:

By hand? Convert from base2 to base10. every place is in a binary number is 2^n if you want to do it by hand (from right to left).  See the binary number system.

Step 3: Convert from decimal to base58
Copy the Base58 converter script I wrote and execute it.

Example run:

By hand? To convert to base58 from base10 you need to divide the decimal number by 58.  Save the modulo of each division and use this table to write the elements:

Finally, reverse the string. Let us take an example, the decimal number 591438166.

We then look for each value in the table above.  44 = m, 55 = x, 15 = G, 15 = G,  52 = u.  That makes mxGGU.  We reverse the string and end up with uGGxm. Be careful with uppercase and lowercase.

Wait! We are not there yet. Now that you know how Base54 encoding works you need to convert it to the appropriate WIF (Wallet Import Format).

Step 4:  Convert to WIF (Wallet Import Format)
Convert the decimal you found in step 2 to hexadecimal.  “43256275986101861753551728768377656999160759540966415653480512874123449605855”  becomes
“5fa22f416f501edf2d5fa22fdf2df2df2df2dfdf6fd01edfad5fa22f6f541edf”.

The steps to convert  to WIF are  (We have taken the values from the example). Don’t worry, just use my code below:

Use this code. Set the top  value = “5fa22f416f501edf2d5fa22fdf2df2df2df2dfdf6fd01edfad5fa22f6f541edf” to your own value found in step 2 (in hexadecimal representation).

Example run:

Step 4: Import the private key (base58 string) in your wallet
Import the bitcoin private key in your wallet. Please see your wallet homepage to import a private key. If you use bitcoind use:

And That’s how it’s done! If you like my tutorial, please share it with the buttons on the bottom of this post.

Related work
https://bitcointalk.org/index.php?topic=944596.0
https://bitcointalk.org/index.php?topic=29140.0
https://bitcointalk.org/index.php?topic=129779.0
https://en.bitcoin.it/wiki/Base58Check_encoding
https://en.bitcoin.it/wiki/Wallet_import_format

List of Bitcoin APIs

Standard

APIs are great for development of applications and can save you a lot of time as a developer. We have compiled a list of Bitcoin APIs. These APIs support check an address balance or a transaction status online, real time bitcoin trading and many other cool features. Most if not all of these APIs have a REST interface to interact with the data from any programming language including Python,  PHP, Java, JavaScript and so on.

Blockchain explorer APIs:
The Block chain (transaction database), sequential transaction database found in cryptocurrencies; These APIs support the Bitcoin blockchain.

  • https://blockchain.info/
  • https://blockr.io/
  • https://blockexplorer.com/
  • https://www.biteasy.com/
  • http://www.blocktrail.com
  • http://explorer.chain.com/
  • http://bitcoinchain.com/block_explorer
  • http://bitinfocharts.com/bitcoin/
  • https://chain.so/btc
  • https://helloblock.io/
  • https://gem.co/

Bitcoin trading APIs:
These APIs give you the power to do real time trading between various cryptocurrencies and many other features.

  • https://www.kraken.com/help/api
  • https://developers.coinbase.com/api#permissions-scopes
  • https://btc-e.com/api/documentation
  • https://docs.coinkite.com/api/index.html
  • https://cex.io/api

Related

  • http://subledger.com/

If you know of any other APIs please share in the comments. Please share this post with the buttons below if you like it.