看板 ott
作者 ott (寶貝)
標題 Bitcoin Algorithm
時間 2013年11月23日 Sat. AM 06:38:14

     
   
 


http://scienceandsociety3030.wikispaces.com/Bitcoin+Algorithm

Bitcoin Algorithm  Edit  1  10 …

Bitcoin (BTC) is the first peer to peer currency based on the the SHA-256 cryptographic hash function. The Bitcoin is the first


Table of Contents

	
History of the  BitcoinProtocol

	
SHA-256 Cryptographic Hash Function

	
Satoshi Nakamoto the founder of the Bitcoin Project

	
Weaknesses of the Hash Encryption

The Bitcoin Project

	
Getting Bitcoin off the ground

	
Peer-to-Peer Financial Transactions

	
Risk and Reward of Bitcoins

	
The Bitcoin Protocol

	
Incentives to Distribute the Power

	
Triple Redundancy insures the Security of the Exchange

	
Increase the Difficulty to Control Deflation

	
Additional Links

	
References

currency established entirely in cyberspace (although actual coins and paper have been minted privately for collectors) utilizing a crypto-algorithm and control set originally developed by Satoshi Nakamotoin 2009. Satashi Nakemoto (an alias for an unknown set of developers) proposed that a currency could exist purely as a source of unregulated change based on brute force work of a hash encryption network of computers. The Bitcoin network is purely open-source and based on this work done at MIT which limits the rate Bitcoins are introduced to the market by a separate algorithm that changes the difficulty of the hash networks brute force decryption to slow or increase the rate of discovered blocks that result in Bitcoins. With a targeted cap of exactly 21 million Bitcoins ever introduced to the world, and with a predetermined rate that dictates the last coins to be minted in the year 2140[1] . Bitcoin discovery is handled exclusively through a process called Bitcoin mining that rewards the associated computer or computer network for completing a brute force decryption of the SHA-256 hash encryption with difficulty index provided by the Nakamoto function. Because of the controlled rate of distribution, the finite limits imposed, and the actual work done to create the currency, it has seen a near geometric growth in terms of acceptance and value. Today Bitcoin is by far the largest currency of its kind with over 10,862,500[2] (as of March 7 2013) of the 21 million coins currently in circulation with a total value of over $410 million (USD)[3] [4] and is currently redeemable for all major worldwide currencies.

Privately minted Bitcoins.  Some are novelty some actually have the 32 bit keys associated with the amount of the coin engraved, stamped or printed on them

Privately minted Bitcoins. Some are novelty some actually have the 32 bit keys associated with the amount of the coin engraved, stamped or printed on them



History of the Bitcoin Protocol
SHA-256 Cryptographic Hash Function
The Bitcoin Algorithm is based on the SHA-256 Cryptographic Hash Function designed by the National Security Agency (NSA). The SHA-256 algorithm is a variation of the SHA-2 algorithm which evolved from the SHA-1 algorithm to provide encryption for data.

Cryptographic Hash function transforms a random number of data elements (Hashes) mathematically into a fixed length value called the Hash. The security lies in the fact the the computed hash value has the ability to verify the original data but that reversing the process is impossible to arrive at the original data. SHA-2 has four distinct variations SHA-224, 256. 384, and 512, which describe the bit length of the associated hashes. In the case of 224 and 384 these are truncated versions of the common exponents associated with computer binary code. SHA-1 was originally found to have a mathematic weakness whereby it could theoretically circumvented to produce what is called a collision where the original data is recovered by finding a mathematical solution different from the original hash to decrypt the data. To date no actual collisions have been found for SHA-1 or SHA-2[5] but nonetheless SHA-2 incorporates a shift right operator (shr) in addition to the mathematical cryptographic operators of SHA-1 (+, and, xor, or, rot) to alleviate the possibility of the mathematical work around. The NSA also published SHA-3 in 2012[6] which is several orders of magnitude more difficult and not based on SHA-2.



One iteration in a SHA-2 family compression function. The blue components perform the following operations:
One iteration in a SHA-2 family compression function. The blue components perform the following operations:



external image 22d25335571877dfffa0e3b92b567a74.png


external image dc385330f79942f1ccced410f8ca0374.png


external image c65cf353faa9befd97e4e90df3786bd3.png


Bitwise rotation uses different constants for SHA-512. The given numbers are for SHA-256. The red color{red}boxplus is an addition modulo 2
Bitwise rotation uses different constants for SHA-512. The given numbers are for SHA-256. The red color{red}boxplus is an addition modulo 2







Satoshi Nakamoto the founder of the Bitcoin Project
Satoshi Nakamoto is the pseudonymous person who was responsible for the original publishing and launch of the Bitcoin protocol utilizing the NSA's SHA-256 hash strategy[7] . In 2008 a paper under that name was published at metzdowd.com describing the Bitcoin protocol. Bitcoins came into existence when the first Bitcoin open source client was published in 2009 and the very first Bitcoins were digitally minted. While the pseudonymous person or persons responsible for Bitcoin have disappeared from the landscape, Bitcoin has slowly been increasing in popularity reaching a feverish pitch in 2012 as thousands scrambled to "get on the bandwagon".


Weaknesses of the Hash Encryption
As noted by the NSA, hash encryption is subject to brute force decryption equal to the size of the hash. In the shortest terms this means SHA-256 could be brute force decrypted with just 2^32 iterations times the possible variants for those bits (being all the lower case letters and numbers<26 variants>). Theoretically this is a cumbersome number and virtually guarantees the massively long time it would take to decrypt the function on a raw brute force guessing of the passkey. This is tad amount to trying every combination possible in a 32 digit sequence with the possibilities of 36 variants (letters and numbers)...similar to trying all 999 combinations if you forget your 3 digit code on your briefcase. This admittedly leaves some opening in the security of an individual hash but this is overcome by the Bitcoin protocol by the proof-of-work methodology. In the Bitcoin protocol each successful discovery of a block of the hash must be accompanied by the previous 100 hash attempts that led to it. Because this is a mathematical model, those hash attempts must be mathematical associations of the (+, and, xor, or, not, shr) to qualify as valid proof on arriving at the correct block. Simply guessing by brute force the associated block does not give the proof of work and the hash is rejected by the Bitcoin network until it comes back with the valid proof of work. Not only does this exponentially increase the difficulty of brute force decryption of these blocks of hash but it increases the security level on two levels. Security is first obtained by raw difficulty, and secondly secured by redundency on the network that is running Bitcoin. The network of computers must agree to the proof of work to add it to the block chain and continue the decryption. The exposed weakness of the Bitcoin protocol and its use of SHA-256 is the possibility that enough hostile computing power could produce an alternate blockchain and undermine the security of all the keys and transactions incorporated into the blockchain. It is largely accepted that this is unlikely as it would compromise the value of Bitcoin and in so doing render the efforts of doing this attack useless. However, the Bitcoin protocol and security is based upon the notion that the computing power added to the network (via the incentives of mining and transactional processing fees) will allow it to grow faster than any hostile entity could take it over and substitute the hashed blockchain


The Bitcoin Project

Getting Bitcoin off the ground
The Bitcoin project uses the protocol developed by Satoshi Nakamoto and licenced by MIT for free distribution, to basically create a peer to peer currency by using brute for
A truly large array of PC's assembled for a Bitcoin Mining Operation.  With Over 100 PC's and conceivably 2 gpu's per pc this rig could have accounted for 600ghash/s or up to 5% of the network in 2011
A truly large array of PC's assembled for a Bitcoin Mining Operation. With Over 100 PC's and conceivably 2 gpu's per pc this rig could have accounted for 600ghash/s or up to 5% of the network in 2011
ce cryptology and energy for its creation. The process of creating coins is relatively simple and results (currently 2013) in the "minting" of 25 Bitcoins for every block discovered by brute force decryption of the hash blockchain. The newly minted coins are rewarded to the computer or computer network that discovered the block and provides the necessary proof of work for that block. The daily target for Bitcoin minting is 3600 coins per day currently and the protocol algorithm adjusts the difficulty of the blocks to be discovered to slow or increase the rate of discovery and control the release of the coins and keep the currency on target for its 21 million in 2140. Currently, mining Bitcoins via contribution to the network of hash decryption is the primary source of income for Bitcoin enthusiasts, entrepreneurs, and proponents of the currency. The incentive to earn Bitcoins through use of one's computer hardware has lead to some strange and super expensive mining rigs producing up to millions of dollars per year in Bitcoins.
This incentive system has also facilitated the first essential key to Nakemoto's protocol -- decentralize the computational power backbone of the network to increase its security.




Peer-to-Peer Financial Transactions
While Bitcoin mining has its own economy driven by supply, the cost of mining hardware, electricity, and time, the core purpose of Bitcoin has always been to be a peer to peer secure currency exchange system. Each transaction of Bitcoins is accompanied by its public hash origin, destination, and previous owners all the way back to its original owner when it was minted. This data is added to the hash power of the network in exchange for a commission on the transaction paid to the computer or computing pool that handles and checks the chain of custody and hash tags associated. This results in amazingly fast transactions across the globe with zero interference from clearing houses, banks, or government entities. Although the accounts are public to the Bitcoin network, the associated keys are private and personal and subject to the same SHA-256 encryption. Because of this second level of encryption on a transaction that must also have the associated proof or origin and proof of work associated with the hash tree, the Bitcoin encryption is considered unbreakable. However, as detractors have noted it would be possible with enough computing power approximately a 50.1% control of the network to generate false keys and steal the transactions because the majority of the network would agree on the false encryption. The growth of the computing network for Bitcoin has been essential to its success and future success...as every added amount of computing power decreases the possibility for an entity to obtain 51% control and undermine the system.
external image Bitcoin_Transaction_Visual.png

Risk and Reward of Bitcoins

Bitcoins are not without their risks but the rewards to date have been some huge fortunes for the bold entrepreneurs on the front lines.
The primary risk is the failure of Bitcoin entirely. Bitcoin is built upon the principle of distributed control....loss of this distribution could undermine the security or the perceived value of the currency. Because the currency has no real tangible value its perceived value is paramount to its success. While this may seem like fragile footing, Bitcoin has been growing geometrically since 2009 and has a host of computer power behind it that would rival anything even a large government could put together in a short timeframe. Nevertheless two major concerns for the sustainability of Bitcoin are:
- The failure of the currency to be adopted. This is mostly a moot risk at this point but government intervention, a public failure, etc could cost consumer confidence and kill the currency value. However, it should be noted that a lot of the currencies strength right now comes from its anonymity and its quick transaction speed with no interference. Bitcoin is also unregulated and nearly impossible to regulate meaning it has caught on with gamblers, those wanting to avoid having their money subject to seizure or inteference, and the black market[8] .
- The largest risk of failure would be that the computing power ends up in the hands of an entity wishing to devalue it (most commonly referred to as the risk of government intervention) . By controlling 51% of computing power it would be possible to fake the transactional keys and steal Bitcoins or destroy them. This is usually dismissed as an unlikely notion because a private entitity would be undermining their own theft while it would be much more lucrative for them to just add and take over 51% of the daily minted coins and transactional fees. However, the adoption of Bitcoin by gamblers, the black market, money launderers, and drug cartels has earned the ire of the US and other major governments. A government like the US could easily out-compute the network with a quick expenditure of a billion or so dollars for the purpose of destroying the currency. This is unlikely for a variety of reasons but the favorites sighted Bitcoin adopters is the multitude of similar currencies that have cropped up in the wake of Bitcoin and the more nefarious outlook that the government also would like to move money anonymously through the Bitcoin network.

As put forth in the original Nakamoto publication the possibility of an attacker gaining control of the network has the issue of catching up to the existing network;

"The race between the honest chain and an attacker chain can be characterized as a Binomial Random Walk. The success event is the honest chain being extended by one block, increasing its lead by +1, and the failure event is the attacker's chain being extended by one block, reducing the gap by -1. The probability of an attacker catching up from a given deficit is analogous to a Gambler's Ruin problem. Suppose a gambler with unlimited credit starts at a deficit and plays potentially an infinite number of trials to try to reach breakeven. We can calculate the probability he ever reaches breakeven, or that an attacker ever catches up with the honest chain, as follows :

p = probability an honest node finds the next block
q= probability the attacker finds the next block
q(z)= probability the attacker will ever catch up from z blocks behind

q(z) = {1 if p ≤ q}, {(q/p)^2 if p>q}

Given our assumption that p > q, the probability drops exponentially as the number of blocks the attacker has to catch up with increases."[9]

For those willing to risk their hard earned dollars on equipment or speculation in Bitcoins the return can be huge. With the growth rate of the network since 2009, a $10000 investment in hardware would return its value in just under 3months time in 2012. The demand has been so high though for computer power that computer video cards with AMD GPU's (the most powerful for hash crypto) have maintained artificially high values and police raids have been documented at homes who's power draw was considered suspect for illegal marijuana grow operations. The demand for mining tech has also lead to huge demands for increased processing power and a round of mining hardware is beginning to be released that equates to over 100 pc's worth of computing power in one small low power device. Luckily the manufacturers of this new technology have implemented strategies to keep the flood of computing power and ownership of the computing power from devaluing the network but 2013 will be the year of the ASIC mining rig and will see many of the amateur GPU miners fall behind the curve where producing and handling financial transactions will be short of their associated increase in their electrical bills.


The Bitcoin Protocol

The Bitcoin protocol, as written by Nakamoto, was ingeniously designed around a few core basic principles to create a stable peer-to-peer currency.

Incentives to Distribute the Power
In order to ensure the safety of financial transaction the Bitcoin protocol is designed to use a distributed computer network. Logistically it would be difficult to convince thousands of people to switch on and dedicate their computing power (and power bills) to supporting the Bitcoin. To solve this the Bitcoin protocol algorithm handles distribution of the base of the currency (a maximum of exactly 21 million coins) through a unique graduated reward system. The Bitcoin algorithm rewards computers or computer network entities for solving hash blocks of varying difficulty. Originally the system would give 50 Bitcoins for the solution with the properly documented work for each block discovery. The algorithm automatically adjusts the difficulty of the next block to maintain the fixed number of blocks that are supposed to be discovered in a day by adjusting the length of the blocks to be hashed. In December of 2012 the algorithm hit its first schedule tier and halved the number of Bitcoins minted in a block discovery. The Bitcoin algorithm is scheduled to half itself again in 2017 and a couple more times on a schedule to release the final Bitcoins into circulation in 2040. This incentive system has really proven to be the difference and has since been copied by several other virtual currencies hoping to copy Bitcoin's success. To ensure that profitability remains in the network even as the original coin supply is diminished .05 Bitcoin fees are awarded for transactions of Bitcoins to the computer or network handling the transactions. At the current rate of increase in the value of Bitcoins the fees for Bitcoin transactions will exceed the revenue for mining Bitcoins as early as 2020.

Triple Redundancy insures the Security of the Exchange

In order to ensure the difficulty of decrypting the SHA-256 hash encryption in the face of ever increasing computer technology, the Bitcoin protocol includes double encryption and a proof of work model for its transaction and mining base. Not only is each dedicated mining computer system running at maximum load to generate blocks in a competition for the daily block rewards, they are also amassing a an encryption chain of events that amounts to a proof-of-work for the decryption and any transactions on the network. By making a proof-of-work required in addition to raw discovery of the encrypted block the algorithm ensures that no circumvention techniques are allowable as the network rejects any lucky discoveries without the associated proof of work. The order of difficulty alone
A binary (Merkle) hash Tree
A binary (Merkle) hash Tree

for brute force decryption of a 32 digit sequence of 36 available characters derived with 5 random and unique mathematical and tabular operators makes even decryption of the base hash unlikely in the next several decades of computer improvements[10] . However when coupled with the proof-of-work requirement the difficulty becomes a function of time not just luck and power and further secures the network and its transactions. To do this each computer on the network is required to store and verify any portion of the entirety of the blockchain or Merkle Hash Tree. The Merkle Hash Tree describes the proof-of-work and history methodology[11] . Bitcoin uses a Merkle Hash Tree for all the Bitcoins in existence. Because the Bitcoins can be broken up in to incrementally small amounts this can result in a massive volume of digital information. However, the nature of discovered blocks means that only portions of the proof of work blocks need to exist to verify accurately the origin of a hash so in effect the entirety of the hash history and verification tree can be stored in just a few GB of memory ( A capacity most computers have easily these days). Even thought the security of the system is inherent it is still subject to the limitations of the network of computers that are its backbone. If ever over half of the computer network were controlled by one entity it would be possible to fake the validity in the proof of work model and have the system accept the invalid proof of work and thus compromise the security of the transactions. However, this only allows those transactions originating from the entity in control to be reversed and in effect steal their money back. The network has already outgrown any small entity would be attackers and must gain another 2 orders of magnitude in computing before it will be considered to be impervious to even large government hostile takeover.



Increase the Difficulty to Control Deflation

The Bitcoin is actually designed to have artificial inflation as it will eventually only ever be 21 million coins in circulation. As demand goes up and the coins become scarce and difficult to mine the value will go up. However, as a hedge against radical inflation or deflation the algorithm has a very unique and beautiful strategy for controlling the flow to the market[12] . If computing power is catching up with the block projects submitted to the network (random hashes with no keys ever having been generated) the algorithm will change the difficulty and broadcast the change for the next block.

An example when Bitcoin was young and difficulty was low because computing power was low...the difficulty was around 2^16 or 65536. In that case the block to be solved would be

0000000000000000000xy45x87g459tr3o (representing 16 digits to be resolved by brute force hashing of the 32 in the block)
‍- This representation is just a visual for what is taking place the actual zeros and digits are not accurate for the possible combinations of this number.

The hashing computer would then take those 16 digits and begin applying linear changes to these digits and checking to see whether the SHA-256 encryption algorithm could be solved for those combinations. Multiplied by several computers worth of power and the fact that a powerful video card could complete approximately 400mhash/second...it would take up to 4 hours for this to be discovered on the early Bitcoin network. When it was discovered it was verified collectively with the proof of work model showing previous hashes as well as backwards encryption from the SHA-256 algorithm and it would be added to the hash tree for transactional verification later.
The total number of Bitcoins in circulation from December 2011 to November 2012.  Notice the spike in november when computing power jumped up and the realization that the block reward would drop in half in December.  The algorithm is doing a pretty solid job.
The total number of Bitcoins in circulation from December 2011 to November 2012. Notice the spike in november when computing power jumped up and the realization that the block reward would drop in half in December. The algorithm is doing a pretty solid job.


If computing power on the network began solving these blocks too quickly and more coins were being generated daily than intended by the algorithm it would change the difficulty of the next block...sometimes in one step but it was also programmed to handle overshooting the difficulty and compensating back the other way should the network shrink or discovery be too slow.

Today difficulty (March 8 2013) is 4,367,876 which a little over 2^22 meaning the block will have less zero's but also have some difficulty changes in its rules such that it doesn't have 36 combinations for every digit.

00000000000045js7fhe65e82md433hw (might be what the block would look like today with the difficulty established)

In the end the distribution maintained by the algorithm is consistent and linear as designed. It has ensured that the value of Bitcoins has steadily risen in a similar relationship and has seen very little decline except for miner sell of and speculation
















 
 











[圖]
 










[圖]
 








[圖]
 










※ 編輯: ott 時間: 2017-12-05 01:43:49
※ 看板: ott 文章推薦值: 0 目前人氣: 0 累積人氣: 182 
分享網址: 複製 已複製
guest
x)推文 r)回覆 e)編輯 d)刪除 M)收藏 ^x)轉錄 同主題: =)首篇 [)上篇 ])下篇