Code Monkey home page Code Monkey logo

misocoin's Introduction

Misocoin

misocoin logo

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

  1. Make sure you're in a Python 3.x environment. I recommend using miniconda
  2. git clone [email protected]:kendricktan/misocoin.git
  3. cd misocoin && pip install -r requirements.txt
  4. 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
  1. 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..]]
  1. 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

FAQ

  • 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?

Sure

misocoin logo

misocoin's People

Contributors

kendricktan avatar maxcountryman avatar pkallos avatar waterdrips avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.