how to create your ₿itcoin paper wallet like a JEDI

in #undefined6 years ago (edited)

Cold vs Hot wallets

Hot wallets are connected to the internet while cold wallets are not. Hence hot wallets are vulnerable to theft. Yet indispensable for day to day transactions.
Cold wallets have different types could be a hardware or a paper wallet or web/mobile or desktop application. As long as something is connected to the internet, it is vulnerable to attack. Creating a wallet require software installation and the internet is full of tampered wallets that contains trojans, backdoors and malicious code .
Hardware wallets are more secure yet they still require an internet connection to setup. Trezor is my choice they have the best ui, security, team and implementation .
A paper wallet is an offline mechanism for storing bitcoins.
Most Bitcoin users generate paper wallets using open-source wallet generator, such as BitAddress.org, BitcoinpaperWallet.com, and WalletGenerator.net . Those website use javascript in the browser to generate the private public key , although you need to delete your browser history and disconnect the world wide web it can be exposed to many type of vulnerability in the browser in javascript or in the website itself .
For that i have decided to write a small tutorial to create paper wallets offline using a crystal clear source code. We will not generate a hierarchical deterministic wallet (hd) we will just generate one btc address and its key.
This form of 'cold storage' confers enormous security advantages.

Spoiler Alert

Most Paper wallet users Import the private key to a software wallet send the transaction and destroy it by uninstalling the wallet . ALERT The majority of those wallet generate another address and send to it the remaining amount which mean the initial paper wallet will be empty. For a best practice you need to generate an a new address and transfer the change to a new paper wallet .

Code mask on

Key Analogy

Anatomy

Creating the wallet

You need to install [email protected]
than

pip install ecdsa hashlib base58

Make sure you disconnect your pc at this stage

#!/usr/bin/env python

import os
import ecdsa
import hashlib
import base58

def wif_conversion(pk):
      global wif
      padding = '80' + pk
      # print padding

      hashedVal = hashlib.sha256(padding.decode('hex')).hexdigest()
      checksum = hashlib.sha256(hashedVal.decode('hex')).hexdigest()[:8]
      # print hashedVal
      # print padding+checksum

      payload = padding + checksum
      wif = base58.b58encode(payload.decode('hex'))
      print wif


pk = os.urandom(32).encode("hex")
wif_conversion(pk)

sk = ecdsa.SigningKey.from_string(pk.decode("hex"), curve = ecdsa.SECP256k1)
vk = sk.verifying_key
publicKey = ("\04" + vk.to_string())
ripemd160 = hashlib.new('ripemd160')
ripemd160.update(hashlib.sha256(publicKey).digest())
networkAppend = '\00' + ripemd160.digest()
checksum = hashlib.sha256(hashlib.sha256(networkAppend).digest()).digest()[:4]
binary_address = networkAppend + checksum
publicAddress = base58.b58encode(binary_address)
print publicAddress

Save the code in a .py file and run Python file.py

Result will be printed in your console :

5KGHh2aQwH1DDUQpPHzQEneNxZZaXwht9ZabKP1sNuYPoeLZeyF(Private key)
1AZXPSeznHycFinjBzDZGUra5b1doenPET(Public Key)

ET VOILA!

Now you made your addresses safe and sound .
if you lose the paper wallet and have not created a backup copy, there is no means of restoring your access to your currency . Act wisely.
... And may the force be with you.

Sort:  

Congratulations @rawbot! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 1 year!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Do not miss the last post from @steemitboard:

The Steem community has lost an epic member! Farewell @woflhart!
SteemitBoard - Witness Update
Do not miss the coming Rocky Mountain Steem Meetup and get a new community badge!
Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Coin Marketplace

STEEM 0.15
TRX 0.23
JST 0.032
BTC 84202.56
ETH 2223.26
USDT 1.00
SBD 0.64