SlideShare a Scribd company logo
Leganés
6 Febrero 2013

Alberto Gómez Toribio ( @gotoalberto )

Bitcoin protocol for developers

Except where otherwise noted, this work is licensed under: http://creativecommons.org/licenses/by-nc-sa/3.0/

c_b_n_a
Coinffeine.com

Leganés
6 Febrero 2013

Alberto Gómez

@gotoalberto

“OpenData and Bitcoin Developer on fire.
Great coders are today’s rock stars. That’s it!”

Alvaro Polo

@apolovald

“Software development enthusiast and aviation geek. Give me a
higher-order function and I shall move the world.”

A P2P Bitcoin exchange

Sebastián Ortega @_sortega
“Vocational coder since childhood, he will annoy you with concepts
like "monad" and "actor model" but gets the work done.”

Ximo Guanter
“Theoretical computer science believer by night, pragmatic ship-it developer by day.
My brain runs on glucose, caffeine, general abstract nonsense and type theory.”

Except where otherwise noted, this work is licensed under: http://creativecommons.org/licenses/by-nc-sa/3.0/

c_b_n_a
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

What is the Bitcoin Protocol?
● Network protocol
○ Blockchain mining
○ Fees and commitment rules
○ Sharing protocol: Gossip, Bittorrent, Gnutella...

● Transactions Mechanics
○ Validations of the money source
○ Protocol to spend the money
○ Bitcoin Scripting
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

Network protocol
● Blockchain
○ The Blockchain is a distributed ledger book

○ Create a Block in chain require a proof of work
dc7047be… = SHA256(new_block_hash)

○ Forks are discarded, the most complex chain wins.
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

Network protocol
● Other services:
○ The Blockchain is used to storage
usernames.
○ Tweets are shared between users using a DHT protocol.
○ The older messages are discarded.
○ Incentive to generate blocks on Blockchain:
Sponsored messages.
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

Network protocol
● Colored Coins:
○ The Blockchain is used to storage key-value strings,
as internet web domains / IP.
○ You can register a domain spending Namecoins.
○ The fee by register a name is decreased in time.
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

Transactions Mechanic
● Transaction anatomy
{

txid
: 5c084b… ,
locktime : 0,
vin
: [
{
txid
vout
scriptSig

:
:
{

feff4b…
0
asm : d8f67a…

…}
…}
vout

…]
: [
{
value
reqsigs
scriptPubKey

:
:
{

2.52
1
asm : OP_DUP OP_HASH160 cb1f48…
OP_EQUALSVERIFY OP_CHECKSIG

addresses
…}
…]
…}

…}
:

[ 172D5w7C… ]
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

Transactions Mechanic
● Transaction anatomy
{

txid
: 5c084b… ,
locktime : 0,
vin
: [
{

Transaction Id, changes when a field is changed or tx is signed.

txid
vout
scriptSig

:
:
{

feff4b…
0
asm : d8f67a…

…}
…}
vout

…]
: [
{
value
reqsigs
scriptPubKey

:
:
{

2.52
1
asm : OP_DUP OP_HASH160 cb1f48…
OP_EQUALSVERIFY OP_CHECKSIG

addresses
…}
…]
…}

…}
:

[ 172D5w7C… ]
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

Transactions Mechanic
● Transaction anatomy
{

txid
: 5c084b… ,
locktime : 0,
Locktime, Block or Time up to which this tx cannot be broadcasted.
vin
: [
{
txid
: feff4b…
vout
: 0
scriptSig
{
asm : d8f67a…
…}
…}
…]
vout
: [
{
value
: 2.52
reqsigs
: 1
scriptPubKey {
asm : OP_DUP OP_HASH160 cb1f48…
OP_EQUALSVERIFY OP_CHECKSIG
…}
addresses
: [ 172D5w7C… ]
…}
…]
…}
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

Transactions Mechanic
● Transaction anatomy
{

txid
: 5c084b… ,
locktime : 0,
vin
: [
{
txid
vout
scriptSig

:
:
{

feff4b…
0

TXid reference output for this input.

asm : d8f67a…
…}
…}
vout

…]
: [
{
value
reqsigs
scriptPubKey

:
:
{

2.52
1
asm : OP_DUP OP_HASH160 cb1f48…
OP_EQUALSVERIFY OP_CHECKSIG

addresses
…}
…]
…}

…}
:

[ 172D5w7C… ]
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

Transactions Mechanic
● Transaction anatomy
{

txid
: 5c084b… ,
locktime : 0,
vin
: [
{
txid
vout
scriptSig

:
:
{

feff4b…
0

Output number reference in previous tx

asm : d8f67a…
…}
…}
vout

…]
: [
{
value
reqsigs
scriptPubKey

:
:
{

2.52
1
asm : OP_DUP OP_HASH160 cb1f48…
OP_EQUALSVERIFY OP_CHECKSIG

addresses
…}
…]
…}

…}
:

[ 172D5w7C… ]
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

Transactions Mechanic
● Transaction anatomy
{

txid
: 5c084b… ,
locktime : 0,
vin
: [
{
txid
vout
scriptSig

:
:
{

feff4b…
0
asm : d8f67a…

…}

ScriptSig which unlock the
connected OutputScript

…}
vout

…]
: [
{
value
reqsigs
scriptPubKey

:
:
{

2.52
1
asm : OP_DUP OP_HASH160 cb1f48…
OP_EQUALSVERIFY OP_CHECKSIG

addresses
…}
…]
…}

…}
:

[ 172D5w7C… ]
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

Transactions Mechanic
● Transaction anatomy
{

txid
: 5c084b… ,
locktime : 0,
vin
: [
{
txid
vout
scriptSig

:
:
{

feff4b…
0
asm : d8f67a…

…}
…}
vout

…]
: [
{
value
reqsigs
scriptPubKey

:
:
{

2.52
1

Value to transfer. The difference with the
summatory of inputs values is the fee.

asm : OP_DUP OP_HASH160 cb1f48…
OP_EQUALSVERIFY OP_CHECKSIG
addresses
…}
…]
…}

…}
:

[ 172D5w7C… ]
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

Transactions Mechanic
● Transaction anatomy
{

txid
: 5c084b… ,
locktime : 0,
vin
: [
{
txid
vout
scriptSig

:
:
{

feff4b…
0
asm : d8f67a…

…}
…}
vout

…]
: [
{
value
reqsigs
scriptPubKey

addresses
…}
…]
…}

:
:
{

…}
:

Number of sigs required to broadcast this
transaction. The signers are included in the
“addresses” array.
asm : OP_DUP OP_HASH160 cb1f48…
OP_EQUALSVERIFY OP_CHECKSIG
2.52
1

[ 172D5w7C… ]
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

Transactions Mechanic
● Transaction anatomy
{

txid
: 5c084b… ,
locktime : 0,
vin
: [
{
txid
vout
scriptSig

:
:
{

feff4b…
0
asm : d8f67a…

…}
…}
vout

…]
: [
{

…}
…]
…}

Script. It defines how the money can be spent and by whom.
value
: 2.52
reqsigs
: 1
scriptPubKey {
asm : OP_DUP OP_HASH160 cb1f48…
OP_EQUALSVERIFY OP_CHECKSIG
…}
addresses
: [ 172D5w7C… ]
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

Transactions Mechanic
● Transaction anatomy
{

txid
: 5c084b… ,
locktime : 0,
vin
: [
{
txid
vout
scriptSig

:
:
{

feff4b…
0
asm : d8f67a…

…}
…}
vout

…]
: [
{
value
reqsigs
scriptPubKey

:
:
{

2.52
1
asm : OP_DUP OP_HASH160 cb1f48…
OP_EQUALSVERIFY OP_CHECKSIG

addresses
…}
…]
…}

…}
:

[ 172D5w7C… ]
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

Bitcoin Script
● It Allows to define how an output will be spent
and by whom.
● Is a non Turing-Complete language which is
evaluated as a Stack, from left to right.
● It just allows to write pure functions
(without context)
● Is a non Turing-Complete language which is
evaluated with a stack machine.
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

How Bitcoin Script works?
(Public Key Hash)

OP_DUP OP_HASH160 cb1f48…

OP_EQUALVERIFY OP_CHECKSIG
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

How Bitcoin Script works?
(Signature)

(Public Key)

bbba3f5… 172D5w7C…

(Public Key Hash)

OP_DUP OP_HASH160 cb1f48…

OP_EQUALVERIFY OP_CHECKSIG
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

How Bitcoin Script works?
(Signature)

(Public Key)

bbba3f5… 172D5w7C…

(Public Key Hash)

OP_DUP OP_HASH160 cb1f48…

Stack

OP_EQUALVERIFY OP_CHECKSIG
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

How Bitcoin Script works?
(Signature)

(Public Key)

bbba3f5… 172D5w7C…

(Public Key Hash)

OP_DUP OP_HASH160 cb1f48…

Stack

OP_EQUALVERIFY OP_CHECKSIG
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

How Bitcoin Script works?
(Public Key)

(Public Key Hash)

172D5w7C…

OP_DUP OP_HASH160 cb1f48…

Stack
(Signature)

bbba3f5…

OP_EQUALVERIFY OP_CHECKSIG
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

How Bitcoin Script works?
(Public Key)

(Public Key Hash)

172D5w7C…

OP_DUP OP_HASH160 cb1f48…

Stack
(Signature)

bbba3f5…

OP_EQUALVERIFY OP_CHECKSIG
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

How Bitcoin Script works?
(Public Key Hash)

OP_DUP OP_HASH160 cb1f48…

Stack
(Public Key)
(Signature)

172D5w7C…
bbba3f5…

OP_EQUALVERIFY OP_CHECKSIG
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

How Bitcoin Script works?
(Public Key Hash)

OP_DUP OP_HASH160 cb1f48…

Stack
(Public Key)
(Signature)

172D5w7C…
bbba3f5…

OP_EQUALVERIFY OP_CHECKSIG
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

How Bitcoin Script works?
(Public Key Hash)

OP_HASH160 cb1f48…

Stack
(Public Key)
(Public Key)
(Signature)

172D5w7C…
172D5w7C…
bbba3f5…

OP_EQUALVERIFY OP_CHECKSIG
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

How Bitcoin Script works?
(Public Key Hash)

OP_HASH160 cb1f48…

Stack
(Public Key)
(Public Key)
(Signature)

172D5w7C…
172D5w7C…
bbba3f5…

OP_EQUALVERIFY OP_CHECKSIG
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

How Bitcoin Script works?
(Public Key Hash)

cb1f48…

Stack
(Public Key Hash)
(Public Key)
(Signature)

cb1f48…
172D5w7C…
bbba3f5…

OP_EQUALVERIFY OP_CHECKSIG
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

How Bitcoin Script works?
(Public Key Hash)

cb1f48…

Stack
(Public Key Hash)
(Public Key)
(Signature)

cb1f48…
172D5w7C…
bbba3f5…

OP_EQUALVERIFY OP_CHECKSIG
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

How Bitcoin Script works?
OP_EQUALVERIFY OP_CHECKSIG

Stack
(Public Key Hash)
(Public Key Hash)
(Public Key)
(Signature)

cb1f48…
cb1f48…
172D5w7C…
bbba3f5…
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

How Bitcoin Script works?
OP_EQUALVERIFY OP_CHECKSIG

Stack
(Public Key Hash)
(Public Key Hash)
(Public Key)
(Signature)

cb1f48…
cb1f48…
172D5w7C…
bbba3f5…
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

How Bitcoin Script works?
OP_CHECKSIG

Stack
(Public Key)
(Signature)

172D5w7C…
bbba3f5…
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

How Bitcoin Script works?
OP_CHECKSIG

Stack
(Public Key)
(Signature)

172D5w7C…
bbba3f5…
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

How Bitcoin Script works?
(EMPTY)

Stack
(EMPTY)

SUCCESS!

#BitcoinT3F
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

The sky is the limit! (Odd/Even Bet)
<Sig> <PubKeyB> <7bb> <5aa> OP_2DUP OP_HASH160 <aHash> OP_EQUALVERIFY OP_SWAP
OP_HASH160 <bHash> OP_EQUALVERIFY <1> OP_LEFT OP_SWAP <1> OP_LEFT OP_ADD <2>
OP_SWAP OP_MOD
OP_IF
OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ELSE
OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ENDIF
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

The sky is the limit! (Odd/Even Bet)
<Sig> <PubKeyB> <7bb> <5aa> OP_2DUP OP_HASH160 <aHash> OP_EQUALVERIFY OP_SWAP
OP_HASH160 <bHash> OP_EQUALVERIFY <1> OP_LEFT OP_SWAP <1> OP_LEFT OP_ADD <2>
OP_SWAP OP_MOD
OP_IF
OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ELSE
OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ENDIF

Random
diversion!

@_sortega
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

The sky is the limit! (Odd/Even Bet)
<Sig> <PubKeyB> <7bb> <5aa> OP_2DUP OP_HASH160 <aHash> OP_EQUALVERIFY OP_SWAP
OP_HASH160 <bHash> OP_EQUALVERIFY <1> OP_LEFT OP_SWAP <1> OP_LEFT OP_ADD <2>
OP_SWAP OP_MOD
OP_IF
OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ELSE
OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ENDIF

Stack
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

The sky is the limit! (Odd/Even Bet)
<PubKeyB> <7bb> <5aa> OP_2DUP OP_HASH160 <aHash> OP_EQUALVERIFY OP_SWAP
OP_HASH160 <bHash> OP_EQUALVERIFY <1> OP_LEFT OP_SWAP <1> OP_LEFT OP_ADD <2>
OP_SWAP OP_MOD
OP_IF
OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ELSE
OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ENDIF

Stack
<Sig>
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

The sky is the limit! (Odd/Even Bet)
<7bb> <5aa> OP_2DUP OP_HASH160 <aHash> OP_EQUALVERIFY OP_SWAP
OP_HASH160 <bHash> OP_EQUALVERIFY <1> OP_LEFT OP_SWAP <1> OP_LEFT OP_ADD <2>
OP_SWAP OP_MOD
OP_IF
OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ELSE
OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ENDIF

Stack
<PubKey>
<Sig>
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

The sky is the limit! (Odd/Even Bet)
<5aa> OP_2DUP OP_HASH160 <aHash> OP_EQUALVERIFY OP_SWAP
OP_HASH160 <bHash> OP_EQUALVERIFY <1> OP_LEFT OP_SWAP <1> OP_LEFT OP_ADD <2>
OP_SWAP OP_MOD
OP_IF
OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ELSE
OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ENDIF

Stack
<7bb>
<PubKey>
<Sig>
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

The sky is the limit! (Odd/Even Bet)
OP_2DUP OP_HASH160 <aHash> OP_EQUALVERIFY OP_SWAP
OP_HASH160 <bHash> OP_EQUALVERIFY <1> OP_LEFT OP_SWAP <1> OP_LEFT OP_ADD <2>
OP_SWAP OP_MOD
OP_IF
OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ELSE
OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ENDIF

Stack
<5aa>
<7bb>
<PubKeyB>
<Sig>
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

The sky is the limit! (Odd/Even Bet)
OP_HASH160 <aHash> OP_EQUALVERIFY OP_SWAP
OP_HASH160 <bHash> OP_EQUALVERIFY <1> OP_LEFT OP_SWAP <1> OP_LEFT OP_ADD <2>
OP_SWAP OP_MOD
OP_IF
OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ELSE
OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ENDIF

Stack
<5aa>
<7bb>
<5aa>
<7bb>
<PubKeyB>
<Sig>
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

The sky is the limit! (Odd/Even Bet)
<aHash> OP_EQUALVERIFY OP_SWAP
OP_HASH160 <bHash> OP_EQUALVERIFY <1> OP_LEFT OP_SWAP <1> OP_LEFT OP_ADD <2>
OP_SWAP OP_MOD
OP_IF
OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ELSE
OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ENDIF

Stack
<aHash>
<7bb>
<5aa>
<7bb>
<PubKeyB>
<Sig>
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

The sky is the limit! (Odd/Even Bet)
OP_EQUALVERIFY OP_SWAP
OP_HASH160 <bHash> OP_EQUALVERIFY <1> OP_LEFT OP_SWAP <1> OP_LEFT OP_ADD <2>
OP_SWAP OP_MOD
OP_IF
OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ELSE
OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ENDIF

Stack
<aHash>
<aHash>
<5aa>
<7bb>
<7bb>
<PubKeyB>
<Sig>
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

The sky is the limit! (Odd/Even Bet)
OP_SWAP
OP_HASH160 <bHash> OP_EQUALVERIFY <1> OP_LEFT OP_SWAP <1> OP_LEFT OP_ADD <2>
OP_SWAP OP_MOD
OP_IF
OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ELSE
OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ENDIF

Stack
<5aa>
<7bb>
<7bb>
<PubKeyB>
<Sig>
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

The sky is the limit! (Odd/Even Bet)
OP_HASH160 <bHash> OP_EQUALVERIFY <1> OP_LEFT OP_SWAP <1> OP_LEFT OP_ADD <2>
OP_SWAP OP_MOD
OP_IF
OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ELSE
OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ENDIF

Stack
<7bb>
<5aa>
<7bb>
<PubKeyB>
<Sig>
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

The sky is the limit! (Odd/Even Bet)
<bHash> OP_EQUALVERIFY <1> OP_LEFT OP_SWAP <1> OP_LEFT OP_ADD <2>
OP_SWAP OP_MOD
OP_IF
OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ELSE
OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ENDIF

Stack
<bHash>
<5aa>
<7bb>
<PubKeyB>
<Sig>
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

The sky is the limit! (Odd/Even Bet)
OP_EQUALVERIFY <1> OP_LEFT OP_SWAP <1> OP_LEFT OP_ADD <2>
OP_SWAP OP_MOD
OP_IF
OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ELSE
OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ENDIF

Stack
<bHash>
<bHash>
<5aa>
<7bb>
<PubKeyB>
<Sig>
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

The sky is the limit! (Odd/Even Bet)
<1> OP_LEFT OP_SWAP <1> OP_LEFT OP_ADD <2>
OP_SWAP OP_MOD
OP_IF
OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ELSE
OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ENDIF

Stack
<5aa>
<7bb>
<PubKeyB>
<Sig>
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

The sky is the limit! (Odd/Even Bet)
OP_LEFT OP_SWAP <1> OP_LEFT OP_ADD <2>
OP_SWAP OP_MOD
OP_IF
OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ELSE
OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ENDIF

Stack
<1>
<5aa>
<7bb>
<PubKeyB>
<Sig>
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

The sky is the limit! (Odd/Even Bet)
OP_SWAP <1> OP_LEFT OP_ADD <2>
OP_SWAP OP_MOD
OP_IF
OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ELSE
OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ENDIF

Stack
<5>
<7bb>
<PubKeyB>
<Sig>
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

The sky is the limit! (Odd/Even Bet)
<1> OP_LEFT OP_ADD <2>
OP_SWAP OP_MOD
OP_IF
OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ELSE
OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ENDIF

Stack
<7bb>
<5>
<PubKeyB>
<Sig>
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

The sky is the limit! (Odd/Even Bet)
OP_LEFT OP_ADD <2>
OP_SWAP OP_MOD
OP_IF
OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ELSE
OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ENDIF

Stack
<1>
<7bb>
<5>
<PubKeyB>
<Sig>
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

The sky is the limit! (Odd/Even Bet)
OP_ADD <2>
OP_SWAP OP_MOD
OP_IF
OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ELSE
OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ENDIF

Stack
<7>
<5>
<PubKeyB>
<Sig>
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

The sky is the limit! (Odd/Even Bet)
<2>
OP_SWAP OP_MOD
OP_IF
OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ELSE
OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ENDIF

Stack
<12>
<PubKeyB>
<Sig>
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

The sky is the limit! (Odd/Even Bet)
OP_SWAP OP_MOD
OP_IF
OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ELSE
OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ENDIF

Stack
<2>
<12>
<PubKeyB>
<Sig>

#BitcoinT3F
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

The sky is the limit! (Odd/Even Bet)
OP_MOD
OP_IF
OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ELSE
OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ENDIF

Stack
<12>
<2>
<PubKeyB>
<Sig>

#BitcoinT3F
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

The sky is the limit! (Odd/Even Bet)
OP_IF
OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ELSE
OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ENDIF

Stack
<0>
<PubKeyB>
<Sig>

#BitcoinT3F
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

The sky is the limit! (Odd/Even Bet)

OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG

Stack
<PubKeyB>
<Sig>

(Standard Script)

#BitcoinT3F
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

The sky is the limit! (Odd/Even Bet)
● Possible real use:
○ Random user to pay the transaction fees.
○ Help to define asymmetric scenario (secrets)

#BitcoinT3F
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

Context: Oracles
● The oracle contract allow define how the money
is spent including external state.
○ Allows to make reversible transactions.
○ Allow to pay, only if an external condition is true, for
example the result of a search in google, or the API SEUR
response.
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

Context: Oracles
● Example of a reversible payment using a Oracle
○ First you generate (in private) a multisig transaction as
this:
TX1
in { 1 BTC BOB }
out { 1 BTC MULTISIGVERIFY BOB SAM }

○ Then you must obtain signed from counterpart:
TX2
in { TX1[0] }
out { 1 BTC

TX3
in { TX1[0] }
out { 1 BTC

<SeurAPI(trackID) == ‘RETURNED’>
OP_HASH160 <ExternalScriptHash> OP_EQUALSVERIFY
<OraclePubKey> <SamPubKey> 2 OP_CHECKMULTISIGVERIFY }

<SeurAPI(trackID) == ‘DELIVERED’>
OP_HASH160 <ExternalScriptHash> OP_EQUALSVERIFY
<OraclePubKey> <BobPubKey> 2 OP_CHECKMULTISIGVERIFY }
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

Context: Oracles
● Execution
TX2
in { TX1[0] }
out { 1 BTC
<SeurAPI(trackID) == ‘RETURNED’>
OP_HASH160 <ExternalScriptHash>
OP_EQUALSVERIFY
<OraclePubKey> <SamPubKey> 2
OP_CHECKMULTISIGVERIFY }

#BitcoinT3F
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

Context: Oracles
● Execution
<OracleSig> <SamSig> <SeurAPI(trackID) == ‘RETURNED’>
OP_HASH160 <ExternalScriptHash> OP_EQUALSVERIFY
<OraclePubKey> <SamPubKey> 2 OP_CHECKMULTISIGVERIFY

Stack
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

Context: Oracles
● Execution
<SamSig> <SeurAPI(trackID) == ‘RETURNED’>
OP_HASH160 <ExternalScriptHash> OP_EQUALSVERIFY
<OraclePubKey> <SamPubKey> 2 OP_CHECKMULTISIGVERIFY

Stack
<OracleSig>
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

Context: Oracles
● Execution
<SeurAPI(trackID) == ‘RETURNED’>
OP_HASH160 <ExternalScriptHash> OP_EQUALSVERIFY
<OraclePubKey> <SamPubKey> 2 OP_CHECKMULTISIGVERIFY

Stack
<SamSig>
<OracleSig>
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

Context: Oracles
● Execution

OP_HASH160 <ExternalScriptHash> OP_EQUALSVERIFY
<OraclePubKey> <SamPubKey> 2 OP_CHECKMULTISIGVERIFY

Stack
<SeurAPI(trackID) == ‘RETURNED’>
<SamSig>
<OracleSig>

#BitcoinT3F
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

Context: Oracles
● Execution

<ExternalScriptHash> OP_EQUALSVERIFY
<OraclePubKey> <SamPubKey> 2 OP_CHECKMULTISIGVERIFY

Stack
<ScriptHash>
<SamSig>
<OacleSig>

#BitcoinT3F
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

Context: Oracles
● Execution

OP_EQUALSVERIFY
<OraclePubKey> <SamPubKey> 2 OP_CHECKMULTISIGVERIFY

Stack
<ExternalScriptHash>
<ScriptHash>
<SamSig>
<OracleSig>

#BitcoinT3F
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

Context: Oracles
● Execution

<OraclePubKey> <SamPubKey> 2 OP_CHECKMULTISIGVERIFY

Stack
<SamSig>
<OracleSig>

#BitcoinT3F
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

Context: Oracles
● Execution

SUCCESS!

Stack

#BitcoinT3F
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

Fees? Micro Payment Channels!
● Transactions from a checkpoint without
broadcast
● Allows commit money safely
● Allows to pay on demand by the second
● For example: decentralized WiFi Hotspots or
subcontracting services in third world countries.
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

Micro Payment Channels Mechanic
TX1
IN {0: 1 BTC
}
OUT {0: 1 BTC MULTISIG BOB SAM }

#BitcoinT3F
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

Micro Payment Channels Mechanic
TX1
IN {0: 1 BTC
}
OUT {0: 1 BTC MULTISIG BOB SAM }

TX2
IN {TX1[0]: 1 BTC
}
OUT {
0 : 1 BTC BOB }
LOCKTIME : 18

#BitcoinT3F
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

Micro Payment Channels Mechanic
TX1
IN {0: 1 BTC
}
OUT {0: 1 BTC MULTISIG BOB SAM }

TX2
IN {TX1[0]: 1 BTC
}
OUT {
0 : 1 BTC BOB }
LOCKTIME : 18

#BitcoinT3F
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

Micro Payment Channels Mechanic
TX1
IN {0: 1 BTC
}
OUT {0: 1 BTC MULTISIG BOB SAM }

TX2
IN {TX1[0]: 1 BTC
}
OUT {
0 : 1 BTC BOB }
LOCKTIME : 18

#BitcoinT3F
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

Micro Payment Channels Mechanic
TX1
IN {0: 1 BTC
}
OUT {0: 1 BTC MULTISIG BOB SAM }

TX2
IN {TX1[0]: 1 BTC
}
OUT {
0 : 1 BTC BOB }
LOCKTIME : 18

IN {TX1[0] 1 BTC
}
OUT {0: 0,9 BTC BOB
0,1 BTC SAM }
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

Micro Payment Channels Mechanic
TX1
IN {0: 1 BTC
}
OUT {0: 1 BTC MULTISIG BOB SAM }

TX2
IN {TX1[0]: 1 BTC
}
OUT {
0 : 1 BTC BOB }
LOCKTIME : 18

IN {TX1[0] 1 BTC
}
OUT {0: 0,8 BTC BOB
0,2 BTC SAM }
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

Micro Payment Channels Mechanic
TX1
IN {0: 1 BTC
}
OUT {0: 1 BTC MULTISIG BOB SAM }

TX2
IN {TX1[0]: 1 BTC
}
OUT {
0 : 1 BTC BOB }
LOCKTIME : 18

IN {TX1[0] 1 BTC
}
OUT {0: 0,7 BTC BOB
0,3 BTC SAM }
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

Micro Payment Channels Mechanic
TX1
IN {0: 1 BTC
}
OUT {0: 1 BTC MULTISIG BOB SAM }

IN {TX1[0] 1 BTC
}
OUT {0: 0,6 BTC BOB
0,4 BTC SAM }

TX2
IN {TX1[0]: 1 BTC
}
OUT {
0 : 1 BTC BOB }
LOCKTIME : 18

BREAK!
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

Micro Payment Channels Mechanic
TX1
IN {0: 1 BTC
}
OUT {0: 1 BTC MULTISIG BOB SAM }

TX2
IN {TX1[0]: 1 BTC
}
OUT {
0 : 1 BTC BOB }
LOCKTIME : 18

IN {TX1[0] 1 BTC
}
OUT {0: 0,6 BTC BOB
0,4 BTC SAM }
Leganés
6 Febrero 2013

Bitcoin Protocol for Developers

#BitcoinT3F

THANKS!
● BigData is the current wave, P2P is the next.
● APIs and P2P are the next challenge on finantial world.
● Bitcoin technology and protocol is here to stay.

More Related Content

What's hot

Presentation_Topalidis_Giorgos
Presentation_Topalidis_GiorgosPresentation_Topalidis_Giorgos
Presentation_Topalidis_GiorgosGiorgos Topalidis
 
Switcheo Network - Advanced NEO Smart Contracts
Switcheo Network - Advanced NEO Smart ContractsSwitcheo Network - Advanced NEO Smart Contracts
Switcheo Network - Advanced NEO Smart Contracts
Switcheo
 
Proof-of-Stake & Its Improvements (San Francisco Bitcoin Devs Hackathon)
Proof-of-Stake & Its Improvements (San Francisco Bitcoin Devs Hackathon)Proof-of-Stake & Its Improvements (San Francisco Bitcoin Devs Hackathon)
Proof-of-Stake & Its Improvements (San Francisco Bitcoin Devs Hackathon)
Alex Chepurnoy
 
Bitcoin Wallet &amp Keys
Bitcoin Wallet &amp KeysBitcoin Wallet &amp Keys
Bitcoin Wallet &amp Keys
Shun Shiku
 
The day I ruled the world (RootedCON 2020)
The day I ruled the world (RootedCON 2020)The day I ruled the world (RootedCON 2020)
The day I ruled the world (RootedCON 2020)
Javier Junquera
 
Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)
Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)
Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)
Zvi Avraham
 
Scorex meetup-aug-2015
Scorex meetup-aug-2015Scorex meetup-aug-2015
Scorex meetup-aug-2015
Alex Chepurnoy
 
Cryptographic algorithms diversity: Russian (GOST) crypto algorithms
Cryptographic algorithms diversity: Russian (GOST) crypto algorithmsCryptographic algorithms diversity: Russian (GOST) crypto algorithms
Cryptographic algorithms diversity: Russian (GOST) crypto algorithms
Dmitry Baryshkov
 
Blockchain Cryptography for Developers (Nakov @ BGWebSummit 2018)
Blockchain Cryptography for Developers (Nakov @ BGWebSummit 2018)Blockchain Cryptography for Developers (Nakov @ BGWebSummit 2018)
Blockchain Cryptography for Developers (Nakov @ BGWebSummit 2018)
Svetlin Nakov
 
Crypto Wallets: A Technical Perspective (Nakov at OpenFest 2018)
Crypto Wallets: A Technical Perspective (Nakov at OpenFest 2018)Crypto Wallets: A Technical Perspective (Nakov at OpenFest 2018)
Crypto Wallets: A Technical Perspective (Nakov at OpenFest 2018)
Svetlin Nakov
 
Ethereum Smart Contracts on Hyperledger Fabric
Ethereum Smart Contracts on Hyperledger Fabric Ethereum Smart Contracts on Hyperledger Fabric
Ethereum Smart Contracts on Hyperledger Fabric
Horea Porutiu
 
POD2::* and Perl translation documentation project
POD2::* and Perl translation documentation projectPOD2::* and Perl translation documentation project
POD2::* and Perl translation documentation project
Enrico Sorcinelli
 
Segregated witness and bitcoin scaling debate
Segregated witness and bitcoin scaling debateSegregated witness and bitcoin scaling debate
Segregated witness and bitcoin scaling debate
dalcanto
 
Technology of Lightning Network in Tel Aviv, Israel
Technology of Lightning Network in Tel Aviv, IsraelTechnology of Lightning Network in Tel Aviv, Israel
Technology of Lightning Network in Tel Aviv, Israel
takayaimai
 
“Technical Intro to Blockhain” by Yurijs Pimenovs from Paybis at CryptoCurren...
“Technical Intro to Blockhain” by Yurijs Pimenovs from Paybis at CryptoCurren...“Technical Intro to Blockhain” by Yurijs Pimenovs from Paybis at CryptoCurren...
“Technical Intro to Blockhain” by Yurijs Pimenovs from Paybis at CryptoCurren...
Dace Barone
 
Programming Decentralized Application
Programming Decentralized ApplicationProgramming Decentralized Application
Programming Decentralized Application
Bambang Purnomosidi D. P.
 
Bitcoin Keys, Addresses & Wallets
Bitcoin Keys, Addresses & WalletsBitcoin Keys, Addresses & Wallets
Bitcoin Keys, Addresses & Wallets
Christopher Allen
 
Cryptography for Absolute Beginners (May 2019)
Cryptography for Absolute Beginners (May 2019)Cryptography for Absolute Beginners (May 2019)
Cryptography for Absolute Beginners (May 2019)
Svetlin Nakov
 

What's hot (18)

Presentation_Topalidis_Giorgos
Presentation_Topalidis_GiorgosPresentation_Topalidis_Giorgos
Presentation_Topalidis_Giorgos
 
Switcheo Network - Advanced NEO Smart Contracts
Switcheo Network - Advanced NEO Smart ContractsSwitcheo Network - Advanced NEO Smart Contracts
Switcheo Network - Advanced NEO Smart Contracts
 
Proof-of-Stake & Its Improvements (San Francisco Bitcoin Devs Hackathon)
Proof-of-Stake & Its Improvements (San Francisco Bitcoin Devs Hackathon)Proof-of-Stake & Its Improvements (San Francisco Bitcoin Devs Hackathon)
Proof-of-Stake & Its Improvements (San Francisco Bitcoin Devs Hackathon)
 
Bitcoin Wallet &amp Keys
Bitcoin Wallet &amp KeysBitcoin Wallet &amp Keys
Bitcoin Wallet &amp Keys
 
The day I ruled the world (RootedCON 2020)
The day I ruled the world (RootedCON 2020)The day I ruled the world (RootedCON 2020)
The day I ruled the world (RootedCON 2020)
 
Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)
Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)
Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)
 
Scorex meetup-aug-2015
Scorex meetup-aug-2015Scorex meetup-aug-2015
Scorex meetup-aug-2015
 
Cryptographic algorithms diversity: Russian (GOST) crypto algorithms
Cryptographic algorithms diversity: Russian (GOST) crypto algorithmsCryptographic algorithms diversity: Russian (GOST) crypto algorithms
Cryptographic algorithms diversity: Russian (GOST) crypto algorithms
 
Blockchain Cryptography for Developers (Nakov @ BGWebSummit 2018)
Blockchain Cryptography for Developers (Nakov @ BGWebSummit 2018)Blockchain Cryptography for Developers (Nakov @ BGWebSummit 2018)
Blockchain Cryptography for Developers (Nakov @ BGWebSummit 2018)
 
Crypto Wallets: A Technical Perspective (Nakov at OpenFest 2018)
Crypto Wallets: A Technical Perspective (Nakov at OpenFest 2018)Crypto Wallets: A Technical Perspective (Nakov at OpenFest 2018)
Crypto Wallets: A Technical Perspective (Nakov at OpenFest 2018)
 
Ethereum Smart Contracts on Hyperledger Fabric
Ethereum Smart Contracts on Hyperledger Fabric Ethereum Smart Contracts on Hyperledger Fabric
Ethereum Smart Contracts on Hyperledger Fabric
 
POD2::* and Perl translation documentation project
POD2::* and Perl translation documentation projectPOD2::* and Perl translation documentation project
POD2::* and Perl translation documentation project
 
Segregated witness and bitcoin scaling debate
Segregated witness and bitcoin scaling debateSegregated witness and bitcoin scaling debate
Segregated witness and bitcoin scaling debate
 
Technology of Lightning Network in Tel Aviv, Israel
Technology of Lightning Network in Tel Aviv, IsraelTechnology of Lightning Network in Tel Aviv, Israel
Technology of Lightning Network in Tel Aviv, Israel
 
“Technical Intro to Blockhain” by Yurijs Pimenovs from Paybis at CryptoCurren...
“Technical Intro to Blockhain” by Yurijs Pimenovs from Paybis at CryptoCurren...“Technical Intro to Blockhain” by Yurijs Pimenovs from Paybis at CryptoCurren...
“Technical Intro to Blockhain” by Yurijs Pimenovs from Paybis at CryptoCurren...
 
Programming Decentralized Application
Programming Decentralized ApplicationProgramming Decentralized Application
Programming Decentralized Application
 
Bitcoin Keys, Addresses & Wallets
Bitcoin Keys, Addresses & WalletsBitcoin Keys, Addresses & Wallets
Bitcoin Keys, Addresses & Wallets
 
Cryptography for Absolute Beginners (May 2019)
Cryptography for Absolute Beginners (May 2019)Cryptography for Absolute Beginners (May 2019)
Cryptography for Absolute Beginners (May 2019)
 

Similar to Bitcoin protocol for developerBitcoin Protocol for Developers

Blockchain Autopsies - Analyzing Ethereum Smart Contract Deaths
Blockchain Autopsies - Analyzing Ethereum Smart Contract DeathsBlockchain Autopsies - Analyzing Ethereum Smart Contract Deaths
Blockchain Autopsies - Analyzing Ethereum Smart Contract Deaths
Priyanka Aash
 
Bitcoin Blockchain - Under the Hood
Bitcoin Blockchain - Under the HoodBitcoin Blockchain - Under the Hood
Bitcoin Blockchain - Under the Hood
Galin Dinkov
 
“A bitcoin mining rig”
“A bitcoin mining rig”“A bitcoin mining rig”
“A bitcoin mining rig”
glitterlabs
 
Blockchain, cryptography and tokens — NYC Bar presentation
Blockchain, cryptography and tokens — NYC Bar presentationBlockchain, cryptography and tokens — NYC Bar presentation
Blockchain, cryptography and tokens — NYC Bar presentation
Paperchain
 
Blockchain For Developers (Talk at Innopolis Blockchain Hackathon 2016)
Blockchain For Developers (Talk at Innopolis Blockchain Hackathon 2016)Blockchain For Developers (Talk at Innopolis Blockchain Hackathon 2016)
Blockchain For Developers (Talk at Innopolis Blockchain Hackathon 2016)
Alex Chepurnoy
 
Crypto & Crpyocurrencies Intro
Crypto & Crpyocurrencies IntroCrypto & Crpyocurrencies Intro
Crypto & Crpyocurrencies Intro
Tal Shmueli
 
Best practices to build secure smart contracts
Best practices to build secure smart contractsBest practices to build secure smart contracts
Best practices to build secure smart contracts
Gautam Anand
 
growthbotics audit.pdf
growthbotics audit.pdfgrowthbotics audit.pdf
growthbotics audit.pdf
Wilson Kao
 
EthereumBlockchainMarch3 (1).pptx
EthereumBlockchainMarch3 (1).pptxEthereumBlockchainMarch3 (1).pptx
EthereumBlockchainMarch3 (1).pptx
WijdenBenothmen1
 
Angular v2 et plus : le futur du développement d'applications en entreprise
Angular v2 et plus : le futur du développement d'applications en entrepriseAngular v2 et plus : le futur du développement d'applications en entreprise
Angular v2 et plus : le futur du développement d'applications en entreprise
LINAGORA
 
KubeCon EU 2016 Keynote: Pushing Kubernetes Forward
KubeCon EU 2016 Keynote: Pushing Kubernetes ForwardKubeCon EU 2016 Keynote: Pushing Kubernetes Forward
KubeCon EU 2016 Keynote: Pushing Kubernetes Forward
KubeAcademy
 
Microservices in Scala - theory & practice
Microservices in Scala - theory & practiceMicroservices in Scala - theory & practice
Microservices in Scala - theory & practice
Łukasz Sowa
 
Blockchain Technology
Blockchain TechnologyBlockchain Technology
Blockchain Technology
Publicmediasolution
 
The slower the stronger a story of password hash migration
The slower the stronger  a story of password hash migrationThe slower the stronger  a story of password hash migration
The slower the stronger a story of password hash migration
OWASP
 
Graph Gurus Episode 13: Visualizing Bitcoin Blockchain with Tiger Graph
Graph Gurus Episode 13: Visualizing Bitcoin Blockchain with Tiger Graph  Graph Gurus Episode 13: Visualizing Bitcoin Blockchain with Tiger Graph
Graph Gurus Episode 13: Visualizing Bitcoin Blockchain with Tiger Graph
TigerGraph
 
Anonymity concerns of Bitcoin users
Anonymity concerns of Bitcoin usersAnonymity concerns of Bitcoin users
Anonymity concerns of Bitcoin users
Anil Gaihre
 
Eclipsecon Europe: Blockchain, Ethereum and Business Applications
Eclipsecon Europe: Blockchain, Ethereum and Business ApplicationsEclipsecon Europe: Blockchain, Ethereum and Business Applications
Eclipsecon Europe: Blockchain, Ethereum and Business Applications
Matthias Zimmermann
 
Simone Bronzini - Weaknesses of blockchain applications - Codemotion Milan 2018
Simone Bronzini - Weaknesses of blockchain applications - Codemotion Milan 2018Simone Bronzini - Weaknesses of blockchain applications - Codemotion Milan 2018
Simone Bronzini - Weaknesses of blockchain applications - Codemotion Milan 2018
Codemotion
 
Unsung heroes Validator & Infra provider.pdf
Unsung heroes Validator & Infra provider.pdfUnsung heroes Validator & Infra provider.pdf
Unsung heroes Validator & Infra provider.pdf
Jiyun Kim
 
Streaming Trend Discovery: Real-Time Discovery in a Sea of Events with Scott ...
Streaming Trend Discovery: Real-Time Discovery in a Sea of Events with Scott ...Streaming Trend Discovery: Real-Time Discovery in a Sea of Events with Scott ...
Streaming Trend Discovery: Real-Time Discovery in a Sea of Events with Scott ...
Databricks
 

Similar to Bitcoin protocol for developerBitcoin Protocol for Developers (20)

Blockchain Autopsies - Analyzing Ethereum Smart Contract Deaths
Blockchain Autopsies - Analyzing Ethereum Smart Contract DeathsBlockchain Autopsies - Analyzing Ethereum Smart Contract Deaths
Blockchain Autopsies - Analyzing Ethereum Smart Contract Deaths
 
Bitcoin Blockchain - Under the Hood
Bitcoin Blockchain - Under the HoodBitcoin Blockchain - Under the Hood
Bitcoin Blockchain - Under the Hood
 
“A bitcoin mining rig”
“A bitcoin mining rig”“A bitcoin mining rig”
“A bitcoin mining rig”
 
Blockchain, cryptography and tokens — NYC Bar presentation
Blockchain, cryptography and tokens — NYC Bar presentationBlockchain, cryptography and tokens — NYC Bar presentation
Blockchain, cryptography and tokens — NYC Bar presentation
 
Blockchain For Developers (Talk at Innopolis Blockchain Hackathon 2016)
Blockchain For Developers (Talk at Innopolis Blockchain Hackathon 2016)Blockchain For Developers (Talk at Innopolis Blockchain Hackathon 2016)
Blockchain For Developers (Talk at Innopolis Blockchain Hackathon 2016)
 
Crypto & Crpyocurrencies Intro
Crypto & Crpyocurrencies IntroCrypto & Crpyocurrencies Intro
Crypto & Crpyocurrencies Intro
 
Best practices to build secure smart contracts
Best practices to build secure smart contractsBest practices to build secure smart contracts
Best practices to build secure smart contracts
 
growthbotics audit.pdf
growthbotics audit.pdfgrowthbotics audit.pdf
growthbotics audit.pdf
 
EthereumBlockchainMarch3 (1).pptx
EthereumBlockchainMarch3 (1).pptxEthereumBlockchainMarch3 (1).pptx
EthereumBlockchainMarch3 (1).pptx
 
Angular v2 et plus : le futur du développement d'applications en entreprise
Angular v2 et plus : le futur du développement d'applications en entrepriseAngular v2 et plus : le futur du développement d'applications en entreprise
Angular v2 et plus : le futur du développement d'applications en entreprise
 
KubeCon EU 2016 Keynote: Pushing Kubernetes Forward
KubeCon EU 2016 Keynote: Pushing Kubernetes ForwardKubeCon EU 2016 Keynote: Pushing Kubernetes Forward
KubeCon EU 2016 Keynote: Pushing Kubernetes Forward
 
Microservices in Scala - theory & practice
Microservices in Scala - theory & practiceMicroservices in Scala - theory & practice
Microservices in Scala - theory & practice
 
Blockchain Technology
Blockchain TechnologyBlockchain Technology
Blockchain Technology
 
The slower the stronger a story of password hash migration
The slower the stronger  a story of password hash migrationThe slower the stronger  a story of password hash migration
The slower the stronger a story of password hash migration
 
Graph Gurus Episode 13: Visualizing Bitcoin Blockchain with Tiger Graph
Graph Gurus Episode 13: Visualizing Bitcoin Blockchain with Tiger Graph  Graph Gurus Episode 13: Visualizing Bitcoin Blockchain with Tiger Graph
Graph Gurus Episode 13: Visualizing Bitcoin Blockchain with Tiger Graph
 
Anonymity concerns of Bitcoin users
Anonymity concerns of Bitcoin usersAnonymity concerns of Bitcoin users
Anonymity concerns of Bitcoin users
 
Eclipsecon Europe: Blockchain, Ethereum and Business Applications
Eclipsecon Europe: Blockchain, Ethereum and Business ApplicationsEclipsecon Europe: Blockchain, Ethereum and Business Applications
Eclipsecon Europe: Blockchain, Ethereum and Business Applications
 
Simone Bronzini - Weaknesses of blockchain applications - Codemotion Milan 2018
Simone Bronzini - Weaknesses of blockchain applications - Codemotion Milan 2018Simone Bronzini - Weaknesses of blockchain applications - Codemotion Milan 2018
Simone Bronzini - Weaknesses of blockchain applications - Codemotion Milan 2018
 
Unsung heroes Validator & Infra provider.pdf
Unsung heroes Validator & Infra provider.pdfUnsung heroes Validator & Infra provider.pdf
Unsung heroes Validator & Infra provider.pdf
 
Streaming Trend Discovery: Real-Time Discovery in a Sea of Events with Scott ...
Streaming Trend Discovery: Real-Time Discovery in a Sea of Events with Scott ...Streaming Trend Discovery: Real-Time Discovery in a Sea of Events with Scott ...
Streaming Trend Discovery: Real-Time Discovery in a Sea of Events with Scott ...
 

More from Paradigma Digital

Ddd + ah + microservicios
Ddd + ah + microserviciosDdd + ah + microservicios
Ddd + ah + microservicios
Paradigma Digital
 
Bots 3.0: Dejando atrás los bots conversacionales con Dialogflow.
Bots 3.0: Dejando atrás los bots conversacionales con Dialogflow.Bots 3.0: Dejando atrás los bots conversacionales con Dialogflow.
Bots 3.0: Dejando atrás los bots conversacionales con Dialogflow.
Paradigma Digital
 
Have you met Istio?
Have you met Istio?Have you met Istio?
Have you met Istio?
Paradigma Digital
 
Linkerd a fondo
Linkerd a fondoLinkerd a fondo
Linkerd a fondo
Paradigma Digital
 
Horneando apis
Horneando apisHorneando apis
Horneando apis
Paradigma Digital
 
Java 8 time to join the future
Java 8  time to join the futureJava 8  time to join the future
Java 8 time to join the future
Paradigma Digital
 
Programación Reactiva con Spring WebFlux
Programación Reactiva con Spring WebFluxProgramación Reactiva con Spring WebFlux
Programación Reactiva con Spring WebFlux
Paradigma Digital
 
Orquestando microservicios como lo hace Netflix
Orquestando microservicios como lo hace NetflixOrquestando microservicios como lo hace Netflix
Orquestando microservicios como lo hace Netflix
Paradigma Digital
 
Meetup microservicios: API Management
Meetup microservicios: API ManagementMeetup microservicios: API Management
Meetup microservicios: API Management
Paradigma Digital
 
Meetup de kubernetes, conceptos básicos.
Meetup  de kubernetes, conceptos básicos.Meetup  de kubernetes, conceptos básicos.
Meetup de kubernetes, conceptos básicos.
Paradigma Digital
 
Docker, kubernetes, openshift y openstack, para mi abuela. techfest 2017.pptx
Docker, kubernetes, openshift y openstack, para mi abuela. techfest 2017.pptxDocker, kubernetes, openshift y openstack, para mi abuela. techfest 2017.pptx
Docker, kubernetes, openshift y openstack, para mi abuela. techfest 2017.pptx
Paradigma Digital
 
Implementando microservicios
Implementando microserviciosImplementando microservicios
Implementando microservicios
Paradigma Digital
 
Equipo de Marketing de Paradigma Digital
Equipo de Marketing de Paradigma DigitalEquipo de Marketing de Paradigma Digital
Equipo de Marketing de Paradigma Digital
Paradigma Digital
 
¿Cómo se despliega y autoescala Couchbase en Cloud? ¡Aprende de manera práctica!
¿Cómo se despliega y autoescala Couchbase en Cloud? ¡Aprende de manera práctica!¿Cómo se despliega y autoescala Couchbase en Cloud? ¡Aprende de manera práctica!
¿Cómo se despliega y autoescala Couchbase en Cloud? ¡Aprende de manera práctica!
Paradigma Digital
 
Overview atlas (1)
Overview atlas (1)Overview atlas (1)
Overview atlas (1)
Paradigma Digital
 
Cómo usar google analytics
Cómo usar google analyticsCómo usar google analytics
Cómo usar google analytics
Paradigma Digital
 
Transformación Digital
Transformación DigitalTransformación Digital
Transformación Digital
Paradigma Digital
 
Manuel Hurtado. Couchbase paradigma4oct
Manuel Hurtado. Couchbase paradigma4octManuel Hurtado. Couchbase paradigma4oct
Manuel Hurtado. Couchbase paradigma4oct
Paradigma Digital
 
Programación Reactiva con RxJava
Programación Reactiva con RxJavaProgramación Reactiva con RxJava
Programación Reactiva con RxJava
Paradigma Digital
 
¿Cómo vencer a los dragones digitales?
¿Cómo vencer a los dragones digitales?¿Cómo vencer a los dragones digitales?
¿Cómo vencer a los dragones digitales?
Paradigma Digital
 

More from Paradigma Digital (20)

Ddd + ah + microservicios
Ddd + ah + microserviciosDdd + ah + microservicios
Ddd + ah + microservicios
 
Bots 3.0: Dejando atrás los bots conversacionales con Dialogflow.
Bots 3.0: Dejando atrás los bots conversacionales con Dialogflow.Bots 3.0: Dejando atrás los bots conversacionales con Dialogflow.
Bots 3.0: Dejando atrás los bots conversacionales con Dialogflow.
 
Have you met Istio?
Have you met Istio?Have you met Istio?
Have you met Istio?
 
Linkerd a fondo
Linkerd a fondoLinkerd a fondo
Linkerd a fondo
 
Horneando apis
Horneando apisHorneando apis
Horneando apis
 
Java 8 time to join the future
Java 8  time to join the futureJava 8  time to join the future
Java 8 time to join the future
 
Programación Reactiva con Spring WebFlux
Programación Reactiva con Spring WebFluxProgramación Reactiva con Spring WebFlux
Programación Reactiva con Spring WebFlux
 
Orquestando microservicios como lo hace Netflix
Orquestando microservicios como lo hace NetflixOrquestando microservicios como lo hace Netflix
Orquestando microservicios como lo hace Netflix
 
Meetup microservicios: API Management
Meetup microservicios: API ManagementMeetup microservicios: API Management
Meetup microservicios: API Management
 
Meetup de kubernetes, conceptos básicos.
Meetup  de kubernetes, conceptos básicos.Meetup  de kubernetes, conceptos básicos.
Meetup de kubernetes, conceptos básicos.
 
Docker, kubernetes, openshift y openstack, para mi abuela. techfest 2017.pptx
Docker, kubernetes, openshift y openstack, para mi abuela. techfest 2017.pptxDocker, kubernetes, openshift y openstack, para mi abuela. techfest 2017.pptx
Docker, kubernetes, openshift y openstack, para mi abuela. techfest 2017.pptx
 
Implementando microservicios
Implementando microserviciosImplementando microservicios
Implementando microservicios
 
Equipo de Marketing de Paradigma Digital
Equipo de Marketing de Paradigma DigitalEquipo de Marketing de Paradigma Digital
Equipo de Marketing de Paradigma Digital
 
¿Cómo se despliega y autoescala Couchbase en Cloud? ¡Aprende de manera práctica!
¿Cómo se despliega y autoescala Couchbase en Cloud? ¡Aprende de manera práctica!¿Cómo se despliega y autoescala Couchbase en Cloud? ¡Aprende de manera práctica!
¿Cómo se despliega y autoescala Couchbase en Cloud? ¡Aprende de manera práctica!
 
Overview atlas (1)
Overview atlas (1)Overview atlas (1)
Overview atlas (1)
 
Cómo usar google analytics
Cómo usar google analyticsCómo usar google analytics
Cómo usar google analytics
 
Transformación Digital
Transformación DigitalTransformación Digital
Transformación Digital
 
Manuel Hurtado. Couchbase paradigma4oct
Manuel Hurtado. Couchbase paradigma4octManuel Hurtado. Couchbase paradigma4oct
Manuel Hurtado. Couchbase paradigma4oct
 
Programación Reactiva con RxJava
Programación Reactiva con RxJavaProgramación Reactiva con RxJava
Programación Reactiva con RxJava
 
¿Cómo vencer a los dragones digitales?
¿Cómo vencer a los dragones digitales?¿Cómo vencer a los dragones digitales?
¿Cómo vencer a los dragones digitales?
 

Recently uploaded

FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 

Recently uploaded (20)

FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 

Bitcoin protocol for developerBitcoin Protocol for Developers

  • 1. Leganés 6 Febrero 2013 Alberto Gómez Toribio ( @gotoalberto ) Bitcoin protocol for developers Except where otherwise noted, this work is licensed under: http://creativecommons.org/licenses/by-nc-sa/3.0/ c_b_n_a
  • 2. Coinffeine.com Leganés 6 Febrero 2013 Alberto Gómez @gotoalberto “OpenData and Bitcoin Developer on fire. Great coders are today’s rock stars. That’s it!” Alvaro Polo @apolovald “Software development enthusiast and aviation geek. Give me a higher-order function and I shall move the world.” A P2P Bitcoin exchange Sebastián Ortega @_sortega “Vocational coder since childhood, he will annoy you with concepts like "monad" and "actor model" but gets the work done.” Ximo Guanter “Theoretical computer science believer by night, pragmatic ship-it developer by day. My brain runs on glucose, caffeine, general abstract nonsense and type theory.” Except where otherwise noted, this work is licensed under: http://creativecommons.org/licenses/by-nc-sa/3.0/ c_b_n_a
  • 3. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F What is the Bitcoin Protocol? ● Network protocol ○ Blockchain mining ○ Fees and commitment rules ○ Sharing protocol: Gossip, Bittorrent, Gnutella... ● Transactions Mechanics ○ Validations of the money source ○ Protocol to spend the money ○ Bitcoin Scripting
  • 4. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F Network protocol ● Blockchain ○ The Blockchain is a distributed ledger book ○ Create a Block in chain require a proof of work dc7047be… = SHA256(new_block_hash) ○ Forks are discarded, the most complex chain wins.
  • 5. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F Network protocol ● Other services: ○ The Blockchain is used to storage usernames. ○ Tweets are shared between users using a DHT protocol. ○ The older messages are discarded. ○ Incentive to generate blocks on Blockchain: Sponsored messages.
  • 6. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F Network protocol ● Colored Coins: ○ The Blockchain is used to storage key-value strings, as internet web domains / IP. ○ You can register a domain spending Namecoins. ○ The fee by register a name is decreased in time.
  • 7. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F Transactions Mechanic ● Transaction anatomy { txid : 5c084b… , locktime : 0, vin : [ { txid vout scriptSig : : { feff4b… 0 asm : d8f67a… …} …} vout …] : [ { value reqsigs scriptPubKey : : { 2.52 1 asm : OP_DUP OP_HASH160 cb1f48… OP_EQUALSVERIFY OP_CHECKSIG addresses …} …] …} …} : [ 172D5w7C… ]
  • 8. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F Transactions Mechanic ● Transaction anatomy { txid : 5c084b… , locktime : 0, vin : [ { Transaction Id, changes when a field is changed or tx is signed. txid vout scriptSig : : { feff4b… 0 asm : d8f67a… …} …} vout …] : [ { value reqsigs scriptPubKey : : { 2.52 1 asm : OP_DUP OP_HASH160 cb1f48… OP_EQUALSVERIFY OP_CHECKSIG addresses …} …] …} …} : [ 172D5w7C… ]
  • 9. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F Transactions Mechanic ● Transaction anatomy { txid : 5c084b… , locktime : 0, Locktime, Block or Time up to which this tx cannot be broadcasted. vin : [ { txid : feff4b… vout : 0 scriptSig { asm : d8f67a… …} …} …] vout : [ { value : 2.52 reqsigs : 1 scriptPubKey { asm : OP_DUP OP_HASH160 cb1f48… OP_EQUALSVERIFY OP_CHECKSIG …} addresses : [ 172D5w7C… ] …} …] …}
  • 10. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F Transactions Mechanic ● Transaction anatomy { txid : 5c084b… , locktime : 0, vin : [ { txid vout scriptSig : : { feff4b… 0 TXid reference output for this input. asm : d8f67a… …} …} vout …] : [ { value reqsigs scriptPubKey : : { 2.52 1 asm : OP_DUP OP_HASH160 cb1f48… OP_EQUALSVERIFY OP_CHECKSIG addresses …} …] …} …} : [ 172D5w7C… ]
  • 11. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F Transactions Mechanic ● Transaction anatomy { txid : 5c084b… , locktime : 0, vin : [ { txid vout scriptSig : : { feff4b… 0 Output number reference in previous tx asm : d8f67a… …} …} vout …] : [ { value reqsigs scriptPubKey : : { 2.52 1 asm : OP_DUP OP_HASH160 cb1f48… OP_EQUALSVERIFY OP_CHECKSIG addresses …} …] …} …} : [ 172D5w7C… ]
  • 12. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F Transactions Mechanic ● Transaction anatomy { txid : 5c084b… , locktime : 0, vin : [ { txid vout scriptSig : : { feff4b… 0 asm : d8f67a… …} ScriptSig which unlock the connected OutputScript …} vout …] : [ { value reqsigs scriptPubKey : : { 2.52 1 asm : OP_DUP OP_HASH160 cb1f48… OP_EQUALSVERIFY OP_CHECKSIG addresses …} …] …} …} : [ 172D5w7C… ]
  • 13. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F Transactions Mechanic ● Transaction anatomy { txid : 5c084b… , locktime : 0, vin : [ { txid vout scriptSig : : { feff4b… 0 asm : d8f67a… …} …} vout …] : [ { value reqsigs scriptPubKey : : { 2.52 1 Value to transfer. The difference with the summatory of inputs values is the fee. asm : OP_DUP OP_HASH160 cb1f48… OP_EQUALSVERIFY OP_CHECKSIG addresses …} …] …} …} : [ 172D5w7C… ]
  • 14. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F Transactions Mechanic ● Transaction anatomy { txid : 5c084b… , locktime : 0, vin : [ { txid vout scriptSig : : { feff4b… 0 asm : d8f67a… …} …} vout …] : [ { value reqsigs scriptPubKey addresses …} …] …} : : { …} : Number of sigs required to broadcast this transaction. The signers are included in the “addresses” array. asm : OP_DUP OP_HASH160 cb1f48… OP_EQUALSVERIFY OP_CHECKSIG 2.52 1 [ 172D5w7C… ]
  • 15. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F Transactions Mechanic ● Transaction anatomy { txid : 5c084b… , locktime : 0, vin : [ { txid vout scriptSig : : { feff4b… 0 asm : d8f67a… …} …} vout …] : [ { …} …] …} Script. It defines how the money can be spent and by whom. value : 2.52 reqsigs : 1 scriptPubKey { asm : OP_DUP OP_HASH160 cb1f48… OP_EQUALSVERIFY OP_CHECKSIG …} addresses : [ 172D5w7C… ]
  • 16. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F Transactions Mechanic ● Transaction anatomy { txid : 5c084b… , locktime : 0, vin : [ { txid vout scriptSig : : { feff4b… 0 asm : d8f67a… …} …} vout …] : [ { value reqsigs scriptPubKey : : { 2.52 1 asm : OP_DUP OP_HASH160 cb1f48… OP_EQUALSVERIFY OP_CHECKSIG addresses …} …] …} …} : [ 172D5w7C… ]
  • 17. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F Bitcoin Script ● It Allows to define how an output will be spent and by whom. ● Is a non Turing-Complete language which is evaluated as a Stack, from left to right. ● It just allows to write pure functions (without context) ● Is a non Turing-Complete language which is evaluated with a stack machine.
  • 18. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F How Bitcoin Script works? (Public Key Hash) OP_DUP OP_HASH160 cb1f48… OP_EQUALVERIFY OP_CHECKSIG
  • 19. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F How Bitcoin Script works? (Signature) (Public Key) bbba3f5… 172D5w7C… (Public Key Hash) OP_DUP OP_HASH160 cb1f48… OP_EQUALVERIFY OP_CHECKSIG
  • 20. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F How Bitcoin Script works? (Signature) (Public Key) bbba3f5… 172D5w7C… (Public Key Hash) OP_DUP OP_HASH160 cb1f48… Stack OP_EQUALVERIFY OP_CHECKSIG
  • 21. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F How Bitcoin Script works? (Signature) (Public Key) bbba3f5… 172D5w7C… (Public Key Hash) OP_DUP OP_HASH160 cb1f48… Stack OP_EQUALVERIFY OP_CHECKSIG
  • 22. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F How Bitcoin Script works? (Public Key) (Public Key Hash) 172D5w7C… OP_DUP OP_HASH160 cb1f48… Stack (Signature) bbba3f5… OP_EQUALVERIFY OP_CHECKSIG
  • 23. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F How Bitcoin Script works? (Public Key) (Public Key Hash) 172D5w7C… OP_DUP OP_HASH160 cb1f48… Stack (Signature) bbba3f5… OP_EQUALVERIFY OP_CHECKSIG
  • 24. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F How Bitcoin Script works? (Public Key Hash) OP_DUP OP_HASH160 cb1f48… Stack (Public Key) (Signature) 172D5w7C… bbba3f5… OP_EQUALVERIFY OP_CHECKSIG
  • 25. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F How Bitcoin Script works? (Public Key Hash) OP_DUP OP_HASH160 cb1f48… Stack (Public Key) (Signature) 172D5w7C… bbba3f5… OP_EQUALVERIFY OP_CHECKSIG
  • 26. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F How Bitcoin Script works? (Public Key Hash) OP_HASH160 cb1f48… Stack (Public Key) (Public Key) (Signature) 172D5w7C… 172D5w7C… bbba3f5… OP_EQUALVERIFY OP_CHECKSIG
  • 27. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F How Bitcoin Script works? (Public Key Hash) OP_HASH160 cb1f48… Stack (Public Key) (Public Key) (Signature) 172D5w7C… 172D5w7C… bbba3f5… OP_EQUALVERIFY OP_CHECKSIG
  • 28. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F How Bitcoin Script works? (Public Key Hash) cb1f48… Stack (Public Key Hash) (Public Key) (Signature) cb1f48… 172D5w7C… bbba3f5… OP_EQUALVERIFY OP_CHECKSIG
  • 29. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F How Bitcoin Script works? (Public Key Hash) cb1f48… Stack (Public Key Hash) (Public Key) (Signature) cb1f48… 172D5w7C… bbba3f5… OP_EQUALVERIFY OP_CHECKSIG
  • 30. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F How Bitcoin Script works? OP_EQUALVERIFY OP_CHECKSIG Stack (Public Key Hash) (Public Key Hash) (Public Key) (Signature) cb1f48… cb1f48… 172D5w7C… bbba3f5…
  • 31. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F How Bitcoin Script works? OP_EQUALVERIFY OP_CHECKSIG Stack (Public Key Hash) (Public Key Hash) (Public Key) (Signature) cb1f48… cb1f48… 172D5w7C… bbba3f5…
  • 32. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F How Bitcoin Script works? OP_CHECKSIG Stack (Public Key) (Signature) 172D5w7C… bbba3f5…
  • 33. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F How Bitcoin Script works? OP_CHECKSIG Stack (Public Key) (Signature) 172D5w7C… bbba3f5…
  • 34. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers How Bitcoin Script works? (EMPTY) Stack (EMPTY) SUCCESS! #BitcoinT3F
  • 35. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F The sky is the limit! (Odd/Even Bet) <Sig> <PubKeyB> <7bb> <5aa> OP_2DUP OP_HASH160 <aHash> OP_EQUALVERIFY OP_SWAP OP_HASH160 <bHash> OP_EQUALVERIFY <1> OP_LEFT OP_SWAP <1> OP_LEFT OP_ADD <2> OP_SWAP OP_MOD OP_IF OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG OP_ELSE OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG OP_ENDIF
  • 36. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F The sky is the limit! (Odd/Even Bet) <Sig> <PubKeyB> <7bb> <5aa> OP_2DUP OP_HASH160 <aHash> OP_EQUALVERIFY OP_SWAP OP_HASH160 <bHash> OP_EQUALVERIFY <1> OP_LEFT OP_SWAP <1> OP_LEFT OP_ADD <2> OP_SWAP OP_MOD OP_IF OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG OP_ELSE OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG OP_ENDIF Random diversion! @_sortega
  • 37. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F The sky is the limit! (Odd/Even Bet) <Sig> <PubKeyB> <7bb> <5aa> OP_2DUP OP_HASH160 <aHash> OP_EQUALVERIFY OP_SWAP OP_HASH160 <bHash> OP_EQUALVERIFY <1> OP_LEFT OP_SWAP <1> OP_LEFT OP_ADD <2> OP_SWAP OP_MOD OP_IF OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG OP_ELSE OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG OP_ENDIF Stack
  • 38. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F The sky is the limit! (Odd/Even Bet) <PubKeyB> <7bb> <5aa> OP_2DUP OP_HASH160 <aHash> OP_EQUALVERIFY OP_SWAP OP_HASH160 <bHash> OP_EQUALVERIFY <1> OP_LEFT OP_SWAP <1> OP_LEFT OP_ADD <2> OP_SWAP OP_MOD OP_IF OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG OP_ELSE OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG OP_ENDIF Stack <Sig>
  • 39. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F The sky is the limit! (Odd/Even Bet) <7bb> <5aa> OP_2DUP OP_HASH160 <aHash> OP_EQUALVERIFY OP_SWAP OP_HASH160 <bHash> OP_EQUALVERIFY <1> OP_LEFT OP_SWAP <1> OP_LEFT OP_ADD <2> OP_SWAP OP_MOD OP_IF OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG OP_ELSE OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG OP_ENDIF Stack <PubKey> <Sig>
  • 40. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F The sky is the limit! (Odd/Even Bet) <5aa> OP_2DUP OP_HASH160 <aHash> OP_EQUALVERIFY OP_SWAP OP_HASH160 <bHash> OP_EQUALVERIFY <1> OP_LEFT OP_SWAP <1> OP_LEFT OP_ADD <2> OP_SWAP OP_MOD OP_IF OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG OP_ELSE OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG OP_ENDIF Stack <7bb> <PubKey> <Sig>
  • 41. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F The sky is the limit! (Odd/Even Bet) OP_2DUP OP_HASH160 <aHash> OP_EQUALVERIFY OP_SWAP OP_HASH160 <bHash> OP_EQUALVERIFY <1> OP_LEFT OP_SWAP <1> OP_LEFT OP_ADD <2> OP_SWAP OP_MOD OP_IF OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG OP_ELSE OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG OP_ENDIF Stack <5aa> <7bb> <PubKeyB> <Sig>
  • 42. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F The sky is the limit! (Odd/Even Bet) OP_HASH160 <aHash> OP_EQUALVERIFY OP_SWAP OP_HASH160 <bHash> OP_EQUALVERIFY <1> OP_LEFT OP_SWAP <1> OP_LEFT OP_ADD <2> OP_SWAP OP_MOD OP_IF OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG OP_ELSE OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG OP_ENDIF Stack <5aa> <7bb> <5aa> <7bb> <PubKeyB> <Sig>
  • 43. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F The sky is the limit! (Odd/Even Bet) <aHash> OP_EQUALVERIFY OP_SWAP OP_HASH160 <bHash> OP_EQUALVERIFY <1> OP_LEFT OP_SWAP <1> OP_LEFT OP_ADD <2> OP_SWAP OP_MOD OP_IF OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG OP_ELSE OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG OP_ENDIF Stack <aHash> <7bb> <5aa> <7bb> <PubKeyB> <Sig>
  • 44. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F The sky is the limit! (Odd/Even Bet) OP_EQUALVERIFY OP_SWAP OP_HASH160 <bHash> OP_EQUALVERIFY <1> OP_LEFT OP_SWAP <1> OP_LEFT OP_ADD <2> OP_SWAP OP_MOD OP_IF OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG OP_ELSE OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG OP_ENDIF Stack <aHash> <aHash> <5aa> <7bb> <7bb> <PubKeyB> <Sig>
  • 45. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F The sky is the limit! (Odd/Even Bet) OP_SWAP OP_HASH160 <bHash> OP_EQUALVERIFY <1> OP_LEFT OP_SWAP <1> OP_LEFT OP_ADD <2> OP_SWAP OP_MOD OP_IF OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG OP_ELSE OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG OP_ENDIF Stack <5aa> <7bb> <7bb> <PubKeyB> <Sig>
  • 46. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F The sky is the limit! (Odd/Even Bet) OP_HASH160 <bHash> OP_EQUALVERIFY <1> OP_LEFT OP_SWAP <1> OP_LEFT OP_ADD <2> OP_SWAP OP_MOD OP_IF OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG OP_ELSE OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG OP_ENDIF Stack <7bb> <5aa> <7bb> <PubKeyB> <Sig>
  • 47. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F The sky is the limit! (Odd/Even Bet) <bHash> OP_EQUALVERIFY <1> OP_LEFT OP_SWAP <1> OP_LEFT OP_ADD <2> OP_SWAP OP_MOD OP_IF OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG OP_ELSE OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG OP_ENDIF Stack <bHash> <5aa> <7bb> <PubKeyB> <Sig>
  • 48. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F The sky is the limit! (Odd/Even Bet) OP_EQUALVERIFY <1> OP_LEFT OP_SWAP <1> OP_LEFT OP_ADD <2> OP_SWAP OP_MOD OP_IF OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG OP_ELSE OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG OP_ENDIF Stack <bHash> <bHash> <5aa> <7bb> <PubKeyB> <Sig>
  • 49. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F The sky is the limit! (Odd/Even Bet) <1> OP_LEFT OP_SWAP <1> OP_LEFT OP_ADD <2> OP_SWAP OP_MOD OP_IF OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG OP_ELSE OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG OP_ENDIF Stack <5aa> <7bb> <PubKeyB> <Sig>
  • 50. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F The sky is the limit! (Odd/Even Bet) OP_LEFT OP_SWAP <1> OP_LEFT OP_ADD <2> OP_SWAP OP_MOD OP_IF OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG OP_ELSE OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG OP_ENDIF Stack <1> <5aa> <7bb> <PubKeyB> <Sig>
  • 51. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F The sky is the limit! (Odd/Even Bet) OP_SWAP <1> OP_LEFT OP_ADD <2> OP_SWAP OP_MOD OP_IF OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG OP_ELSE OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG OP_ENDIF Stack <5> <7bb> <PubKeyB> <Sig>
  • 52. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F The sky is the limit! (Odd/Even Bet) <1> OP_LEFT OP_ADD <2> OP_SWAP OP_MOD OP_IF OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG OP_ELSE OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG OP_ENDIF Stack <7bb> <5> <PubKeyB> <Sig>
  • 53. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F The sky is the limit! (Odd/Even Bet) OP_LEFT OP_ADD <2> OP_SWAP OP_MOD OP_IF OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG OP_ELSE OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG OP_ENDIF Stack <1> <7bb> <5> <PubKeyB> <Sig>
  • 54. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F The sky is the limit! (Odd/Even Bet) OP_ADD <2> OP_SWAP OP_MOD OP_IF OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG OP_ELSE OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG OP_ENDIF Stack <7> <5> <PubKeyB> <Sig>
  • 55. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F The sky is the limit! (Odd/Even Bet) <2> OP_SWAP OP_MOD OP_IF OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG OP_ELSE OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG OP_ENDIF Stack <12> <PubKeyB> <Sig>
  • 56. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers The sky is the limit! (Odd/Even Bet) OP_SWAP OP_MOD OP_IF OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG OP_ELSE OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG OP_ENDIF Stack <2> <12> <PubKeyB> <Sig> #BitcoinT3F
  • 57. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers The sky is the limit! (Odd/Even Bet) OP_MOD OP_IF OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG OP_ELSE OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG OP_ENDIF Stack <12> <2> <PubKeyB> <Sig> #BitcoinT3F
  • 58. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers The sky is the limit! (Odd/Even Bet) OP_IF OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG OP_ELSE OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG OP_ENDIF Stack <0> <PubKeyB> <Sig> #BitcoinT3F
  • 59. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers The sky is the limit! (Odd/Even Bet) OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG Stack <PubKeyB> <Sig> (Standard Script) #BitcoinT3F
  • 60. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers The sky is the limit! (Odd/Even Bet) ● Possible real use: ○ Random user to pay the transaction fees. ○ Help to define asymmetric scenario (secrets) #BitcoinT3F
  • 61. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F Context: Oracles ● The oracle contract allow define how the money is spent including external state. ○ Allows to make reversible transactions. ○ Allow to pay, only if an external condition is true, for example the result of a search in google, or the API SEUR response.
  • 62. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F Context: Oracles ● Example of a reversible payment using a Oracle ○ First you generate (in private) a multisig transaction as this: TX1 in { 1 BTC BOB } out { 1 BTC MULTISIGVERIFY BOB SAM } ○ Then you must obtain signed from counterpart: TX2 in { TX1[0] } out { 1 BTC TX3 in { TX1[0] } out { 1 BTC <SeurAPI(trackID) == ‘RETURNED’> OP_HASH160 <ExternalScriptHash> OP_EQUALSVERIFY <OraclePubKey> <SamPubKey> 2 OP_CHECKMULTISIGVERIFY } <SeurAPI(trackID) == ‘DELIVERED’> OP_HASH160 <ExternalScriptHash> OP_EQUALSVERIFY <OraclePubKey> <BobPubKey> 2 OP_CHECKMULTISIGVERIFY }
  • 63. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers Context: Oracles ● Execution TX2 in { TX1[0] } out { 1 BTC <SeurAPI(trackID) == ‘RETURNED’> OP_HASH160 <ExternalScriptHash> OP_EQUALSVERIFY <OraclePubKey> <SamPubKey> 2 OP_CHECKMULTISIGVERIFY } #BitcoinT3F
  • 64. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F Context: Oracles ● Execution <OracleSig> <SamSig> <SeurAPI(trackID) == ‘RETURNED’> OP_HASH160 <ExternalScriptHash> OP_EQUALSVERIFY <OraclePubKey> <SamPubKey> 2 OP_CHECKMULTISIGVERIFY Stack
  • 65. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F Context: Oracles ● Execution <SamSig> <SeurAPI(trackID) == ‘RETURNED’> OP_HASH160 <ExternalScriptHash> OP_EQUALSVERIFY <OraclePubKey> <SamPubKey> 2 OP_CHECKMULTISIGVERIFY Stack <OracleSig>
  • 66. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F Context: Oracles ● Execution <SeurAPI(trackID) == ‘RETURNED’> OP_HASH160 <ExternalScriptHash> OP_EQUALSVERIFY <OraclePubKey> <SamPubKey> 2 OP_CHECKMULTISIGVERIFY Stack <SamSig> <OracleSig>
  • 67. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers Context: Oracles ● Execution OP_HASH160 <ExternalScriptHash> OP_EQUALSVERIFY <OraclePubKey> <SamPubKey> 2 OP_CHECKMULTISIGVERIFY Stack <SeurAPI(trackID) == ‘RETURNED’> <SamSig> <OracleSig> #BitcoinT3F
  • 68. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers Context: Oracles ● Execution <ExternalScriptHash> OP_EQUALSVERIFY <OraclePubKey> <SamPubKey> 2 OP_CHECKMULTISIGVERIFY Stack <ScriptHash> <SamSig> <OacleSig> #BitcoinT3F
  • 69. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers Context: Oracles ● Execution OP_EQUALSVERIFY <OraclePubKey> <SamPubKey> 2 OP_CHECKMULTISIGVERIFY Stack <ExternalScriptHash> <ScriptHash> <SamSig> <OracleSig> #BitcoinT3F
  • 70. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers Context: Oracles ● Execution <OraclePubKey> <SamPubKey> 2 OP_CHECKMULTISIGVERIFY Stack <SamSig> <OracleSig> #BitcoinT3F
  • 71. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers Context: Oracles ● Execution SUCCESS! Stack #BitcoinT3F
  • 72. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F Fees? Micro Payment Channels! ● Transactions from a checkpoint without broadcast ● Allows commit money safely ● Allows to pay on demand by the second ● For example: decentralized WiFi Hotspots or subcontracting services in third world countries.
  • 73. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers Micro Payment Channels Mechanic TX1 IN {0: 1 BTC } OUT {0: 1 BTC MULTISIG BOB SAM } #BitcoinT3F
  • 74. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers Micro Payment Channels Mechanic TX1 IN {0: 1 BTC } OUT {0: 1 BTC MULTISIG BOB SAM } TX2 IN {TX1[0]: 1 BTC } OUT { 0 : 1 BTC BOB } LOCKTIME : 18 #BitcoinT3F
  • 75. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers Micro Payment Channels Mechanic TX1 IN {0: 1 BTC } OUT {0: 1 BTC MULTISIG BOB SAM } TX2 IN {TX1[0]: 1 BTC } OUT { 0 : 1 BTC BOB } LOCKTIME : 18 #BitcoinT3F
  • 76. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers Micro Payment Channels Mechanic TX1 IN {0: 1 BTC } OUT {0: 1 BTC MULTISIG BOB SAM } TX2 IN {TX1[0]: 1 BTC } OUT { 0 : 1 BTC BOB } LOCKTIME : 18 #BitcoinT3F
  • 77. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F Micro Payment Channels Mechanic TX1 IN {0: 1 BTC } OUT {0: 1 BTC MULTISIG BOB SAM } TX2 IN {TX1[0]: 1 BTC } OUT { 0 : 1 BTC BOB } LOCKTIME : 18 IN {TX1[0] 1 BTC } OUT {0: 0,9 BTC BOB 0,1 BTC SAM }
  • 78. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F Micro Payment Channels Mechanic TX1 IN {0: 1 BTC } OUT {0: 1 BTC MULTISIG BOB SAM } TX2 IN {TX1[0]: 1 BTC } OUT { 0 : 1 BTC BOB } LOCKTIME : 18 IN {TX1[0] 1 BTC } OUT {0: 0,8 BTC BOB 0,2 BTC SAM }
  • 79. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F Micro Payment Channels Mechanic TX1 IN {0: 1 BTC } OUT {0: 1 BTC MULTISIG BOB SAM } TX2 IN {TX1[0]: 1 BTC } OUT { 0 : 1 BTC BOB } LOCKTIME : 18 IN {TX1[0] 1 BTC } OUT {0: 0,7 BTC BOB 0,3 BTC SAM }
  • 80. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F Micro Payment Channels Mechanic TX1 IN {0: 1 BTC } OUT {0: 1 BTC MULTISIG BOB SAM } IN {TX1[0] 1 BTC } OUT {0: 0,6 BTC BOB 0,4 BTC SAM } TX2 IN {TX1[0]: 1 BTC } OUT { 0 : 1 BTC BOB } LOCKTIME : 18 BREAK!
  • 81. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F Micro Payment Channels Mechanic TX1 IN {0: 1 BTC } OUT {0: 1 BTC MULTISIG BOB SAM } TX2 IN {TX1[0]: 1 BTC } OUT { 0 : 1 BTC BOB } LOCKTIME : 18 IN {TX1[0] 1 BTC } OUT {0: 0,6 BTC BOB 0,4 BTC SAM }
  • 82. Leganés 6 Febrero 2013 Bitcoin Protocol for Developers #BitcoinT3F THANKS! ● BigData is the current wave, P2P is the next. ● APIs and P2P are the next challenge on finantial world. ● Bitcoin technology and protocol is here to stay.