Giter VIP home page Giter VIP logo

btcminingstrategies's Introduction

Bitcoin Mining Strategies

We implement three strategies in Bitcoin mining that are based on miner's self-interest.

  1. Majority Miner (forking attack)
    • This attack becomes feasible and more profitable when:
      • A party possesses the majority computing power of the network (say > 51%)
      • The party's mining on a fork that's not 6 blocks behind the longest chain
  2. Selfish Miner (temporary block‐withholding attack)
    • When a party finds a block before the rest of the network, withholds the block. If other miners find a block while:
      • The party is already withholding 2+ secret blocks, it can choose to announce them and instanly causes the newly found block to be stale, increasing its effective share of mining rewards by wasting the hash power of the rest of the network.
      • The party is only withholding 1 secret block, it should immediately announce the block in the hope that it wins the broadcasting race to get its mining reward back.
  3. Fee Sniping Miner
    • When a block is found containing unusually large transaction fee, the attacking party tries to fork the blockchain by:
      • Rejecting this block and mines (including the fat transaction) on top of the previous one.
      • If the party mines 2 blocks in a row, the fork becomes the longest chain and party gets to keep the fat transaction for itself.

Run MiningSimulation.java as JUnit test to start the simulation. Rewards of different strategies will be shown in the console.

Reference

btcminingstrategies's People

Contributors

qtds35k avatar shwuj avatar

Stargazers

 avatar  avatar  avatar

Forkers

hnjm alfathsurya

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.