Bitcoin is a decentralized digital currency that enables online payments between parties without going through a central authority like a bank or government. Created by Satoshi Nakamoto in 2008.
This repository includes Python scripts demonstrating different technical aspects of Bitcoin.
Bitcoin is the money of the future.
Bitcoin is today's hope.
Besides the Python codes, I have also written several articles related to Bitcoin:
- Elliptic Curve in Bitcoin
English Version: https://estudiobitcoin.com/elliptic-curve-in-bitcoin/
Spanish Version: https://estudiobitcoin.com/curva-eliptica-en-bitcoin/
This script has been the one showed in the Bitcoin Tuesday Meetup #32. LINK[https://www.meetup.com/bitcoin-tuesday/events/300714364/] The code has all the comments in Spanish, also the output messages showed in command line. The script provides a step-by-step visualization of multiplying a generator point on an elliptic curve by a scalar value. This is done through a series of point duplications and additions, as used in ECC cryptography.
This Python script showcases the ECDSA process for signing plaintext messages and verifying their authenticity using a public-private key pair. It unfolds each step transparently, unlike comprehensive library modules. It generates key pairs, hashes messages with SHA-256, signs messages, and enables interactive signature verification.
secp256k1-elliptic-curve-generator-point-multiplier-visualizer.py
The script provides a step-by-step visualization of multiplying a generator point on an elliptic curve by a scalar value. This is done through a series of point duplications and additions, as used in ECC cryptography.
The script allows inputting a desired multiple of the secp256k1 generator point. It calculates the sequence of point operations required to arrive at this multiple through analitic geometry.
The steps are shown graphically on the secp256k1 curve plotted with Matplotlib. Each point duplication is marked with a red line and each point addition with a green line. The points are labeled clearly as multiples of the generator "G".
This provides an intuitive understanding of how private key scalars derive public keys on an elliptic curve.
The elliptic-curve-field-p-chart.py script generates an interactive visualization of an elliptic curve plotted over a finite field.
The elliptic-curve-a+b=c-labels.py script provides a visual demonstration of elliptic curve point addition. It graphs the secp256k1 elliptic curve used in Bitcoin and marks sample points A, B, and C.
The elliptic-curve.py script generates a simple plot of the secp256k1 elliptic curve, the one used in Bitcoin, over the real numbers.
The RSA-vs-ECC-keys-security-chart-comparison.py script generates a chart comparing the security levels of ECC and RSA keys of equivalent strength.