Shiv Sahni
Sr. Security Analyst
Bitcoin
I'm NoT aN ExPeRt!
How Everything Began?
● 2007: According to legend, Satoshi Nakamoto began working on the Bitcoin concept in 2007.
● August, 2008: Bitcoin.org is born! The domain was registered at anonymousspeech.com, a
site that allows users to anonymously register domain names and currently accepts Bitcoins.
● October, 2008: Nakamoto publishes a design paper through a metzdowd.com
cryptography mailing list that describes the Bitcoin currency and solves the problem of double
spending so as to prevent the currency from being copied.
● November, 2008: The Bitcoin project is registered on SourceForge.net, a community
collaboration website focused on the development and distribution of open source software.
● January 3, 2009: Block 0, the genesis block, is established at 18:15:05 GMT.
● January 9, 2009: Version 0.1 is released!
● Now?
Now?
As of 1512134976 (Fri, 1 Dec 2017)
1 Bitcoin equals $10,003.56
# of Bitcoin Transactions in last 24 Hours: 3,77,051
https://blockchain.info/charts/
The J-Curve
Even WHOIS has no answer!
Satoshi Nakamoto
Appearance?
Cryptography!
It is the SCIENCE OF HIDING THINGS!
Wiki: Cryptography is the practice and study of techniques for secure
communication in the presence of third parties called adversaries.
Types:
● Symmetric Key Cryptography
● Asymmetric Key Cryptography
Digital Signatures!
Wiki: A digital signature is a mathematical scheme for demonstrating the
authenticity of digital messages or documents.
Let’s understand through analogies!
Wallets, Bitcoin Address and Digital Keys!
Wallet: The digital keys are not actually stored in the network, but are instead
created and stored by users in a file, or simple database, called a wallet.
In most cases, a bitcoin address is generated from and corresponds to a public
key.
Think of the public key as similar to a bank account number and the private key as
similar to the secret PIN.
Private Key
● A private key is simply a number, picked at random.
● Used to create signatures that are required to spend bitcoins.
● The private key must remain secret at all times, because revealing it to third
parties is equivalent to giving them control over the bitcoins secured by that
key.
● The private key must also be backed up and protected from accidental loss,
because if it’s lost it cannot be recovered and the funds secured by it are
forever lost, too.
○ In 2013 one user claimed to have lost 7,500 bitcoins, worth $49433062.5 at the time, when he
accidentally discarded a hard drive containing his private key. A backup of his key(s) might
have prevented this.
Public Key
The public key is calculated from the private key using elliptic curve multiplication,
which is irreversible:
Where
● k is the private key
● K is the resulting public key
● G is a constant point called the generator point
A private key can be converted into a public key, but a public key cannot be
converted back into a private key because the math only works one way.
Bitcoin Addresses
● It is a string of digits and characters that can be shared with anyone.
● Addresses are produced from Public Keys through the use of one-way
cryptographic hashing.
● Addresses produced from public keys consist of a string of numbers and
letters, beginning with the digit “1”. Here’s an example of a bitcoin address:
3AHLGJo1JWRYU77z27CeaGN4xtdZKjgYSe (Sud’s Bitcoin Address)
Why Bitcoins?
● It is a Peer to Peer System.
● Transactions without any Intermediaries(No Fees/Taxes/Instant Transfers).
● The transactions are verified and are recorded in a Distributed Ledger.
● Backed by a robust technology of BLOCKCHAINS!
Blockchain System
● The blockchain is a Public Ledger that records bitcoin transactions.
● No Trusted Central Authority required.
● Transactions are Broadcasted over the network.
● Network nodes can Validate The Transactions.
● Transactions are then added to Their Copy Of The Ledger, and then
broadcast these ledger additions to other nodes.
● Naturally takes care of Double Spending Problem.
Technical Aspects of Blockchain
● Ordered, Back Linked-list Data Structure.
● It contains list of Blocks.
● Each block contains the hash of the previous block.
● The first block of blockchain is known as Genesis Block.
Block
A Block is like a page of the ledger. Each block contains the following:
● The Proof-Of-Work
● Reference to the previous block.
● The record of some or all recent transactions.
● Coinbase transactions is always the first transaction available in every
block.
● Timestamp, Nounce and Version.
● The number of Bitcoins generated per block starts at 50 and is halved every
210,000 blocks (about four years).
Merkle Tree
Proof-Of-Work: Hash Darling Hash!
● The problem is to compute the hash corresponding to Block and the reward is
~12.5 BTC(53,53,486.66) is awarded to the miner.
● Why don't we mine??
Try Harder for Proof.txt Proof of Work!
● The bitcoin protocol deliberately makes it more difficult to prevent easy
mining.
● The BTC protocol will not accept plain hash. The hash must comply to
certain rules i.e. hash of block content along with the nonce, is
numerically smaller than the network's difficulty target.
● Miners aren’t supposed to meddle with the transaction data in a block, but
they must change the data they’re using to create a different hash. They do
this using another, random piece of data called a ‘nonce’(Non-Sense).
● Hash -> Change Nonce -> Repeat!
How Difficult it is to Mine?
It's like trying to flip 53 coins at
once and have them all come up
heads. Each time you try, your
chances of success are the same.
https://en.bitcoin.it/wiki/Block
Time For Facts!
● Total Number of BTC: 21 Million
● As of 30th March 2015: 1/3rd BTC are left to be mined.
● The 21 Million BTC are planned to be mined by 2140.
● For this, The difficulty of the mathematical problem is automatically adjusted
(6 blocks per hour) by the network.
● Every 2016 blocks (solved in about two weeks), all Bitcoin clients compare
the actual number created with this goal and modify the target by the
percentage that it varied.
● The network comes to a consensus and automatically increases (or
decreases) the difficulty of generating blocks.
● The bitcoin protocol specifies that the reward for adding a block will be
halved every 210,000 blocks (approximately every four years) 50 -> 25
->12.5
Bitcoin
Mining
Bitcoin Transaction
Transactions consist of one or more inputs and one or more outputs. To prevent
double spending, each input must refer to a previous unspent output in the
blockchain.
For Ex: If Priyanshu sends some bitcoins to Sudarshan, that transaction will have
three pieces of information:
● Input: This is a record of which bitcoin address was used to send the bitcoins
to Priyanshu in the first place (he received them from his friend, Vinayaka).
● Amount: This is the amount of bitcoins that Priyanshu is sending to
Sudharshan.
● Output: This is Sudarshan’s bitcoin address.
When Sum of inputs (coins used to pay) Exceed the
intended sum of payments?
In such a case, an additional output is used, returning the change back to the
payer.
If Priyanshu receives BTC from his friends say 1 from Navneeta, 2 from Vikas and
3 from Sijo then They don’t sum up instead they simply sit there as different
transaction records.
To make transaction of 1.5 BTC his wallet automatically creates two outputs for the
transaction: 1.5 BTC to Sudharshan, and 0.5 BTC to a new address, which it
created for Priyanshu to hold her change from Sudharshan.
Transaction Verification
Let’s Talk About Security!!
The proof-of-work system and the chaining of blocks, makes modifications of the
blockchain extremely hard:
Since each block contains a cryptographic hash of the previous block using the
SHA-256 hashing algorithm. An attacker must modify all subsequent blocks in
order for the modifications of one block to be accepted.
Thanks to the References
● Mastering Bitcoin by Andreas M. Antonopoulos(
https://www.safaribooksonline.com/library/view/mastering-bitcoin/9781491902
639/ch04.html)
● Bitcoin: A Peer-to-Peer Electronic Cash System (https://bitcoin.org/bitcoin.pdf)
● The Blockchain - The Technology behind
Bitcoin(https://www.slideshare.net/JrmeKehrli/the-blockchain-the-technology-
behind-bitcoin)
● BITCOIN FORENSICS : Bsides Delhi Conference(
https://www.slideshare.net/anupriti/bitcoin-forensics-bsides-delhi-conference?l
ipi=urn%3Ali%3Apage%3Ad_flagship3_messaging%3BFtHteO%2BdRZO%2
F9vnZeXHAgg%3D%3D)

Bitcoins: Application of blockchain technology

  • 1.
    Shiv Sahni Sr. SecurityAnalyst Bitcoin
  • 2.
    I'm NoT aNExPeRt!
  • 3.
  • 4.
    ● 2007: Accordingto legend, Satoshi Nakamoto began working on the Bitcoin concept in 2007. ● August, 2008: Bitcoin.org is born! The domain was registered at anonymousspeech.com, a site that allows users to anonymously register domain names and currently accepts Bitcoins. ● October, 2008: Nakamoto publishes a design paper through a metzdowd.com cryptography mailing list that describes the Bitcoin currency and solves the problem of double spending so as to prevent the currency from being copied. ● November, 2008: The Bitcoin project is registered on SourceForge.net, a community collaboration website focused on the development and distribution of open source software. ● January 3, 2009: Block 0, the genesis block, is established at 18:15:05 GMT. ● January 9, 2009: Version 0.1 is released! ● Now?
  • 5.
    Now? As of 1512134976(Fri, 1 Dec 2017) 1 Bitcoin equals $10,003.56 # of Bitcoin Transactions in last 24 Hours: 3,77,051 https://blockchain.info/charts/
  • 6.
  • 8.
    Even WHOIS hasno answer!
  • 9.
  • 10.
  • 12.
    Cryptography! It is theSCIENCE OF HIDING THINGS! Wiki: Cryptography is the practice and study of techniques for secure communication in the presence of third parties called adversaries. Types: ● Symmetric Key Cryptography ● Asymmetric Key Cryptography
  • 13.
    Digital Signatures! Wiki: Adigital signature is a mathematical scheme for demonstrating the authenticity of digital messages or documents.
  • 14.
  • 15.
    Wallets, Bitcoin Addressand Digital Keys! Wallet: The digital keys are not actually stored in the network, but are instead created and stored by users in a file, or simple database, called a wallet. In most cases, a bitcoin address is generated from and corresponds to a public key. Think of the public key as similar to a bank account number and the private key as similar to the secret PIN.
  • 16.
    Private Key ● Aprivate key is simply a number, picked at random. ● Used to create signatures that are required to spend bitcoins. ● The private key must remain secret at all times, because revealing it to third parties is equivalent to giving them control over the bitcoins secured by that key. ● The private key must also be backed up and protected from accidental loss, because if it’s lost it cannot be recovered and the funds secured by it are forever lost, too. ○ In 2013 one user claimed to have lost 7,500 bitcoins, worth $49433062.5 at the time, when he accidentally discarded a hard drive containing his private key. A backup of his key(s) might have prevented this.
  • 17.
    Public Key The publickey is calculated from the private key using elliptic curve multiplication, which is irreversible: Where ● k is the private key ● K is the resulting public key ● G is a constant point called the generator point A private key can be converted into a public key, but a public key cannot be converted back into a private key because the math only works one way.
  • 18.
    Bitcoin Addresses ● Itis a string of digits and characters that can be shared with anyone. ● Addresses are produced from Public Keys through the use of one-way cryptographic hashing. ● Addresses produced from public keys consist of a string of numbers and letters, beginning with the digit “1”. Here’s an example of a bitcoin address: 3AHLGJo1JWRYU77z27CeaGN4xtdZKjgYSe (Sud’s Bitcoin Address)
  • 19.
    Why Bitcoins? ● Itis a Peer to Peer System. ● Transactions without any Intermediaries(No Fees/Taxes/Instant Transfers). ● The transactions are verified and are recorded in a Distributed Ledger. ● Backed by a robust technology of BLOCKCHAINS!
  • 20.
    Blockchain System ● Theblockchain is a Public Ledger that records bitcoin transactions. ● No Trusted Central Authority required. ● Transactions are Broadcasted over the network. ● Network nodes can Validate The Transactions. ● Transactions are then added to Their Copy Of The Ledger, and then broadcast these ledger additions to other nodes. ● Naturally takes care of Double Spending Problem.
  • 21.
    Technical Aspects ofBlockchain ● Ordered, Back Linked-list Data Structure. ● It contains list of Blocks. ● Each block contains the hash of the previous block. ● The first block of blockchain is known as Genesis Block.
  • 22.
    Block A Block islike a page of the ledger. Each block contains the following: ● The Proof-Of-Work ● Reference to the previous block. ● The record of some or all recent transactions. ● Coinbase transactions is always the first transaction available in every block. ● Timestamp, Nounce and Version. ● The number of Bitcoins generated per block starts at 50 and is halved every 210,000 blocks (about four years).
  • 23.
  • 24.
    Proof-Of-Work: Hash DarlingHash! ● The problem is to compute the hash corresponding to Block and the reward is ~12.5 BTC(53,53,486.66) is awarded to the miner. ● Why don't we mine??
  • 25.
    Try Harder forProof.txt Proof of Work! ● The bitcoin protocol deliberately makes it more difficult to prevent easy mining. ● The BTC protocol will not accept plain hash. The hash must comply to certain rules i.e. hash of block content along with the nonce, is numerically smaller than the network's difficulty target. ● Miners aren’t supposed to meddle with the transaction data in a block, but they must change the data they’re using to create a different hash. They do this using another, random piece of data called a ‘nonce’(Non-Sense). ● Hash -> Change Nonce -> Repeat!
  • 26.
    How Difficult itis to Mine? It's like trying to flip 53 coins at once and have them all come up heads. Each time you try, your chances of success are the same. https://en.bitcoin.it/wiki/Block
  • 27.
    Time For Facts! ●Total Number of BTC: 21 Million ● As of 30th March 2015: 1/3rd BTC are left to be mined. ● The 21 Million BTC are planned to be mined by 2140. ● For this, The difficulty of the mathematical problem is automatically adjusted (6 blocks per hour) by the network. ● Every 2016 blocks (solved in about two weeks), all Bitcoin clients compare the actual number created with this goal and modify the target by the percentage that it varied. ● The network comes to a consensus and automatically increases (or decreases) the difficulty of generating blocks. ● The bitcoin protocol specifies that the reward for adding a block will be halved every 210,000 blocks (approximately every four years) 50 -> 25 ->12.5
  • 28.
  • 29.
    Bitcoin Transaction Transactions consistof one or more inputs and one or more outputs. To prevent double spending, each input must refer to a previous unspent output in the blockchain. For Ex: If Priyanshu sends some bitcoins to Sudarshan, that transaction will have three pieces of information: ● Input: This is a record of which bitcoin address was used to send the bitcoins to Priyanshu in the first place (he received them from his friend, Vinayaka). ● Amount: This is the amount of bitcoins that Priyanshu is sending to Sudharshan. ● Output: This is Sudarshan’s bitcoin address.
  • 30.
    When Sum ofinputs (coins used to pay) Exceed the intended sum of payments? In such a case, an additional output is used, returning the change back to the payer. If Priyanshu receives BTC from his friends say 1 from Navneeta, 2 from Vikas and 3 from Sijo then They don’t sum up instead they simply sit there as different transaction records. To make transaction of 1.5 BTC his wallet automatically creates two outputs for the transaction: 1.5 BTC to Sudharshan, and 0.5 BTC to a new address, which it created for Priyanshu to hold her change from Sudharshan.
  • 31.
  • 32.
    Let’s Talk AboutSecurity!! The proof-of-work system and the chaining of blocks, makes modifications of the blockchain extremely hard: Since each block contains a cryptographic hash of the previous block using the SHA-256 hashing algorithm. An attacker must modify all subsequent blocks in order for the modifications of one block to be accepted.
  • 34.
    Thanks to theReferences ● Mastering Bitcoin by Andreas M. Antonopoulos( https://www.safaribooksonline.com/library/view/mastering-bitcoin/9781491902 639/ch04.html) ● Bitcoin: A Peer-to-Peer Electronic Cash System (https://bitcoin.org/bitcoin.pdf) ● The Blockchain - The Technology behind Bitcoin(https://www.slideshare.net/JrmeKehrli/the-blockchain-the-technology- behind-bitcoin) ● BITCOIN FORENSICS : Bsides Delhi Conference( https://www.slideshare.net/anupriti/bitcoin-forensics-bsides-delhi-conference?l ipi=urn%3Ali%3Apage%3Ad_flagship3_messaging%3BFtHteO%2BdRZO%2 F9vnZeXHAgg%3D%3D)