Giter VIP home page Giter VIP logo

vaporcoin's Introduction

VaporCoin

MIT License Build Status Swift 4.1

Synopsis

VaporCoin is a simple blockchain transaction ledger implementation, built in Swift using Vapor.

Goals

Functional, simple and easy to understand implementation that favors learning over robust security and usability. This is not intended to be an 'altcoin'

Specifications

Blocks:

  • Block time 60 seconds
  • 6000 transactions per block (Effective 100 txns/s rate)
  • Block difficulty updated every 60 blocks (hourly)
  • Block reward 50 full units/block (1 unit = 100 000 000 sub-units)
  • Block reward halved every 4 years (2 102 400 blocks at 525 600 blocks per year)
  • Total amount of full units will be roughly ~209 829 375

Transactions:

  • Simplified Bitcoin-style transactions, UTXO (No scripting capability)
  • ECDSA signatures

Proof of Work (PoW) algorithm:

  • Simplified Bitcoin-style. Single SHA256 hash of block header

Block header:

  • Previous hash
  • Merkle root of transactions in block
  • UNIX timestamp
  • Target difficulty
  • Nonce (32 bit)

TODO

  • JSON WebSocket p2p communication / Incomplete
  • Peer discovery
  • Locally hosted web interface to send and receive transactions, change settings and monitor blockchain status.
  • Fractional difficulty adjustment (Using BigInt)
  • Database logic
  • Proper node syncing
  • UTXO Transactions
  • Establish consensus

Getting started

brew install vapor/tap/vapor

In project root directory:
vapor update
vapor build 
vapor run

If you are using Xcode, make sure to select `My Mac` as target, and select the `Run` scheme.

Difficulty Factor

To mine a block, you can lower the diffBits amount in Droplet+Setup.swift line 17:

let miner = Miner(coinbase: "coinbaseAddressNotImplementedYet", diffBits: 20, threadCount: 4)

Tips

Get me some coffee:

ETH: 0x1e8e9c1a1b71ff88829b962cfa7190d074343b37
LTC: LZc2QcyZGuhHF18s96VAUPpByZq2S8yCsj
ZEC: t1UukAm25iRLTyTQfhX6WfRBzMjp8UCmy4a

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.