레이블이 paper인 게시물을 표시합니다. 모든 게시물 표시
레이블이 paper인 게시물을 표시합니다. 모든 게시물 표시

2014년 1월 24일 금요일

proof of work of bitcoin : satoshi paper


1.2) Proof-of-Work of bitcoin
    1). Scanning for a value that when hashed, the hash begins with number of zero bits.
   
    2). increment a nonce in the block until a value is found,  that gives the blocks hash the required zero bits

    3). As later blocks are chained after it,

          * the work to change the block would include redoing all the blocks  after it.
 
        * Every block contains a hash of the previous block.

             - Creating a chain of blocks from the genesis block to the current block.

            - By these properties, double-spending of bitcoins very difficult.


    4) Proof-of-work difficulty is determined by a moving average targeting an average number of blocks per hour.
    

v* Problem of majority decision in bitcoin
    
     1) Proof-of work is one-CPU-one-vote, not one-IP-one-vote.

     2) Majority decision is represented by the longest chain.

         è To modify a past block, an attacker redo the proof-of-work of the block and all blocks after it.

         è Probability of attack reduces exponentially as next blocks are added.
 



* Block of bitcoin 

  
  * There are multiple valid solutions for any given block

    - only one of the solutions needs to be found for the block to be solved.
  * Coinbase transaction:  known as a generation transaction.

      - appearing the first transaction in every block.
  * The number of generated Bitcoins per block: starts at 50.

      - halved every 210,000 blocks (about four years).
  * Bitcoin transactions are broadcast to the network,

      - all peers trying to solve blocks collect the transaction records.

      - add the transaction records to the block.
  * The difficulty of bitcoin is automatically adjusted by the network,

      - solving an average of 6 blocks per hour.

      - every 2016 blocks (about two weeks).
  * This increases (or decreases) the difficulty of generating blocks.


  * Hash of block:  SHA-256 hash of a block's header.

     - between 0the maximum value of a 256-bit number.

     - bitcoin uses: SHA256(SHA256(Block_Header))
  * If your hash is below the target, then you win.

     - If not, you increment the nonce and try again.

transaction of bitcoin : satoshi paper


Bitcoin: A Peer-to-Peer Electronic Cash System   by  Satoshi Nakamoto.

1) Transaction

     1). Electronic coin : define as chain of digital signature.

     2). Transfer : adding the end of the coin with

            - signing   1) a hash of the previous transaction.

                2) public key of the next owner.

           - buyer : verify the signature.

Transaction data
   1. Input.

      * Previous tx : a hash of a previous transaction.

       * ScriptSig : the first half of a script.

           - hash of a simplified version of the transaction.

             - cf). Script : a signature + a public key.

  2. Output.

      * ScriptPubKey is the second half of a script.

            - The public key : buyer.
  3. verification.
     * ScriptSig + ScriptPubKey  : prove the transaction was created by the real owner.





Form of transaction data


https://en.bitcoin.it/wiki/Transactions