Introduction
             Bitcoin addresses
                  Transactions
                    Block chain




                        Bitcoins
           Mathematical Background


                Akram El-Korashy1

           1 Computer
                    Science and Engineering
               German University in Cairo


CSEN 1033 Seminar in Topics and Applications in
            Cryptography, 2013



            Akram El-Korashy      Bitcoins Math
Introduction
                      Bitcoin addresses
                           Transactions
                             Block chain


Outline


  1   Introduction
         Bitcoins network properties

  2   Bitcoin addresses
         BTC address generation overview
         BTC address cryptography

  3   Transactions

  4   Block chain



                      Akram El-Korashy     Bitcoins Math
Introduction
                      Bitcoin addresses
                                           Bitcoins network properties
                           Transactions
                             Block chain


Outline


  1   Introduction
         Bitcoins network properties

  2   Bitcoin addresses
         BTC address generation overview
         BTC address cryptography

  3   Transactions

  4   Block chain



                      Akram El-Korashy     Bitcoins Math
Introduction
                    Bitcoin addresses
                                         Bitcoins network properties
                         Transactions
                           Block chain


Main features



     Bitcoins can be transferred between arbitrary nodes.
     Transactions can be received at any time.
     Transactions are broadcast within seconds.




                    Akram El-Korashy     Bitcoins Math
Introduction
                     Bitcoin addresses
                                          Bitcoins network properties
                          Transactions
                            Block chain


Main features



     Bitcoins can be transferred between arbitrary nodes.
     Transactions can be received at any time.
     Transactions are broadcast within seconds.


     Transactions are verified within 10 to 60 minutes.
     Transactions are irreversible.
     Double spending is prevented by using a block chain.



                     Akram El-Korashy     Bitcoins Math
Introduction
                      Bitcoin addresses
                                           Bitcoins network properties
                           Transactions
                             Block chain


Main features


  Bitcoin addresses
     Bitcoins can be transferred between arbitrary nodes.
     Transactions can be received at any time.
     Transactions are broadcast within seconds.


     Transactions are verified within 10 to 60 minutes.
     Transactions are irreversible.
     Double spending is prevented by using a block chain.



                      Akram El-Korashy     Bitcoins Math
Introduction
                      Bitcoin addresses
                                           Bitcoins network properties
                           Transactions
                             Block chain


Main features


  Bitcoin addresses
      Bitcoins can be transferred between arbitrary nodes.
      Transactions can be received at any time.
      Transactions are broadcast within seconds.
  Bitcoin blockchains
      Transactions are verified within 10 to 60 minutes.
      Transactions are irreversible.
      Double spending is prevented by using a block chain.



                      Akram El-Korashy     Bitcoins Math
Introduction
                      Bitcoin addresses    BTC address generation overview
                           Transactions    BTC address cryptography
                             Block chain


Outline


  1   Introduction
         Bitcoins network properties

  2   Bitcoin addresses
         BTC address generation overview
         BTC address cryptography

  3   Transactions

  4   Block chain



                      Akram El-Korashy     Bitcoins Math
Introduction
                       Bitcoin addresses    BTC address generation overview
                            Transactions    BTC address cryptography
                              Block chain


Bitcoin Address
Definition




   Definition
   Bicoin address is an identifier of 27-34 alphanumeric
   characters, that represents a possible destination for a Bitcoin
   payment.




                       Akram El-Korashy     Bitcoins Math
Introduction
                       Bitcoin addresses    BTC address generation overview
                            Transactions    BTC address cryptography
                              Block chain


Bitcoin Address
Definition




   Definition
   Bicoin address is an identifier of 27-34 alphanumeric
   characters, that represents a possible destination for a Bitcoin
   payment.

   Address Generation
   A Bitcoin address is a 160-bit hash of the public portion of a
   public/private ECDSA keypair.




                       Akram El-Korashy     Bitcoins Math
Introduction
                       Bitcoin addresses    BTC address generation overview
                            Transactions    BTC address cryptography
                              Block chain


Bitcoin Address
Address Generation

   Choose a random Elliptic-Curve key-pair. The public part is
   converted into a BTC address




                       Akram El-Korashy     Bitcoins Math
Introduction
                     Bitcoin addresses    BTC address generation overview
                          Transactions    BTC address cryptography
                            Block chain


Bitcoin Address
Address Generation

   The 20 bytes Message Digest from RIPEMD-160..




                     Akram El-Korashy     Bitcoins Math
Introduction
                      Bitcoin addresses    BTC address generation overview
                           Transactions    BTC address cryptography
                             Block chain


Outline


  1   Introduction
         Bitcoins network properties

  2   Bitcoin addresses
         BTC address generation overview
         BTC address cryptography

  3   Transactions

  4   Block chain



                      Akram El-Korashy     Bitcoins Math
Introduction
                           Bitcoin addresses    BTC address generation overview
                                Transactions    BTC address cryptography
                                  Block chain


Bitcoin Address
Definitions and some Math

   Definition
   Base58




                           Akram El-Korashy     Bitcoins Math
Introduction
                           Bitcoin addresses    BTC address generation overview
                                Transactions    BTC address cryptography
                                  Block chain


Bitcoin Address
Definitions and some Math

   Definition
   Base58 encoding is a binary-to-text encoding, that uses only
   the alphanumeric characters




                           Akram El-Korashy     Bitcoins Math
Introduction
                           Bitcoin addresses    BTC address generation overview
                                Transactions    BTC address cryptography
                                  Block chain


Bitcoin Address
Definitions and some Math

   Definition
   Base58 encoding is a binary-to-text encoding, that uses only
   the alphanumeric characters (except 0,O,I, and l.)




                           Akram El-Korashy     Bitcoins Math
Introduction
                           Bitcoin addresses    BTC address generation overview
                                Transactions    BTC address cryptography
                                  Block chain


Bitcoin Address
Definitions and some Math

   Definition
   Base58 encoding is a binary-to-text encoding, that uses only
   the alphanumeric characters (except 0,O,I, and l.)

   Definition
   RIPEMD-160 is a cryptographic hash function that generates a
   160-bit digest of an arbitrary size block of data.

   Example
   RIPEMD-160("The quick brown fox jumps over the lazy
   dog") = 37f332f68db77bd9d7edd4969571ad671cf9dd3b
   RIPEMD-160("The quick brown fox jumps over the lazy
   cog") = 132072df690933835eb8b6ad0b77e7b6f14acad7
                           Akram El-Korashy     Bitcoins Math
Introduction
                            Bitcoin addresses    BTC address generation overview
                                 Transactions    BTC address cryptography
                                   Block chain


Bitcoin Address
Secure Hash Algorithm-256



        Input: arbitrary length data, Output: 256-bit digest
        Merkle-Damgard Construction (one-way compression
        function, block ciphers)




                            Akram El-Korashy     Bitcoins Math
Introduction
                      Bitcoin addresses    BTC address generation overview
                           Transactions    BTC address cryptography
                             Block chain


Definition
Elliptic curve over a field Fp can be defined as the set of points (x,y)
satisfying the equation

                  y 2 mod p = (x 3 + ax + b) mod p




                      Akram El-Korashy     Bitcoins Math
Introduction
                       Bitcoin addresses    BTC address generation overview
                            Transactions    BTC address cryptography
                              Block chain


Definition
Elliptic curve over a field Fp can be defined as the set of points (x,y)
satisfying the equation

                   y 2 mod p = (x 3 + ax + b) mod p

Example




  The set of affine points of the elliptic curve y 2 = x 3 − x over F61 .

                       Akram El-Korashy     Bitcoins Math
Introduction
                             Bitcoin addresses    BTC address generation overview
                                  Transactions    BTC address cryptography
                                    Block chain


Bitcoin Address
Elliptic Curve Digital Signature Algorithm


    Any signature algorithm has a Sign phase and a Verify
    phase.




                             Akram El-Korashy     Bitcoins Math
Introduction
                             Bitcoin addresses    BTC address generation overview
                                  Transactions    BTC address cryptography
                                    Block chain


Bitcoin Address
Elliptic Curve Digital Signature Algorithm


    Any signature algorithm has a Sign phase and a Verify
    phase. Some parameters agreed upon between sender and
    receiver:
      1   q field size




                             Akram El-Korashy     Bitcoins Math
Introduction
                             Bitcoin addresses    BTC address generation overview
                                  Transactions    BTC address cryptography
                                    Block chain


Bitcoin Address
Elliptic Curve Digital Signature Algorithm


    Any signature algorithm has a Sign phase and a Verify
    phase. Some parameters agreed upon between sender and
    receiver:
      1   q field size
      2   FR the basis used - can assume a fixed basis




                             Akram El-Korashy     Bitcoins Math
Introduction
                             Bitcoin addresses    BTC address generation overview
                                  Transactions    BTC address cryptography
                                    Block chain


Bitcoin Address
Elliptic Curve Digital Signature Algorithm


    Any signature algorithm has a Sign phase and a Verify
    phase. Some parameters agreed upon between sender and
    receiver:
      1   q field size
      2   FR the basis used - can assume a fixed basis
      3   a, b parameters of the equation




                             Akram El-Korashy     Bitcoins Math
Introduction
                             Bitcoin addresses    BTC address generation overview
                                  Transactions    BTC address cryptography
                                    Block chain


Bitcoin Address
Elliptic Curve Digital Signature Algorithm


    Any signature algorithm has a Sign phase and a Verify
    phase. Some parameters agreed upon between sender and
    receiver:
      1   q field size
      2   FR the basis used - can assume a fixed basis
      3   a, b parameters of the equation (field elements)




                             Akram El-Korashy     Bitcoins Math
Introduction
                             Bitcoin addresses    BTC address generation overview
                                  Transactions    BTC address cryptography
                                    Block chain


Bitcoin Address
Elliptic Curve Digital Signature Algorithm


    Any signature algorithm has a Sign phase and a Verify
    phase. Some parameters agreed upon between sender and
    receiver:
      1   q field size
      2   FR the basis used - can assume a fixed basis
      3   a, b parameters of the equation (field elements)
      4   G base point, and
      5   n its order - group element order, point addition, point
          doubling



                             Akram El-Korashy     Bitcoins Math
Introduction
                             Bitcoin addresses    BTC address generation overview
                                  Transactions    BTC address cryptography
                                    Block chain


Bitcoin Address
Elliptic Curve Digital Signature Algorithm


    Any signature algorithm has a Sign phase and a Verify
    phase. Some parameters agreed upon between sender and
    receiver:
      1   q field size
      2   FR the basis used - can assume a fixed basis
      3   a, b parameters of the equation (field elements)
      4   G base point, and
      5   n its order - group element order, point addition, point
          doubling (can be calculated from G!)



                             Akram El-Korashy     Bitcoins Math
Introduction
                             Bitcoin addresses    BTC address generation overview
                                  Transactions    BTC address cryptography
                                    Block chain


Bitcoin Address
Elliptic Curve Digital Signature Algorithm


    Any signature algorithm has a Sign phase and a Verify
    phase. Some parameters agreed upon between sender and
    receiver:
      1   q field size
      2   FR the basis used - can assume a fixed basis
      3   a, b parameters of the equation (field elements)
      4   G base point, and
      5   n its order - group element order, point addition, point
          doubling (can be calculated from G!)
      6   h cofactor - order of the curve divided by n


                             Akram El-Korashy     Bitcoins Math
Introduction
                           Bitcoin addresses
                                Transactions
                                  Block chain


Transactions
Definitions

   Definition
   A transaction is a signed section of data that is broadcast to the
   network and collected into blocks.

         It typically references previous transaction(s) and dedicates a
         certain number of bitcoins from it to one or more new public
         key(s) (Bitcoin address).
         It is not encrypted (nothing in Bitcoin is encrypted).




                           Akram El-Korashy     Bitcoins Math
Introduction
                           Bitcoin addresses
                                Transactions
                                  Block chain


Transactions
Definitions

   Definition
   A transaction is a signed section of data that is broadcast to the
   network and collected into blocks.

         It typically references previous transaction(s) and dedicates a
         certain number of bitcoins from it to one or more new public
         key(s) (Bitcoin address).
         It is not encrypted (nothing in Bitcoin is encrypted).

         Transactions and Blocks are the main data structures.
         A Block is composed of a header and a group of transactions.
         Transactions are identified by their hash (SHA-256).
         Blocks are identified by a hash of the header.
                           Akram El-Korashy     Bitcoins Math
Introduction
                            Bitcoin addresses
                                 Transactions
                                   Block chain


Transactions
Example

   Example
                        Principle example of a transaction




          Script is a set of instructions for the receiver to follow in order to
          be able to spend the Bitcoins.
          An input is a reference to the output of a different transaction.
          Previous tx is the pointer to (hash value of) the transaction
          from which the bitcoin Value will be transferred.
                            Akram El-Korashy     Bitcoins Math
Introduction
                           Bitcoin addresses
                                Transactions
                                  Block chain


Transactions
Example


          The main script instructions are:

               The hash of the public key should match the bitcoin
               address specified in the transaction.
               The signature on the sent data should be verifiable by the
               public key.

          Instructions are executed from the Output field of the
          referenced transaction Previous tx
          scriptSig is an ECDSA signature on small data (part of the
          transaction). It serves as a proof that the transaction in which it
          exists was created by the real owner of the public address which
          the Previous tx was intended to.


                           Akram El-Korashy     Bitcoins Math
Introduction
                             Bitcoin addresses
                                  Transactions
                                    Block chain


Block Chain
Definition




   Definition
   Block chain is a transaction database shared by all nodes
   participating in a system based on the Bitcoin protocol.


            Every block contains a hash of the previous block
            BitCoin uses the SHA-256 hash algorithm to generate verifiably
            "random" numbers in a way that requires a predictable amount
            of CPU effort.




                            Akram El-Korashy      Bitcoins Math
Introduction
                      Bitcoin addresses
                           Transactions
                             Block chain


Block Chain
Concept


    Block chain: Because a block can only reference one previous
        block, it is impossible for two forked chains to merge.




                       (Tree goes bottom-up)


                      Akram El-Korashy         Bitcoins Math
Appendix




References I


     https://en.bitcoin.it/wiki/Address
     Accessed March, 2013

     Simple Tutorial on Elliptic Curve Cryptography
     Accessed March, 2013

     https://en.bitcoin.it/w/images/en/9/9b/PubKeyToAddr.png
     Accessed March, 2013

     Bitcoin wiki: Technical background of bitcoin addresses
     Accessed March, 2013

     rnks.informatik.tu-cottbus.de - A tutorial on elliptic curve cryptography
     Accessed March, 2013

     https://en.bitcoin.it/wiki/Category:Technical
     Accessed March, 2013




                                    Akram El-Korashy         Bitcoins Math

Bitcoins Math

  • 1.
    Introduction Bitcoin addresses Transactions Block chain Bitcoins Mathematical Background Akram El-Korashy1 1 Computer Science and Engineering German University in Cairo CSEN 1033 Seminar in Topics and Applications in Cryptography, 2013 Akram El-Korashy Bitcoins Math
  • 2.
    Introduction Bitcoin addresses Transactions Block chain Outline 1 Introduction Bitcoins network properties 2 Bitcoin addresses BTC address generation overview BTC address cryptography 3 Transactions 4 Block chain Akram El-Korashy Bitcoins Math
  • 3.
    Introduction Bitcoin addresses Bitcoins network properties Transactions Block chain Outline 1 Introduction Bitcoins network properties 2 Bitcoin addresses BTC address generation overview BTC address cryptography 3 Transactions 4 Block chain Akram El-Korashy Bitcoins Math
  • 4.
    Introduction Bitcoin addresses Bitcoins network properties Transactions Block chain Main features Bitcoins can be transferred between arbitrary nodes. Transactions can be received at any time. Transactions are broadcast within seconds. Akram El-Korashy Bitcoins Math
  • 5.
    Introduction Bitcoin addresses Bitcoins network properties Transactions Block chain Main features Bitcoins can be transferred between arbitrary nodes. Transactions can be received at any time. Transactions are broadcast within seconds. Transactions are verified within 10 to 60 minutes. Transactions are irreversible. Double spending is prevented by using a block chain. Akram El-Korashy Bitcoins Math
  • 6.
    Introduction Bitcoin addresses Bitcoins network properties Transactions Block chain Main features Bitcoin addresses Bitcoins can be transferred between arbitrary nodes. Transactions can be received at any time. Transactions are broadcast within seconds. Transactions are verified within 10 to 60 minutes. Transactions are irreversible. Double spending is prevented by using a block chain. Akram El-Korashy Bitcoins Math
  • 7.
    Introduction Bitcoin addresses Bitcoins network properties Transactions Block chain Main features Bitcoin addresses Bitcoins can be transferred between arbitrary nodes. Transactions can be received at any time. Transactions are broadcast within seconds. Bitcoin blockchains Transactions are verified within 10 to 60 minutes. Transactions are irreversible. Double spending is prevented by using a block chain. Akram El-Korashy Bitcoins Math
  • 8.
    Introduction Bitcoin addresses BTC address generation overview Transactions BTC address cryptography Block chain Outline 1 Introduction Bitcoins network properties 2 Bitcoin addresses BTC address generation overview BTC address cryptography 3 Transactions 4 Block chain Akram El-Korashy Bitcoins Math
  • 9.
    Introduction Bitcoin addresses BTC address generation overview Transactions BTC address cryptography Block chain Bitcoin Address Definition Definition Bicoin address is an identifier of 27-34 alphanumeric characters, that represents a possible destination for a Bitcoin payment. Akram El-Korashy Bitcoins Math
  • 10.
    Introduction Bitcoin addresses BTC address generation overview Transactions BTC address cryptography Block chain Bitcoin Address Definition Definition Bicoin address is an identifier of 27-34 alphanumeric characters, that represents a possible destination for a Bitcoin payment. Address Generation A Bitcoin address is a 160-bit hash of the public portion of a public/private ECDSA keypair. Akram El-Korashy Bitcoins Math
  • 11.
    Introduction Bitcoin addresses BTC address generation overview Transactions BTC address cryptography Block chain Bitcoin Address Address Generation Choose a random Elliptic-Curve key-pair. The public part is converted into a BTC address Akram El-Korashy Bitcoins Math
  • 12.
    Introduction Bitcoin addresses BTC address generation overview Transactions BTC address cryptography Block chain Bitcoin Address Address Generation The 20 bytes Message Digest from RIPEMD-160.. Akram El-Korashy Bitcoins Math
  • 13.
    Introduction Bitcoin addresses BTC address generation overview Transactions BTC address cryptography Block chain Outline 1 Introduction Bitcoins network properties 2 Bitcoin addresses BTC address generation overview BTC address cryptography 3 Transactions 4 Block chain Akram El-Korashy Bitcoins Math
  • 14.
    Introduction Bitcoin addresses BTC address generation overview Transactions BTC address cryptography Block chain Bitcoin Address Definitions and some Math Definition Base58 Akram El-Korashy Bitcoins Math
  • 15.
    Introduction Bitcoin addresses BTC address generation overview Transactions BTC address cryptography Block chain Bitcoin Address Definitions and some Math Definition Base58 encoding is a binary-to-text encoding, that uses only the alphanumeric characters Akram El-Korashy Bitcoins Math
  • 16.
    Introduction Bitcoin addresses BTC address generation overview Transactions BTC address cryptography Block chain Bitcoin Address Definitions and some Math Definition Base58 encoding is a binary-to-text encoding, that uses only the alphanumeric characters (except 0,O,I, and l.) Akram El-Korashy Bitcoins Math
  • 17.
    Introduction Bitcoin addresses BTC address generation overview Transactions BTC address cryptography Block chain Bitcoin Address Definitions and some Math Definition Base58 encoding is a binary-to-text encoding, that uses only the alphanumeric characters (except 0,O,I, and l.) Definition RIPEMD-160 is a cryptographic hash function that generates a 160-bit digest of an arbitrary size block of data. Example RIPEMD-160("The quick brown fox jumps over the lazy dog") = 37f332f68db77bd9d7edd4969571ad671cf9dd3b RIPEMD-160("The quick brown fox jumps over the lazy cog") = 132072df690933835eb8b6ad0b77e7b6f14acad7 Akram El-Korashy Bitcoins Math
  • 18.
    Introduction Bitcoin addresses BTC address generation overview Transactions BTC address cryptography Block chain Bitcoin Address Secure Hash Algorithm-256 Input: arbitrary length data, Output: 256-bit digest Merkle-Damgard Construction (one-way compression function, block ciphers) Akram El-Korashy Bitcoins Math
  • 19.
    Introduction Bitcoin addresses BTC address generation overview Transactions BTC address cryptography Block chain Definition Elliptic curve over a field Fp can be defined as the set of points (x,y) satisfying the equation y 2 mod p = (x 3 + ax + b) mod p Akram El-Korashy Bitcoins Math
  • 20.
    Introduction Bitcoin addresses BTC address generation overview Transactions BTC address cryptography Block chain Definition Elliptic curve over a field Fp can be defined as the set of points (x,y) satisfying the equation y 2 mod p = (x 3 + ax + b) mod p Example The set of affine points of the elliptic curve y 2 = x 3 − x over F61 . Akram El-Korashy Bitcoins Math
  • 21.
    Introduction Bitcoin addresses BTC address generation overview Transactions BTC address cryptography Block chain Bitcoin Address Elliptic Curve Digital Signature Algorithm Any signature algorithm has a Sign phase and a Verify phase. Akram El-Korashy Bitcoins Math
  • 22.
    Introduction Bitcoin addresses BTC address generation overview Transactions BTC address cryptography Block chain Bitcoin Address Elliptic Curve Digital Signature Algorithm Any signature algorithm has a Sign phase and a Verify phase. Some parameters agreed upon between sender and receiver: 1 q field size Akram El-Korashy Bitcoins Math
  • 23.
    Introduction Bitcoin addresses BTC address generation overview Transactions BTC address cryptography Block chain Bitcoin Address Elliptic Curve Digital Signature Algorithm Any signature algorithm has a Sign phase and a Verify phase. Some parameters agreed upon between sender and receiver: 1 q field size 2 FR the basis used - can assume a fixed basis Akram El-Korashy Bitcoins Math
  • 24.
    Introduction Bitcoin addresses BTC address generation overview Transactions BTC address cryptography Block chain Bitcoin Address Elliptic Curve Digital Signature Algorithm Any signature algorithm has a Sign phase and a Verify phase. Some parameters agreed upon between sender and receiver: 1 q field size 2 FR the basis used - can assume a fixed basis 3 a, b parameters of the equation Akram El-Korashy Bitcoins Math
  • 25.
    Introduction Bitcoin addresses BTC address generation overview Transactions BTC address cryptography Block chain Bitcoin Address Elliptic Curve Digital Signature Algorithm Any signature algorithm has a Sign phase and a Verify phase. Some parameters agreed upon between sender and receiver: 1 q field size 2 FR the basis used - can assume a fixed basis 3 a, b parameters of the equation (field elements) Akram El-Korashy Bitcoins Math
  • 26.
    Introduction Bitcoin addresses BTC address generation overview Transactions BTC address cryptography Block chain Bitcoin Address Elliptic Curve Digital Signature Algorithm Any signature algorithm has a Sign phase and a Verify phase. Some parameters agreed upon between sender and receiver: 1 q field size 2 FR the basis used - can assume a fixed basis 3 a, b parameters of the equation (field elements) 4 G base point, and 5 n its order - group element order, point addition, point doubling Akram El-Korashy Bitcoins Math
  • 27.
    Introduction Bitcoin addresses BTC address generation overview Transactions BTC address cryptography Block chain Bitcoin Address Elliptic Curve Digital Signature Algorithm Any signature algorithm has a Sign phase and a Verify phase. Some parameters agreed upon between sender and receiver: 1 q field size 2 FR the basis used - can assume a fixed basis 3 a, b parameters of the equation (field elements) 4 G base point, and 5 n its order - group element order, point addition, point doubling (can be calculated from G!) Akram El-Korashy Bitcoins Math
  • 28.
    Introduction Bitcoin addresses BTC address generation overview Transactions BTC address cryptography Block chain Bitcoin Address Elliptic Curve Digital Signature Algorithm Any signature algorithm has a Sign phase and a Verify phase. Some parameters agreed upon between sender and receiver: 1 q field size 2 FR the basis used - can assume a fixed basis 3 a, b parameters of the equation (field elements) 4 G base point, and 5 n its order - group element order, point addition, point doubling (can be calculated from G!) 6 h cofactor - order of the curve divided by n Akram El-Korashy Bitcoins Math
  • 29.
    Introduction Bitcoin addresses Transactions Block chain Transactions Definitions Definition A transaction is a signed section of data that is broadcast to the network and collected into blocks. It typically references previous transaction(s) and dedicates a certain number of bitcoins from it to one or more new public key(s) (Bitcoin address). It is not encrypted (nothing in Bitcoin is encrypted). Akram El-Korashy Bitcoins Math
  • 30.
    Introduction Bitcoin addresses Transactions Block chain Transactions Definitions Definition A transaction is a signed section of data that is broadcast to the network and collected into blocks. It typically references previous transaction(s) and dedicates a certain number of bitcoins from it to one or more new public key(s) (Bitcoin address). It is not encrypted (nothing in Bitcoin is encrypted). Transactions and Blocks are the main data structures. A Block is composed of a header and a group of transactions. Transactions are identified by their hash (SHA-256). Blocks are identified by a hash of the header. Akram El-Korashy Bitcoins Math
  • 31.
    Introduction Bitcoin addresses Transactions Block chain Transactions Example Example Principle example of a transaction Script is a set of instructions for the receiver to follow in order to be able to spend the Bitcoins. An input is a reference to the output of a different transaction. Previous tx is the pointer to (hash value of) the transaction from which the bitcoin Value will be transferred. Akram El-Korashy Bitcoins Math
  • 32.
    Introduction Bitcoin addresses Transactions Block chain Transactions Example The main script instructions are: The hash of the public key should match the bitcoin address specified in the transaction. The signature on the sent data should be verifiable by the public key. Instructions are executed from the Output field of the referenced transaction Previous tx scriptSig is an ECDSA signature on small data (part of the transaction). It serves as a proof that the transaction in which it exists was created by the real owner of the public address which the Previous tx was intended to. Akram El-Korashy Bitcoins Math
  • 33.
    Introduction Bitcoin addresses Transactions Block chain Block Chain Definition Definition Block chain is a transaction database shared by all nodes participating in a system based on the Bitcoin protocol. Every block contains a hash of the previous block BitCoin uses the SHA-256 hash algorithm to generate verifiably "random" numbers in a way that requires a predictable amount of CPU effort. Akram El-Korashy Bitcoins Math
  • 34.
    Introduction Bitcoin addresses Transactions Block chain Block Chain Concept Block chain: Because a block can only reference one previous block, it is impossible for two forked chains to merge. (Tree goes bottom-up) Akram El-Korashy Bitcoins Math
  • 35.
    Appendix References I https://en.bitcoin.it/wiki/Address Accessed March, 2013 Simple Tutorial on Elliptic Curve Cryptography Accessed March, 2013 https://en.bitcoin.it/w/images/en/9/9b/PubKeyToAddr.png Accessed March, 2013 Bitcoin wiki: Technical background of bitcoin addresses Accessed March, 2013 rnks.informatik.tu-cottbus.de - A tutorial on elliptic curve cryptography Accessed March, 2013 https://en.bitcoin.it/wiki/Category:Technical Accessed March, 2013 Akram El-Korashy Bitcoins Math