View Single Post
Old 03-25-2013, 11:14 PM  
dyna mo
not antifa
 
dyna mo's Avatar
 
Industry Role:
Join Date: Dec 2008
Location: invisible GNC
Posts: 67,408
where'd ya go? i'm ready for my next economies lesson from the new expert.

jst acouple days ago, you were in the dark on this

Quote:
Originally Posted by MainstreamGuy View Post
I don't understand how the mining process works and what kind of tasks it involves.

I don't understand how looking for a binary number is considered work and how that transforms into money.

Care to explain? I tried reading wikipedia for Bitcoin, but it never explains in details how it works.
funny how the wiki does in fact explain it.



http://en.wikipedia.org/wiki/Bitcoin
Protocol
Summary

Bitcoin is a solution to the double-spending problem of using a peer-to-peer network to manage transactions. The network timestamps transactions by hashing them into an ongoing chain of hash-based proof-of-work, forming a record or chain that cannot be changed without redoing the proof-of-work. The longest chain of records (called blocks) not only serves as proof of the sequence of events witnessed, but proof that it came from the largest pool of computing power. As long as a majority of computing power is controlled by nodes that are not cooperating to attack the network, they'll generate the longest chain of records and outpace attackers.

The network itself requires minimal structure. Messages are broadcast on a best effort basis, and nodes can leave and rejoin the network at will, accepting the longest proof-of-work chain as proof of what happened while they were gone.[1][2]
Bitcoins

A bitcoin is defined by its chain of ECDSA digital signatures. Each owner transfers the coin to the next by digitally signing a hash of the previous transaction and the public key (or address) of the next owner and adding these to the end of the coin. A payee can verify the signatures to verify the chain of ownership.
A diagram of a bitcoin transfer.

Although it would be possible to handle coins individually, it would be unwieldy to make a separate transaction for every cent in a transfer. To allow value to be split and combined, transactions contain multiple inputs and outputs. Normally there will be either a single input from a larger previous transaction or multiple inputs combining smaller amounts, and at most two outputs: one for the payment, and one returning the change, if any, back to the sender.

It should be noted that fan-out, where a transaction depends on several transactions, and those transactions depend on many more, is not a problem here. There is never the need to extract a complete standalone copy of a transaction's history.
Hashes and signatures

Two SHA-256 hashes on top of each are used for transaction verification; however, RIPEMD-160 is used on top of a SHA256 hash for bitcoin digital signatures or "addresses". A bitcoin address is specifically the hash of a ECDSA public key, computed this way:

Private-key hash = Version concatenated with RIPEMD-160(SHA-256(public key))
Checksum = 1st 4 bytes of SHA-256(SHA-256(Key hash))
Bitcoin Address = Base58Encode(Key hash concatenated with Checksum)

Example of double-SHA-256 encoding of string "transaction", as in the case of a bitcoin transaction:

transaction
2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73 043362938b9824 (first round of sha-256)
9595c9df90075148eb06860365df33584b75bff782a510c6cd 4883a419833d50 (second round of sha-256)

For hashing bitcoin public key signatures or "bitcoin addresses" using RIPEMD-160, this would give:

"Private-key or password"
2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73 043362938b9824 (first round is sha-256)
Public-key: b6a9c8c230722b7c748331a8b450f05566dc7d0f (with ripemd-160)

Timestamps

The bitcoin specification starts with a timestamp. A timestamp server works by taking a SHA256 hash function of a block of items to be timestamped and widely publishing the hash, such as in a newspaper or Usenet post. The timestamp proves that the data must have existed at the time, obviously, in order to get into the hash. Each timestamp includes the previous timestamp in its hash, forming a chain, with each additional timestamp reinforcing the ones before it.
Bitcoin mining

To implement a distributed timestamp server on a peer-to-peer basis, bitcoin uses a proof-of-work system similar to Adam Back's Hashcash, rather than newspaper or Usenet posts.[2] This is often called bitcoin mining.

The mining process or proof-of-work process involves scanning for a value that when hashed with SHA-256, the hash begins with a number of zero bits. The average work required is exponential in the number of zero bits required and can be verified by executing a single hash.

For the bitcoin timestamp network, it implements the mining process or "proof-of-work" by incrementing a nonce in the record or "block" until a value is found that gives the block's hash the required zero bits. Once the hashing effort has been expended to make it satisfy the proof-of-work, the block cannot be changed without redoing the work. As later records or "blocks" are chained after it, the work to change the block would include redoing all the blocks after it.
The main chain (black) consists of the longest series of transaction records from the genesis block (green) to the current block or record. Orphaned records (purple) exist outside of the main chain.

The majority decision is represented by the longest chain, which has the greatest proof-of-work effort invested in it. If a majority of computing power is controlled by honest nodes, the honest chain will grow the fastest and outpace any competing chains. To modify a past block, an attacker would have to redo the proof-of-work of the block and all blocks after it and then catch up with and surpass the work of the honest nodes. The probability of a slower attacker catching up diminishes exponentially as subsequent blocks are added.[2]

To compensate for increasing hardware speed and varying interest in running nodes over time, the proof-of-work difficulty is determined by a moving average targeting an average number of blocks per hour. If they're generated too fast, the difficulty increases.[2]
Process

The steps to run the network and generate or "mine" bitcoins are as follows:[2]

New transactions are broadcast to all nodes.
Each node collects new transactions into a block.
Each node works on finding a difficult proof-of-work for its block.
When a node finds a proof-of-work, it broadcasts the block to all nodes.
Bitcoins are successfully collected or "mined" by the receiving node which found the proof-of-work.
Nodes accept the block only if all transactions in it are valid and not already spent.
Nodes express their acceptance of the block by working on creating the next block in the chain, using the hash of the accepted block as the previous hash.
Repeat.

Nodes always consider the longest chain to be the correct one and will keep working on extending it. If two nodes broadcast different versions of the next block simultaneously, some nodes may receive one or the other first. In that case, they work on the first one they received, but save the other branch in case it becomes longer. The tie will be broken when the next proof-of-work is found and one branch becomes longer; the nodes that were working on the other branch will then switch to the longer one.

New transaction broadcasts do not necessarily need to reach all nodes. As long as they reach many nodes, they will get into a block before long. Block broadcasts are also tolerant of dropped messages. If a node does not receive a block, it will request it when it receives the next block and realizes it missed one.
Mined bitcoins

By convention, the first transaction in a block is a special transaction that starts a new coin owned by the creator of the block. This adds an incentive for nodes to support the network,[2] and provides a way to initially distribute coins into circulation, since there is no central authority to issue them.

The steady addition of a constant of amount of new coins is analogous to gold miners expending resources to add gold to circulation.[2] In this case, it is computing power and electricity that is expended.

The incentive can also be funded with transaction fees. If the output value of a transaction is less than its input value, the difference is a transaction fee that is added to the incentive value of the block containing the transaction. Once a predetermined number of coins have entered circulation, the incentive can transition entirely to transaction fees and be completely inflation free.[2]
Local system resources

Once the latest transaction of a coin is buried under enough blocks, the spent transactions which preceded it can be discarded in order to save disk space. To facilitate this without breaking the block's hash, transactions are hashed in a Merkle tree, with only the root included in the block's hash. Old blocks can then be compacted by stubbing off branches of the tree. The interior hashes need not be stored.

A block header with no transactions would be about 80 bytes. Supposing that blocks are generated every 10 minutes, 80 bytes × 6 × 24 × 365 = 4.2MB per year. With computer systems typically selling with 2GB of RAM as of 2008, and Moore's Law predicting current growth of 1.2GB per year, storage should not be a problem even if the block headers need to be kept in memory.
dyna mo is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote