Giter VIP home page Giter VIP logo

high-concurrency-bitcoin-miner's Introduction

Bitcoin Miner

Problem definition

Bitcoins (see http://en.wikipedia.org/wiki/Bitcoin) are the most popular crypto-currency in common use. At their hart, bitcoins use the hardness of cryptographic hashing (for a reference see http://en.wikipedia.org/wiki/Cryptographic hash function) to ensure a limited “supply” of coins. In particular, the key component in a bitcoin is an input that, when “hashed” produces an output smaller than a target value. In practice, the comparison values have leading 0’s, thus the bitcoin is required to have a given number of leading 0’s (to ensure 3 leading 0’s, you look for hashes smaller than 0x001000... or smaller or equal to 0x000ff.... The hash you are required to use is SHA-256. You can check your version against this online hasher: http://www.xorbin.com/tools/sha256-hash-calculator. For example, when the text “COP5615 is a boring class” is hashed, the value 0xe9a425077e7b492076b5f32f58d5eb6824b1875621e6237f1a2430c6b77e467c is obtained. For the coins you find, check your answer with this calculator to ensure correctness. The goal of this first project is to use Elixir and the actor model to build a good solution to this problem that runs well on multi-core machines.

Requirements

Input: The input provided (as command line to your ./project1) will be k, the required number of 0’s of the bitcoin. 1 Output: Print, on independent lines, the input string and the corresponding SHA256 hash separated by a TAB, for each of the bitcoins you find. Obviously, your SHA256 hash must have the required number of leading 0s (k = 3 means 3 0’s in the hash notation). An extra requirement, to ensure every group finds different coins, it to have the input string prefixed by the gatorlink ID of one of the team members.

Example 1:

mix enscript.build ./project1 1 adobra;kjsdfk11 0d402337f95d018438aad6c7dd75ad6e9239d6060444a7a6b26299b261aa9a8b indicates that the coin with 1 leading 0 is adobra;kjsdfk11 and it is prefixed by the gatorlink ID adobra. Distributed implementation: The more cores you have to more coins you can mine. To this end, enlisting other machines adds to your coin mining capabilities. Extend project1 so that the argument is a computer address or IP address of the server. This program then becomes a “worker” and contacts the server to get work. This second program will not display anything. All the cons found have to be displayed by the server.

Example 2:

project1 10.22.13.155 will start a worker that contact the elixir server hosted at 10.22.13.155 and participates into mining. Hint. when testing this, have your project partner start a server, find the IP address of the server and then start the worker. Notice, your server should be able to mine coins without any workers but has to accommodate workers as they become available. Actor modeling: In this project you have to use exclusively the actor facility in Erlang (projects that do not use multiple actors or use any other form of parallelism will receive no credit). A model similar to the one indicated in class for the problem of adding up a lot of numbers can be used here, in particular define worker actors that are given a range of problems to solve and a boss that keeps track of all the problems and perform the job assignment.

Installation

If available in Hex, the package can be installed by adding kv to your list of dependencies in mix.exs:

def deps do
  [
    {:kv, "~> 0.1.0"}
  ]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/kv.

high-concurrency-bitcoin-miner's People

Contributors

abhisheknigam avatar kbbaldha 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.