Bitcoin

From HaFrWiki
Jump to: navigation, search

Bitcoin is an open source peer-to-peer payment network and digital currency introduced in 2009 by pseudonymous developer "Satoshi Nakamoto". Bitcoin has been called a cryptocurrency because it uses cryptography to secure funds.

Introduction

Bitcoin is a consensus network that enables a new payment system and a completely digital money. It is the first decentralized peer-to-peer payment network that is powered by its users with no central authority or middlemen.
From a user perspective, Bitcoin is pretty much like cash for the Internet. Bitcoin can also be seen as the most prominent triple entry bookkeeping system in existence.

Creator

Who created Bitcoin?
Bitcoin is the first implementation of a concept called "crypto-currency", which was first described in 1998 by Wei Dai on the cypherpunks mailing list, suggesting the idea of a new form of money that uses cryptography to control its creation and transactions, rather than a central authority. The first Bitcoin specification and proof of concept was published in 2009 in a cryptography mailing list by Satoshi Nakamoto. Satoshi left the project in late 2010 without revealing much about himself. The community has since grown exponentially with many developers working on Bitcoin.

Controls

Who controls Bitcoin. Nobody owns the Bitcoin network much like no one owns the technology behind email. Bitcoin is controlled by all Bitcoin users around the world. While developers are improving the software, they can't force a change in the Bitcoin protocol because all users are free to choose what software and version they use. In order to stay compatible with each other, all users need to use software complying with the same rules. Bitcoin can only work correctly with a complete consensus among all users. Therefore, all users and developers have a strong incentive to protect this consensus.

Mining

How are Bitcoins created?
New bitcoins are generated by a competitive and decentralized process called "mining". This process involves that individuals are rewarded by the network for their services. Bitcoin miners are processing transactions and securing the network using specialized hardware and are collecting new bitcoins in exchange.

The Bitcoin protocol is designed in such a way that new bitcoins are created at a fixed rate. This makes Bitcoin mining a very competitive business. When more miners join the network, it becomes increasingly difficult to make a profit and miners must seek efficiency to cut their operating costs. No central authority or developer has any power to control or manipulate the system to increase their profits. Every Bitcoin node in the world will reject anything that does not comply with the rules it expects the system to follow.

Bitcoins are created at a decreasing and predictable rate. The number of new bitcoins created each year is automatically halved over time until bitcoin issuance halts completely with a total of 21 million bitcoins in existence. At this point, Bitcoin miners will probably be supported exclusively by numerous small transaction fees.


Mining is the process of spending computing power to process transactions, secure the network, and keep everyone in the system synchronized together. It can be perceived like the Bitcoin data center except that it has been designed to be fully decentralized with miners operating in all countries and no individual having control over the network. This process is referred to as "mining" as an analogy to gold mining because it is also a temporary mechanism used to issue new bitcoins. Unlike gold mining, however, Bitcoin mining provides a reward in exchange for useful services required to operate a secure payment network. Mining will still be required after the last bitcoin is issued.

How does minig work?

Anybody can become a Bitcoin miner by running software with specialized hardware. Mining software listens for transactions broadcast through the peer-to-peer network and performs appropriate tasks to process and confirm these transactions. Bitcoin miners perform this work because they can earn transaction fees paid by users for faster transaction processing, and newly created bitcoins issued into existence according to a fixed formula.

For new transactions to be confirmed, they need to be included in a block along with a mathematical proof of work. Such proofs are very hard to generate because there is no way to create them other than by trying billions of calculations per second. This requires miners to perform these calculations before their blocks are accepted by the network and before they are rewarded. As more people start to mine, the difficulty of finding valid blocks is automatically increased by the network to ensure that the average time to find a block remains equal to 10 minutes. As a result, mining is a very competitive business where no individual miner can control what is included in the block chain.

The proof of work is also designed to depend on the previous block to force a chronological order in the block chain. This makes it exponentially difficult to reverse previous transactions because this requires the recalculation of the proofs of work of all the subsequent blocks. When two blocks are found at the same time, miners work on the first block they receive and switch to the longest chain of blocks as soon as the next block is found. This allows mining to secure and maintain a global consensus based on processing power.

Bitcoin miners are neither able to cheat by increasing their own reward nor process fraudulent transactions that could corrupt the Bitcoin network because all Bitcoin nodes would reject any block that contains invalid data as per the rules of the Bitcoin protocol. Consequently, the network remains secure even if not all Bitcoin miners can be trusted.

Isn't Bitcoin mining a waste of energy?

Spending energy to secure and operate a payment system is hardly a waste. Like any other payment service, the use of Bitcoin entails processing costs. Services necessary for the operation of currently widespread monetary systems, such as banks, credit cards, and armored vehicles, also use a lot of energy. Although unlike Bitcoin, their total energy consumption is not transparent and cannot be as easily measured.

Bitcoin mining has been designed to become more optimized over time with specialized hardware consuming less energy, and the operating costs of mining should continue to be proportional to demand. When Bitcoin mining becomes too competitive and less profitable, some miners choose to stop their activities. Furthermore, all energy expended mining is eventually transformed into heat, and the most profitable miners will be those who have put this heat to good use. An optimally efficient mining network is one that isn't actually consuming any extra energy. While this is an ideal, the economics of mining are such that miners individually strive toward it.

How does mining help secure Bitcoin?

Mining creates the equivalent of a competitive lottery that makes it very difficult for anyone to consecutively add new blocks of transactions into the block chain. This protects the neutrality of the network by preventing any individual from gaining the power to block certain transactions. This also prevents any individual from replacing parts of the block chain to roll back their own spends, which could be used to defraud other users. Mining makes it exponentially more difficult to reverse a past transaction by requiring the rewriting of all blocks following this transaction.

What do I need to start mining?

In the early days of Bitcoin, anyone could find a new block using their computer's CPU. As more and more people started mining, the difficulty of finding new blocks increased greatly to the point where the only cost-effective method of mining today is using specialized hardware. You can visit BitcoinMining.com [1] for more information.

Software

There are two basic ways to mine: On your own or as part of a pool. Almost all miners choose to mine on a pool because it takes the luck out of the process. Before you join a pool, make sure you have a bitcoin wallet so you have a place to store your bitcoins. Next you need to join a mining pool like Eclipse Mining Consortium or BTC Guild.

With pool mining, the profit from any block a member generates is divided up among the members of the pool. This gives the pool members a more frequent, steady payout (this is called reducing your variance), but your payout(s) will be less unless you use a zero fee pool like Eclipse. Solo mining will give you large, infrequent payouts and pooled mining will give you small, frequent payouts, but both add up to the same amount if you're using a zero fee pool.

Once you have your client set up or you have registered with a pool, the next step is to set up the actual mining software. The most popular GPU/FPGA/ASIC miner at the moment is BFGminer or CGminer. For a full GUI experience, try EasyMiner.

If you want a quick taste of mining without installing any software, try Bitcoin Plus, a browser-based CPU Bitcoin miner. As a CPU miner it's not cost-efficient for serious mining, but it does illustrate the principle of pooled mining very well.

OSX Install Homebrew

After installation of the basic requirements for homebrew: - Xcode Developer.apple.com, xcode, install also the Command Line Tools

  • Github, Homebrew installation
  • Start Terminal
  • And do
    brew tap nwoolls/xgminer && brew install cgminer
    or
    brew tap nwoolls/xgminer && brew install bfgminer

Usage

Both cgminer and bfgminer are command-line utilities. Either run them without any command line parameters and fill in the prompts for mining pool URL and credentials or use the following format to specify your pool:

cgminer -o http://pool.url:port -u username -p password

or

bfgminer -o http://pool.url:port -u password -p password

Examples:

$ bfgminer -o http://us1.eclipsemc.com:8337 -u username -p password
or
$ bfgminer -k diablo -o http://mint.bitminter.com:8332 -u username_workername -p password -I 9 --no-opencl-binaries


If you have multiple graphics cards you’ll want to use the –no-opencl-binaries parameter with bfgminer to avoid a crash on startup. This is not necessary with cgminer as it detects OS X and applies the same workaround automatically.


bfgminer

The examples for connection with EMC.

bfgminer version 3.8.0 - Started: [2013-12-07 12:09:04] - [  0 days 00:18:40]
 [M]anage devices [P]ool management [S]ettings [D]isplay options  [H]elp [Q]uit 
 Connected to us1.eclipsemc.com diff 10 with LP as user XXXXXXXXX
 Block: ...dd88b8a3 #273571  Diff:707M ( 5.06Ph/s)  Started: [12:16:52]
 ST:2  F:0  NB:3  AS:0  BW:[751/  7 B/s]  E:0.00  I: 0.00 BTC/hr  BS:0
 0            |   0.0/  0.0/  0.0 h/s | A:0 R:0+0(none) HW:0/none
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------

ST: work in queue              | F: network fails  | NB: new blocks detected
AS: shares being submitted     | BW: bandwidth (up/down)
E: # shares * diff per 2kB bw  | U: shares/minute  | BS: best share ever found
--------------------------------------------------------------------------------
devices/processors hashing (only for totals line), hottest temperature
hashrates: 5s decaying / all-time average / all-time average (effective)
A: accepted shares | R: rejected+discarded(%% of total)
HW: hardware errors / %% nonces invalid

Press any key to clear

Man bfgminer

Usage: bfgminer [-DdEgIKklLmpxPQqUSsTouvwOchV] 
Options for both config file and command line:
--api-allow <arg>   Allow API access only to the given list of [G:]IP[/Prefix] addresses[/subnets]
--api-description <arg> Description placed in the API status header, default: BFGMiner version
--api-groups <arg>  API one letter groups G:cmd:cmd[,P:cmd:*...] defining the cmds a groups can use
--api-listen        Enable API, default: disabled
--api-mcast         Enable API Multicast listener, default: disabled
--api-mcast-addr <arg> API Multicast listen address (default: "224.0.0.75")
--api-mcast-code <arg> Code expected in the API Multicast message, don't use '-' (default: "FTW")
--api-mcast-des <arg> Description appended to the API Multicast reply, default: ''
--api-mcast-port <arg> API Multicast listen port (default: 4028)
--api-network       Allow API (if enabled) to listen on/for any address, default: only 127.0.0.1
--api-port <arg>    Port number of miner API (default: 4028)
--auto-fan          Automatically adjust all GPU fan speeds to maintain a target temperature
--auto-gpu          Automatically adjust all GPU engine clock speeds to maintain a target temperature
--balance           Change multipool strategy from failover to even share balance
--benchmark         Run BFGMiner in benchmark mode - produces no shares
--bfl-range         Use nonce range on bitforce devices if supported
--chroot-dir <arg>  Chroot to a directory right after startup
--cmd-idle <arg>    Execute a command when a device is allowed to be idle (rest or wait)
--cmd-sick <arg>    Execute a command when a device is declared sick
--cmd-dead <arg>    Execute a command when a device is declared dead
--coinbase-addr <arg> Set coinbase payout address for solo mining
--coinbase-sig <arg> Set coinbase signature when possible
--compact           Use compact display without per device statistics
--debug|-D          Enable debug output
--debuglog          Enable debug logging
--device-protocol-dump Verbose dump of device protocol-level activities
--device|-d <arg>   Enable only devices matching pattern (default: all)
--disable-rejecting Automatically disable pools that continually reject shares
--http-port <arg>   Port number to listen on for HTTP getwork miners (-1 means disabled) (default: -1)
--expiry|-E <arg>   Upper bound on how many seconds after getting work we consider a share from it stale (w/o longpoll active) (default: 120)
--expiry-lp <arg>   Upper bound on how many seconds after getting work we consider a share from it stale (with longpoll active) (default: 3600)
--failover-only     Don't leak work to backup pools when primary pool is lagging
--force-dev-init    Always initialize devices when possible (such as bitstream uploads to some FPGAs)
--gpu-dyninterval <arg> Set the refresh interval in ms for GPUs using dynamic intensity (default: 7)
--gpu-platform <arg> Select OpenCL platform ID to use for GPU mining (default: -1)
--gpu-threads|-g <arg> Number of threads per GPU (1 - 10) (default: -1)
--gpu-engine <arg>  GPU engine (over)clock range in MHz - one value, range and/or comma separated list (e.g. 850-900,900,750-850)
--gpu-fan <arg>     GPU fan percentage range - one value, range and/or comma separated list (e.g. 0-85,85,65)
--gpu-map <arg>     Map OpenCL to ADL device order manually, paired CSV (e.g. 1:0,2:1 maps OpenCL 1 to ADL 0, 2 to 1)
--gpu-memclock <arg> Set the GPU memory (over)clock in MHz - one value for all or separate by commas for per card
--gpu-memdiff <arg> Set a fixed difference in clock speed between the GPU and memory in auto-gpu mode
--gpu-powertune <arg> Set the GPU powertune percentage - one value for all or separate by commas for per card
--gpu-reorder       Attempt to reorder GPU devices according to PCI Bus ID
--gpu-vddc <arg>    Set the GPU voltage in Volts - one value for all or separate by commas for per card
--lookup-gap <arg>  Set GPU lookup gap for scrypt mining, comma separated
--intensity|-I <arg> Intensity of GPU scanning (d or -10 -> 20,default: d to maintain desktop interactivity)
--kernel-path|-K <arg> Specify a path to where bitstream and kernel files are (default: "/usr/local/Cellar/bfgminer/3.8.0/share/bfgminer")
--kernel|-k <arg>   Override sha256 kernel to use (diablo, poclbm, phatk or diakgcn) - one value or comma separated
--load-balance      Change multipool strategy from failover to quota based balance
--log|-l <arg>      Interval in seconds between log output (default: 5)
--log-file|-L <arg> Append log file for output messages
--log-microseconds  Include microseconds in log output
--monitor|-m <arg>  Use custom pipe cmd for output messages
--net-delay         Impose small delays in networking to avoid overloading slow routers
--no-adl            Disable the ATI display library used for monitoring and setting GPU parameters
--no-gbt            Disable getblocktemplate support
--no-getwork        Disable getwork support
--no-longpoll       Disable X-Long-Polling support
--no-restart        Do not attempt to restart devices that hang
--no-stratum        Disable Stratum detection
--no-submit-stale   Don't submit shares if they are detected as stale
--no-opencl-binaries Don't attempt to use or save OpenCL kernel binaries
--noncelog <arg>    Create log of all nonces found
--pass|-p <arg>     Password for bitcoin JSON-RPC server
--per-device-stats  Force verbose mode and output per-device statistics
--pool-priority <arg> Priority for just the previous-defined pool
--pool-proxy|-x <arg> Proxy URI to use for connecting to just the previous-defined pool
--protocol-dump|-P  Verbose dump of protocol-level activities
--queue|-Q <arg>    Minimum number of work items to have queued (0+) (default: 1)
--quiet|-q          Disable logging output, display status and errors
--quota|-U <arg>    quota;URL combination for server with load-balance strategy quotas
--real-quiet        Disable all output
--request-diff <arg> Request a specific difficulty from pools (default: 1.0)
--retries <arg>     Number of times to retry failed submissions before giving up (-1 means never) (default: -1)
--rotate <arg>      Change multipool strategy from failover to regularly rotate at N minutes (default: 0)
--round-robin       Change multipool strategy from failover to round robin on failure
--scan|-S <arg>     Configure how to scan for mining devices
--scan-time|-s <arg> Upper bound on time spent scanning current work, in seconds (default: 60)
--sched-start <arg> Set a time of day in HH:MM to start mining (a once off without a stop time)
--sched-stop <arg>  Set a time of day in HH:MM to stop mining (will quit without a start time)
--scrypt            Use the scrypt algorithm for mining (non-bitcoin)
--set-device <arg>  Set default parameters on devices; eg, NFY:osc6_bits=50
--shaders <arg>     GPU shaders per card for tuning scrypt, comma separated
--setuid <arg>      Username of an unprivileged user to run as
--sharelog <arg>    Append share log to file
--shares <arg>      Quit after mining N shares (default: unlimited)
--show-processors   Show per processor statistics in summary
--skip-security-checks <arg> Skip security checks sometimes to save bandwidth; only check 1/<arg>th of the time (default: never skip)
--socks-proxy <arg> Set socks proxy (host:port)
--submit-threads <arg> Minimum number of concurrent share submissions (default: 64) (default: 64)
--syslog            Use system log for output messages (default: standard error)
--temp-cutoff <arg> Maximum temperature devices will be allowed to reach before being disabled, one value or comma separated list
--temp-hysteresis <arg> Set how much the temperature can fluctuate outside limits when automanaging speeds (default: 3)
--temp-overheat <arg> Overheat temperature when automatically managing fan and GPU speeds, one value or comma separated list (default: 85)
--temp-target <arg> Target temperature when automatically managing fan and clock speeds, one value or comma separated list
--text-only|-T      Disable ncurses formatted screen output
--thread-concurrency <arg> Set GPU thread concurrency for scrypt mining, comma separated
--url|-o <arg>      URL for bitcoin JSON-RPC server
--user|-u <arg>     Username for bitcoin JSON-RPC server
--vectors|-v <arg>  Override detected optimal vector (1, 2 or 4) - one value or comma separated list
--verbose           Log verbose output to stderr as well as status output
--worksize|-w <arg> Override detected optimal worksize - one value or comma separated list
--userpass|-O <arg> Username:Password pair for bitcoin JSON-RPC server
--worktime          Display extra work time debug information
Options for command line only:
--config|-c <arg>   Load a JSON-format configuration file
See example.conf for an example configuration.
--help|-h           Print this message
--version|-V        Display version and exit


Bitcoin mining on Mac

This is a summary of the article on zdnet [2].

While it is technical possible to mine on a Mac using the Mac's GPU, it's not profitable. See:

So you need to buy some additional hardware

Mining with ASIC is backordered, expensive, power hungry and loud.

See also

top

Software

  • Eclipse.com, The EMC Bitcoin Mining Pool is what is needed to work together in the mining pool.
  • Github, bfgminer, mining software and documentation

Misc

Mining

  • Bitcoin mining on mac os-x, A new batch of ASICs is hitting the market based on the 55nm Bitfury ASIC chip (abbreviated BF1). The most popular of these are USB sticks branded as either Blue Fury or Red Fury, depending on the color of the onboard LED.

Reference

top

  1. Bitcoin mining, Bitcoin Mining is a part a the we use coins. See above.
  2. zdnet, How to mine bit coins with your Mac.