

GitHub - kendricktan/misocoin: Barebones bitcoin-like protocol implemented in Py...
source link: https://github.com/kendricktan/misocoin
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Misocoin
Misocoin is a barebones bitcoin-like protocol implemented in Python 3.x. It was written as a challenge for myself to see if I could implement a bitcoin clone from scratch.
This project doesn't follow the full bitcoin-protocol, but rather implements a barebones version that (with enough nodes) can still act as a trust-less third party for storing and ensuring the integrity of arbitrary data.
WARNING: Misocoin is not production ready and should only be used as an educational tool.
Quick start
- Make sure you're in a Python 3.x environment. I recommend using miniconda
git clone [email protected]:kendricktan/misocoin.git
cd misocoin && pip install -r requirements.txt
- To start the misocoin daemon, run
# To start it on localhost:4000 with a random private key
./misocoind.py
** [Welcome] Your misocoin address is 610d2657b8c4df8da493bbe0671e7406d2bee7a6
* Running on http://localhost:4000/ (Press CTRL+C to quit)
# To start it on localhost:4001 with a specific private key
# ./misocoind.py -host=localhost -port=4001 -priv_key=60c8cb60c21143fffdd682f399ef3baa4b67c56a1f83a274284cfe7c57e007ed
- Once you have the daemon running, you can interact with the daemon it via the API
./misocoin-cli.py get_info
./misocoin-cli.py get_block <block_number>
./misocoin-cli.py get_balance
./misocoin-cli.py send_misocoin <to_address> <amount>
# To specify which host and port the daemon is located at
# ./misocoin-cli.py -host=<localhost> -port=<4000> [methods [args..]]
- To connect misocoin with other nodes, try running
./misocoind.py -nodes=host1:port1,host2:port2
. E.g:
- Terminal 1:
./misocoind.py -port=4001
- Terminal 2:
./misocoind.py -port=4002 -nodes=localhost:4001
What's in misocoin
- EDCSA
- Dynamic difficulty (based on network hashing power)
- Proof-of-Work
- Consensus
Todo?
- Automatically prunes chain in favor of a longer chain
- Persistent storage for blockchain (currently all in memory)
- Separate out tx and block logic to fit in a set amount of txs in a block
- Nicer exception handling
- Enforce functional paradigm
- Who's miso?
Miso is my cat. You can find out about him more on his instagram page.
- Why did you make this?
I made it to understand more about bitcoin. Jks. I made it for Miso's birthday (15 December). I love my cat.
- Can I have a picture of your cat in a taco outfit?
Recommend
-
52
flagg - Barebones subcommand handling
-
23
GitHub is where people build software. More than 28 million people use GitHub to discover, fork, and contribute to over 85 million projects.
-
61
README.md Ledger Analytics Analytics/Visualization tool for ledger-cli. Installation and Usage Make sure
-
38
README.md Tether
-
21
README.markdown Java WebSockets
-
16
Jul 8, 2020 •Avik Das Modern OpenGL, and by extension WebGL, is very different from the legacy OpenGL I learned in the past. I understand how rasterization works, so I’m comfortable with the concepts. However,...
-
8
Barebones 3D rendering with WebGLBarebones 3D rendering with WebGL Jul 21, 2020 • Avik Das
-
10
Unofficial Clubhouse app for Android. Inspired by this. Not to be taken seriously. This app is NOT available in Google Play. The only right place to download it is here...
-
6
dpdatadev/php-app About Barebones PHP app with PDO Singleton setup for Postgres. Register, Login, I...
-
5
pgwire This library implements PostgreSQL Wire Protocol, and provide essential APIs to write PostgreSQL comptible servers and clients. This library is a work in progress and in its relatively early stage. There is no guarantee for...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK