Code Monkey home page Code Monkey logo

basiccoin's Introduction

basiccoin

The simplest currency.

INSTALL (for ubuntu)

sudo apt-get install git
sudo apt-get install python-leveldb
git clone https://github.com/zack-bitcoin/basiccoin.git
cd basiccoin/

To run 1 node

python threads.py

To quickly run 5 nodes (linux/mac only)

./go.sh

Then send your browser to

http://localhost:8701
http://localhost:8702
http://localhost:8703
http://localhost:8704
http://localhost:8705

###Why do we need a simple currency

At the time of writing this there exist over 80 cryptocurrencies with market caps of over $100,000. According to Andreas Antonopolous, we will soon live in a world with millions of altcoins. It is incredibly risky to try to add new features to an old crypto. There is a high probability that you will introduce a bug. To combat this, each currency will have only one purpose. Bitcoin currently has 40445 lines of C++ and assembly, not including gui or tests. Very few people are able to read bitcoin. It is incredibly difficulty to adapt without breaking everything. Because of how hard it is to adapt bitcoin, all the altcoins have been very simplistic. They change magic numbers, and the name, and little else.

When things get complicated, it is good to return to the basics. The purpose of basiccoin is to be the simplest secure currency possible. Currently about 550 lines of python, and getting smaller. Basiccoin is designed to be easily modified to create new alts.

###What are the priorities that shape coding-style?

  1. It should be a secure cryptocurrency.

  2. The part of the code that can change state is kept as small as possible. add_block and delete_block are the only functions that write to the database. The mental-size of a program is largely determined by how many parts of the program can alter the database.

  3. It should be easy to create altcoins with new features just by adding transactions types to the transactions.py file.

  4. Do not allow repetitions in code.

  5. Use the name of a function or variable as the main form of commenting. If something is not clear, instead of adding comments, we just subdivide the complex task into smaller tasks, and accurately name those smaller tasks.

  6. Try to maximize number of ideas that fit on a screen at a time.

  7. pep8

###nlocktime/spend same transaction twice problem

Example transaction={'type':'spend', 'id':pubkey1, 'to':pubkey2, 'start':1000, 'end':1200, 'count':24, 'signature':hodsnfoubewuwe==/dsnfiosfwf}

This transaction would be considered invalid if it was broadcast before blocklength 1000, or if it was broadcast after blocklength 1200, or if this is not pubkey1's 24th transaction.

basiccoin's People

Contributors

chriscalderon avatar zack-bitcoin 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.