Bitcoin Address Generation On Python - by Burakcan Ekici - Coinmonks - Medium
Bitcoin Address Generation On Python - by Burakcan Ekici - Coinmonks - Medium
Bitcoin Address Generation On Python - by Burakcan Ekici - Coinmonks - Medium
CONTACT CRYPTO EXCHANGE TRADING BOTS TAX SOFTWARE LENDING SIGNALS INDIA TELEGRAM
B
itcoin is a digital currency created in January 2009. It follows the
ideas set out in a whitepaper by the mysterious and pseudonymous
developer Satoshi Nakamoto. A bitcoin address is a unique identifier that
serves as a virtual location where the cryptocurrency can be sent or hold.
Transactions provide to transfer assets between Bitcoin wallets that keep
private key and bitcoin addresses. The private key ensures that the
transaction comes from the owner of the wallet. Generating bitcoin address
as offline is possible. This code explains how you can generate a bitcoin
address step by step. As you see at the figure below, there are some
operations while bitcoin address is generated.
ecdsaPrivateKey = ecdsa.SigningKey.generate(curve=ecdsa.SECP256k1)
print("ECDSA Private Key: ", ecdsaPrivateKey.to_string().hex())
ecdsaPublicKey = '04' +
ecdsaPrivateKey.get_verifying_key().to_string().hex()
print("ECDSA Public Key: ", ecdsaPublicKey)
hash256FromECDSAPublicKey =
hashlib.sha256(binascii.unhexlify(ecdsaPublicKey)).hexdigest()
print("SHA256(ECDSA Public Key): ", hash256FromECDSAPublicKey)
ridemp160FromHash256 = hashlib.new('ripemd160',
binascii.unhexlify(hash256FromECDSAPublicKey))
print("RIDEMP160(SHA256(ECDSA Public Key)): ",
ridemp160FromHash256.hexdigest())
hash = prependNetworkByte
for x in range(1,3):
hash = hashlib.sha256(binascii.unhexlify(hash)).hexdigest()
print("\t|___>SHA256 #", x, " : ", hash)
cheksum = hash[:8]
print("Checksum(first 4 bytes): ", cheksum)
bitcoinAddress = base58.b58encode(binascii.unhexlify(appendChecksum))
print("Bitcoin Address: ", bitcoinAddress.decode('utf8'))
Finally, the result is comprised and the source code is available here;
A newsletter that brings you day's best crypto news, Technical analysis, Discount
Offers, and MEMEs directly in your inbox, by CoinCodeCap.com Take a look.
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information
about our privacy practices.
13
WRITTEN BY
Coinmonks Follow
Docker 小筆記 Getting free access to HosReact Website Using Gitflow with Github and
Hugo Shih
AWS GPU instances for AWS EC2 Cloud Build
Deep Learning Lankinen Juan Matías de la Cámara
Videsh Suman Beovide in tarmac