Skip to content

lunaticoin/bitcoin

 
 

Repository files navigation

Bitcoin Python Codes

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 aspects of working with 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:

  1. Elliptic Curve in Bitcoin

secp256k1 Elliptic Curve Generator Point Multiplier Visualizer

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.

3G Example

image

4G Example

image

6G Example

image

Elliptic Curve Field P Chart

The elliptic-curve-field-p-chart.py script generates an interactive visualization of an elliptic curve plotted over a finite field.

image

Elliptic Curve a+b=c labels

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.

image

Elliptic Curve Secp256k1 Simple Plot

The elliptic-curve.py script generates a simple plot of the secp256k1 elliptic curve, the one used in Bitcoin, over the real numbers.

image

RSA vs ECC keys security chart comparison

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.

image

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%