SlideShare una empresa de Scribd logo
1 de 82
Descargar para leer sin conexión
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
Leganés
6 Febrero 2013
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
Alberto Gómez @gotoalberto
Alvaro Polo @apolovald
“Software development enthusiast and aviation geek. Give me a
higher-order function and I shall move the world.”
“Vocational coder since childhood, he will annoy you with concepts
like "monad" and "actor model" but gets the work done.”
“Theoretical computer science believer by night, pragmatic ship-it developer by day.
My brain runs on glucose, caffeine, general abstract nonsense and type theory.”
“OpenData and Bitcoin Developer on fire.
Great coders are today’s rock stars. That’s it!”
Coinffeine.com
Sebastián Ortega @_sortega
Ximo Guanter
A P2P Bitcoin exchange
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
What is the Bitcoin Protocol?
● Network protocol
● Transactions Mechanics
○ Blockchain mining
○ Fees and commitment rules
○ Sharing protocol: Gossip, Bittorrent, Gnutella...
○ Validations of the money source
○ Protocol to spend the money
○ Bitcoin Scripting
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
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.
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
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.
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
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.
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
Transactions Mechanic
● Transaction anatomy
{ txid : 5c084b… ,
locktime : 0,
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… ]
…}
…]
…}
{ txid : 5c084b… ,
locktime : 0,
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… ]
…}
…]
…}
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
Transactions Mechanic
● Transaction anatomy
Transaction Id, changes when a field is changed or tx is signed.
{ txid : 5c084b… ,
locktime : 0,
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… ]
…}
…]
…}
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
Transactions Mechanic
● Transaction anatomy
Locktime, Block or Time up to which this tx cannot be broadcasted.
{ txid : 5c084b… ,
locktime : 0,
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… ]
…}
…]
…}
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
Transactions Mechanic
● Transaction anatomy
TXid reference output for this input.
{ txid : 5c084b… ,
locktime : 0,
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… ]
…}
…]
…}
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
Transactions Mechanic
● Transaction anatomy
Output number reference in previous tx
{ txid : 5c084b… ,
locktime : 0,
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… ]
…}
…]
…}
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
Transactions Mechanic
● Transaction anatomy
ScriptSig which unlock the
connected OutputScript
{ txid : 5c084b… ,
locktime : 0,
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… ]
…}
…]
…}
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
Transactions Mechanic
● Transaction anatomy
Value to transfer. The difference with the
summatory of inputs values is the fee.
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
Transactions Mechanic
● Transaction anatomy
{ txid : 5c084b… ,
locktime : 0,
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… ]
…}
…]
…}
Number of sigs required to broadcast this
transaction. The signers are included in the
“addresses” array.
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
Transactions Mechanic
● Transaction anatomy
{ txid : 5c084b… ,
locktime : 0,
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… ]
…}
…]
…}
Script. It defines how the money can be spent and by whom.
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
Transactions Mechanic
● Transaction anatomy
{ txid : 5c084b… ,
locktime : 0,
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… ]
…}
…]
…}
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
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.
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
How Bitcoin Script works?
OP_DUP OP_HASH160 cb1f48… OP_EQUALVERIFY OP_CHECKSIG
(Public Key Hash)
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
How Bitcoin Script works?
OP_DUP OP_HASH160 cb1f48… OP_EQUALVERIFY OP_CHECKSIGbbba3f5… 172D5w7C…
(Public Key)(Signature) (Public Key Hash)
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
How Bitcoin Script works?
Stack
OP_DUP OP_HASH160 cb1f48… OP_EQUALVERIFY OP_CHECKSIGbbba3f5… 172D5w7C…
(Public Key)(Signature) (Public Key Hash)
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
How Bitcoin Script works?
Stack
OP_DUP OP_HASH160 cb1f48… OP_EQUALVERIFY OP_CHECKSIGbbba3f5… 172D5w7C…
(Public Key)(Signature) (Public Key Hash)
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
How Bitcoin Script works?
Stack
bbba3f5…(Signature)
OP_DUP OP_HASH160 cb1f48… OP_EQUALVERIFY OP_CHECKSIG172D5w7C…
(Public Key) (Public Key Hash)
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
How Bitcoin Script works?
Stack
(Signature) bbba3f5…
OP_DUP OP_HASH160 cb1f48… OP_EQUALVERIFY OP_CHECKSIG172D5w7C…
(Public Key) (Public Key Hash)
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
How Bitcoin Script works?
Stack
bbba3f5…
172D5w7C…
(Signature)
(Public Key)
OP_DUP OP_HASH160 cb1f48… OP_EQUALVERIFY OP_CHECKSIG
(Public Key Hash)
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
How Bitcoin Script works?
Stack
bbba3f5…
172D5w7C…
(Signature)
(Public Key)
OP_DUP OP_HASH160 cb1f48… OP_EQUALVERIFY OP_CHECKSIG
(Public Key Hash)
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
How Bitcoin Script works?
Stack
bbba3f5…
172D5w7C…(Public Key)
(Signature)
172D5w7C…(Public Key)
OP_HASH160 cb1f48… OP_EQUALVERIFY OP_CHECKSIG
(Public Key Hash)
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
How Bitcoin Script works?
Stack
bbba3f5…
172D5w7C…(Public Key)
(Signature)
172D5w7C…(Public Key)
OP_HASH160 cb1f48… OP_EQUALVERIFY OP_CHECKSIG
(Public Key Hash)
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
How Bitcoin Script works?
Stack
bbba3f5…
172D5w7C…(Public Key)
(Signature)
cb1f48…(Public Key Hash)
cb1f48… OP_EQUALVERIFY OP_CHECKSIG
(Public Key Hash)
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
How Bitcoin Script works?
Stack
bbba3f5…
172D5w7C…(Public Key)
(Signature)
cb1f48…(Public Key Hash)
cb1f48… OP_EQUALVERIFY OP_CHECKSIG
(Public Key Hash)
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
How Bitcoin Script works?
Stack
bbba3f5…
172D5w7C…(Public Key)
(Signature)
cb1f48…(Public Key Hash)
cb1f48…(Public Key Hash)
OP_EQUALVERIFY OP_CHECKSIG
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
How Bitcoin Script works?
Stack
bbba3f5…
172D5w7C…(Public Key)
(Signature)
cb1f48…(Public Key Hash)
cb1f48…(Public Key Hash)
OP_EQUALVERIFY OP_CHECKSIG
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
How Bitcoin Script works?
Stack
bbba3f5…
172D5w7C…(Public Key)
(Signature)
OP_CHECKSIG
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
How Bitcoin Script works?
Stack
bbba3f5…
172D5w7C…(Public Key)
(Signature)
OP_CHECKSIG
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
How Bitcoin Script works?
Stack
(EMPTY)
(EMPTY)
SUCCESS!
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
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
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
The sky is the limit! (Odd/Even Bet)
@_sortega
Random
diversion!
<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
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
The sky is the limit! (Odd/Even Bet)
Stack
<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
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
The sky is the limit! (Odd/Even Bet)
Stack
<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
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
The sky is the limit! (Odd/Even Bet)
Stack
<PubKey>
<Sig>
<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
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
The sky is the limit! (Odd/Even Bet)
Stack
<7bb>
<PubKey>
<Sig>
<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
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
The sky is the limit! (Odd/Even Bet)
Stack
<5aa>
<7bb>
<PubKeyB>
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
<Sig>
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
The sky is the limit! (Odd/Even Bet)
Stack
<7bb>
<5aa>
<PubKeyB>
<5aa>
<7bb>
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
<Sig>
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
The sky is the limit! (Odd/Even Bet)
Stack
<7bb>
<5aa>
<PubKeyB>
<aHash>
<7bb>
<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
<Sig>
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
The sky is the limit! (Odd/Even Bet)
Stack
<5aa>
<7bb>
<PubKeyB>
<aHash>
<7bb>
<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
<Sig>
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
The sky is the limit! (Odd/Even Bet)
Stack
<5aa>
<7bb>
<PubKeyB>
<7bb>
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
<Sig>
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
The sky is the limit! (Odd/Even Bet)
Stack
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
<7bb>
<5aa>
<PubKeyB>
<7bb>
<Sig>
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
The sky is the limit! (Odd/Even Bet)
Stack
<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
<bHash>
<5aa>
<PubKeyB>
<7bb>
<Sig>
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
The sky is the limit! (Odd/Even Bet)
Stack
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
<bHash>
<5aa>
<PubKeyB>
<7bb>
<bHash>
<Sig>
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
The sky is the limit! (Odd/Even Bet)
Stack
<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
<5aa>
<PubKeyB>
<7bb>
<Sig>
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
The sky is the limit! (Odd/Even Bet)
Stack
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
<5aa>
<PubKeyB>
<7bb>
<Sig>
<1>
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
The sky is the limit! (Odd/Even Bet)
Stack
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
<5>
<PubKeyB>
<7bb>
<Sig>
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
The sky is the limit! (Odd/Even Bet)
Stack
<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
<7bb>
<PubKeyB>
<5>
<Sig>
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
The sky is the limit! (Odd/Even Bet)
Stack
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
<7bb>
<PubKeyB>
<5>
<Sig>
<1>
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
The sky is the limit! (Odd/Even Bet)
Stack
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
<7>
<PubKeyB>
<5>
<Sig>
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
The sky is the limit! (Odd/Even Bet)
Stack
<PubKeyB>
<12>
<Sig>
<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
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
The sky is the limit! (Odd/Even Bet)
Stack
<PubKeyB>
<2>
<12>
<Sig>
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
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
The sky is the limit! (Odd/Even Bet)
Stack
<PubKeyB>
<12>
<2>
<Sig>
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
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
The sky is the limit! (Odd/Even Bet)
Stack
<PubKeyB>
<0>
<Sig>
OP_IF
OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ELSE
OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG
OP_ENDIF
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
The sky is the limit! (Odd/Even Bet)
Stack
<PubKeyB>
<Sig>
(Standard Script)
OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
The sky is the limit! (Odd/Even Bet)
● Possible real use:
○ Random user to pay the transaction fees.
○ Help to define asymmetric scenario (secrets)
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
Context: Oracles
● The oracle contract allow define how the money
is spent including external state.
○ Allow to pay, only if an external condition is true, for
example the result of a search in google, or the API SEUR
response.
○ Allows to make reversible transactions.
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
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:
<SeurAPI(trackID) == ‘DELIVERED’>
OP_HASH160 <ExternalScriptHash> OP_EQUALSVERIFY
<OraclePubKey> <BobPubKey> 2 OP_CHECKMULTISIGVERIFY }
TX3
in { TX1[0] }
out { 1 BTC
<SeurAPI(trackID) == ‘RETURNED’>
OP_HASH160 <ExternalScriptHash> OP_EQUALSVERIFY
<OraclePubKey> <SamPubKey> 2 OP_CHECKMULTISIGVERIFY }
TX2
in { TX1[0] }
out { 1 BTC
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
Context: Oracles
● Execution
<SeurAPI(trackID) == ‘RETURNED’>
OP_HASH160 <ExternalScriptHash>
OP_EQUALSVERIFY
<OraclePubKey> <SamPubKey> 2
OP_CHECKMULTISIGVERIFY }
TX2
in { TX1[0] }
out { 1 BTC
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
Context: Oracles
● Execution
<OracleSig> <SamSig> <SeurAPI(trackID) == ‘RETURNED’>
OP_HASH160 <ExternalScriptHash> OP_EQUALSVERIFY
<OraclePubKey> <SamPubKey> 2 OP_CHECKMULTISIGVERIFY
Stack
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
Context: Oracles
● Execution
<SamSig> <SeurAPI(trackID) == ‘RETURNED’>
OP_HASH160 <ExternalScriptHash> OP_EQUALSVERIFY
<OraclePubKey> <SamPubKey> 2 OP_CHECKMULTISIGVERIFY
Stack
<OracleSig>
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
Context: Oracles
● Execution
<SeurAPI(trackID) == ‘RETURNED’>
OP_HASH160 <ExternalScriptHash> OP_EQUALSVERIFY
<OraclePubKey> <SamPubKey> 2 OP_CHECKMULTISIGVERIFY
Stack
<SamSig>
<OracleSig>
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
Context: Oracles
● Execution
OP_HASH160 <ExternalScriptHash> OP_EQUALSVERIFY
<OraclePubKey> <SamPubKey> 2 OP_CHECKMULTISIGVERIFY
Stack
<SeurAPI(trackID) == ‘RETURNED’>
<SamSig>
<OracleSig>
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
Context: Oracles
● Execution
<ExternalScriptHash> OP_EQUALSVERIFY
<OraclePubKey> <SamPubKey> 2 OP_CHECKMULTISIGVERIFY
Stack
<ScriptHash>
<SamSig>
<OacleSig>
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
Context: Oracles
● Execution
OP_EQUALSVERIFY
<OraclePubKey> <SamPubKey> 2 OP_CHECKMULTISIGVERIFY
Stack
<ScriptHash>
<ExternalScriptHash>
<SamSig>
<OracleSig>
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
Context: Oracles
● Execution
<OraclePubKey> <SamPubKey> 2 OP_CHECKMULTISIGVERIFY
Stack
<SamSig>
<OracleSig>
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
Context: Oracles
● Execution
Stack
SUCCESS!
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
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.
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
Micro Payment Channels Mechanic
TX1
IN {0: 1 BTC }
OUT {0: 1 BTC MULTISIG BOB SAM }
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
Micro Payment Channels Mechanic
TX1
IN {0: 1 BTC }
OUT {0: 1 BTC MULTISIG BOB SAM }
IN {TX1[0]: 1 BTC }
OUT { 0 : 1 BTC BOB }
LOCKTIME : 18
TX2
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
Micro Payment Channels Mechanic
TX1
IN {0: 1 BTC }
OUT {0: 1 BTC MULTISIG BOB SAM }
IN {TX1[0]: 1 BTC }
OUT { 0 : 1 BTC BOB }
LOCKTIME : 18
TX2
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
Micro Payment Channels Mechanic
TX1
IN {0: 1 BTC }
OUT {0: 1 BTC MULTISIG BOB SAM }
IN {TX1[0]: 1 BTC }
OUT { 0 : 1 BTC BOB }
LOCKTIME : 18
TX2
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
Micro Payment Channels Mechanic
TX1
IN {0: 1 BTC }
OUT {0: 1 BTC MULTISIG BOB SAM }
IN {TX1[0]: 1 BTC }
OUT { 0 : 1 BTC BOB }
LOCKTIME : 18
TX2
IN {TX1[0] 1 BTC }
OUT {0: 0,9 BTC BOB
0,1 BTC SAM }
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
Micro Payment Channels Mechanic
TX1
IN {0: 1 BTC }
OUT {0: 1 BTC MULTISIG BOB SAM }
IN {TX1[0]: 1 BTC }
OUT { 0 : 1 BTC BOB }
LOCKTIME : 18
TX2
IN {TX1[0] 1 BTC }
OUT {0: 0,8 BTC BOB
0,2 BTC SAM }
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
Micro Payment Channels Mechanic
TX1
IN {0: 1 BTC }
OUT {0: 1 BTC MULTISIG BOB SAM }
IN {TX1[0]: 1 BTC }
OUT { 0 : 1 BTC BOB }
LOCKTIME : 18
TX2
IN {TX1[0] 1 BTC }
OUT {0: 0,7 BTC BOB
0,3 BTC SAM }
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
Micro Payment Channels Mechanic
TX1
IN {0: 1 BTC }
OUT {0: 1 BTC MULTISIG BOB SAM }
IN {TX1[0]: 1 BTC }
OUT { 0 : 1 BTC BOB }
LOCKTIME : 18
TX2
IN {TX1[0] 1 BTC }
OUT {0: 0,6 BTC BOB
0,4 BTC SAM }
BREAK!
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
Micro Payment Channels Mechanic
TX1
IN {0: 1 BTC }
OUT {0: 1 BTC MULTISIG BOB SAM }
IN {TX1[0]: 1 BTC }
OUT { 0 : 1 BTC BOB }
LOCKTIME : 18
TX2
IN {TX1[0] 1 BTC }
OUT {0: 0,6 BTC BOB
0,4 BTC SAM }
Bitcoin Protocol for Developers #BitcoinT3F
Leganés
6 Febrero 2013
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.

Más contenido relacionado

La actualidad más candente

Cryptography 101 for Java developers
Cryptography 101 for Java developersCryptography 101 for Java developers
Cryptography 101 for Java developersMichel Schudel
 
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 algorithmsDmitry Baryshkov
 
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
 
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
 
Android binder introduction
Android binder introductionAndroid binder introduction
Android binder introductionDerek Fang
 
Common Browser Hijacking Methods
Common Browser Hijacking MethodsCommon Browser Hijacking Methods
Common Browser Hijacking MethodsDavid Barroso
 
Reutov, yunusov, nagibin random numbers take ii
Reutov, yunusov, nagibin   random numbers take iiReutov, yunusov, nagibin   random numbers take ii
Reutov, yunusov, nagibin random numbers take iiDefconRussia
 
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
 
BalCCon2k18 - Towards the perfect cryptocurrency wallet
BalCCon2k18 - Towards the perfect cryptocurrency walletBalCCon2k18 - Towards the perfect cryptocurrency wallet
BalCCon2k18 - Towards the perfect cryptocurrency walletNemanja Nikodijević
 
Seguridad en microservicios via micro profile jwt
Seguridad en microservicios via micro profile jwtSeguridad en microservicios via micro profile jwt
Seguridad en microservicios via micro profile jwtCésar Hernández
 
Oczyszczacz powietrza i stos sieciowy? Czas na test! Semihalf Barcamp 13/06/2018
Oczyszczacz powietrza i stos sieciowy? Czas na test! Semihalf Barcamp 13/06/2018Oczyszczacz powietrza i stos sieciowy? Czas na test! Semihalf Barcamp 13/06/2018
Oczyszczacz powietrza i stos sieciowy? Czas na test! Semihalf Barcamp 13/06/2018Semihalf
 
Linux seccomp(2) vs OpenBSD pledge(2)
Linux seccomp(2) vs OpenBSD pledge(2)Linux seccomp(2) vs OpenBSD pledge(2)
Linux seccomp(2) vs OpenBSD pledge(2)Giovanni Bechis
 
The Ring programming language version 1.6 book - Part 188 of 189
The Ring programming language version 1.6 book - Part 188 of 189The Ring programming language version 1.6 book - Part 188 of 189
The Ring programming language version 1.6 book - Part 188 of 189Mahmoud Samir Fayed
 

La actualidad más candente (15)

Cryptography 101 for Java developers
Cryptography 101 for Java developersCryptography 101 for Java developers
Cryptography 101 for Java developers
 
Testable Code
Testable CodeTestable Code
Testable Code
 
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
 
Ethereum Smart Contracts on Hyperledger Fabric
Ethereum Smart Contracts on Hyperledger Fabric Ethereum Smart Contracts on Hyperledger Fabric
Ethereum Smart Contracts on Hyperledger Fabric
 
Cryptography for Absolute Beginners (May 2019)
Cryptography for Absolute Beginners (May 2019)Cryptography for Absolute Beginners (May 2019)
Cryptography for Absolute Beginners (May 2019)
 
Android binder introduction
Android binder introductionAndroid binder introduction
Android binder introduction
 
Common Browser Hijacking Methods
Common Browser Hijacking MethodsCommon Browser Hijacking Methods
Common Browser Hijacking Methods
 
JWTs and JOSE in a flash
JWTs and JOSE in a flashJWTs and JOSE in a flash
JWTs and JOSE in a flash
 
Reutov, yunusov, nagibin random numbers take ii
Reutov, yunusov, nagibin   random numbers take iiReutov, yunusov, nagibin   random numbers take ii
Reutov, yunusov, nagibin random numbers take ii
 
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)
 
BalCCon2k18 - Towards the perfect cryptocurrency wallet
BalCCon2k18 - Towards the perfect cryptocurrency walletBalCCon2k18 - Towards the perfect cryptocurrency wallet
BalCCon2k18 - Towards the perfect cryptocurrency wallet
 
Seguridad en microservicios via micro profile jwt
Seguridad en microservicios via micro profile jwtSeguridad en microservicios via micro profile jwt
Seguridad en microservicios via micro profile jwt
 
Oczyszczacz powietrza i stos sieciowy? Czas na test! Semihalf Barcamp 13/06/2018
Oczyszczacz powietrza i stos sieciowy? Czas na test! Semihalf Barcamp 13/06/2018Oczyszczacz powietrza i stos sieciowy? Czas na test! Semihalf Barcamp 13/06/2018
Oczyszczacz powietrza i stos sieciowy? Czas na test! Semihalf Barcamp 13/06/2018
 
Linux seccomp(2) vs OpenBSD pledge(2)
Linux seccomp(2) vs OpenBSD pledge(2)Linux seccomp(2) vs OpenBSD pledge(2)
Linux seccomp(2) vs OpenBSD pledge(2)
 
The Ring programming language version 1.6 book - Part 188 of 189
The Ring programming language version 1.6 book - Part 188 of 189The Ring programming language version 1.6 book - Part 188 of 189
The Ring programming language version 1.6 book - Part 188 of 189
 

Destacado

Content Marketing: Get Trained Up!
Content Marketing: Get Trained Up!Content Marketing: Get Trained Up!
Content Marketing: Get Trained Up!Michael Brenner
 
Lançamento novas marcas Cabergs Saúde
Lançamento novas marcas Cabergs SaúdeLançamento novas marcas Cabergs Saúde
Lançamento novas marcas Cabergs SaúdeVanessa Cerutti
 
Herramienta rss
Herramienta rssHerramienta rss
Herramienta rssUnad
 
Jugos curativos
Jugos curativosJugos curativos
Jugos curativosRene Rob
 
ANALISIS STRATEGI PEMASARAN DI SEKOLAH TINGGI ILMU EKONOMI LEMBAH DEMPO PAGAR...
ANALISIS STRATEGI PEMASARAN DI SEKOLAH TINGGI ILMU EKONOMI LEMBAH DEMPO PAGAR...ANALISIS STRATEGI PEMASARAN DI SEKOLAH TINGGI ILMU EKONOMI LEMBAH DEMPO PAGAR...
ANALISIS STRATEGI PEMASARAN DI SEKOLAH TINGGI ILMU EKONOMI LEMBAH DEMPO PAGAR...Excruciate Limited
 
Living Landscapes in South Dakota: A Guide to Native Plantscaping
Living Landscapes in South Dakota: A Guide to Native PlantscapingLiving Landscapes in South Dakota: A Guide to Native Plantscaping
Living Landscapes in South Dakota: A Guide to Native PlantscapingFaizah68w
 
Boletín InfoSACU 35/2016
Boletín InfoSACU 35/2016Boletín InfoSACU 35/2016
Boletín InfoSACU 35/2016Sacu Uhu
 
Going Local - techconkona.11.2.13
Going Local - techconkona.11.2.13Going Local - techconkona.11.2.13
Going Local - techconkona.11.2.13Amber Bieg
 
II Congreso Internacional Barcelona Inclusiva
II Congreso Internacional Barcelona Inclusiva II Congreso Internacional Barcelona Inclusiva
II Congreso Internacional Barcelona Inclusiva Sylvie Pérez
 
AcademicTranscriptions
AcademicTranscriptionsAcademicTranscriptions
AcademicTranscriptionsJulian Fajardo
 
Effective Strategic Planning
Effective Strategic PlanningEffective Strategic Planning
Effective Strategic Planningguestf480a
 
Hackers heroes of the computer revolution
Hackers heroes of the computer revolutionHackers heroes of the computer revolution
Hackers heroes of the computer revolutionAlbertz Ace-Red
 
Vietnamese traditional craft and innovation in applied arts
Vietnamese traditional craft and innovation in applied artsVietnamese traditional craft and innovation in applied arts
Vietnamese traditional craft and innovation in applied artsSiniša Prvanov
 
“Pintxo” de poivrons de piquillos farcis au thon blanc avec anchois cantabriq...
“Pintxo” de poivrons de piquillos farcis au thon blanc avec anchois cantabriq...“Pintxo” de poivrons de piquillos farcis au thon blanc avec anchois cantabriq...
“Pintxo” de poivrons de piquillos farcis au thon blanc avec anchois cantabriq...Olmeda Orígenes
 

Destacado (17)

Content Marketing: Get Trained Up!
Content Marketing: Get Trained Up!Content Marketing: Get Trained Up!
Content Marketing: Get Trained Up!
 
Lançamento novas marcas Cabergs Saúde
Lançamento novas marcas Cabergs SaúdeLançamento novas marcas Cabergs Saúde
Lançamento novas marcas Cabergs Saúde
 
Herramienta rss
Herramienta rssHerramienta rss
Herramienta rss
 
Jugos curativos
Jugos curativosJugos curativos
Jugos curativos
 
ANALISIS STRATEGI PEMASARAN DI SEKOLAH TINGGI ILMU EKONOMI LEMBAH DEMPO PAGAR...
ANALISIS STRATEGI PEMASARAN DI SEKOLAH TINGGI ILMU EKONOMI LEMBAH DEMPO PAGAR...ANALISIS STRATEGI PEMASARAN DI SEKOLAH TINGGI ILMU EKONOMI LEMBAH DEMPO PAGAR...
ANALISIS STRATEGI PEMASARAN DI SEKOLAH TINGGI ILMU EKONOMI LEMBAH DEMPO PAGAR...
 
Living Landscapes in South Dakota: A Guide to Native Plantscaping
Living Landscapes in South Dakota: A Guide to Native PlantscapingLiving Landscapes in South Dakota: A Guide to Native Plantscaping
Living Landscapes in South Dakota: A Guide to Native Plantscaping
 
Fundiciones
FundicionesFundiciones
Fundiciones
 
Boletín InfoSACU 35/2016
Boletín InfoSACU 35/2016Boletín InfoSACU 35/2016
Boletín InfoSACU 35/2016
 
Ecolabel affiche generique-a4
Ecolabel affiche generique-a4Ecolabel affiche generique-a4
Ecolabel affiche generique-a4
 
Going Local - techconkona.11.2.13
Going Local - techconkona.11.2.13Going Local - techconkona.11.2.13
Going Local - techconkona.11.2.13
 
Mediakittravelblogprojectspaceelenapaschinger 01072015
Mediakittravelblogprojectspaceelenapaschinger 01072015Mediakittravelblogprojectspaceelenapaschinger 01072015
Mediakittravelblogprojectspaceelenapaschinger 01072015
 
II Congreso Internacional Barcelona Inclusiva
II Congreso Internacional Barcelona Inclusiva II Congreso Internacional Barcelona Inclusiva
II Congreso Internacional Barcelona Inclusiva
 
AcademicTranscriptions
AcademicTranscriptionsAcademicTranscriptions
AcademicTranscriptions
 
Effective Strategic Planning
Effective Strategic PlanningEffective Strategic Planning
Effective Strategic Planning
 
Hackers heroes of the computer revolution
Hackers heroes of the computer revolutionHackers heroes of the computer revolution
Hackers heroes of the computer revolution
 
Vietnamese traditional craft and innovation in applied arts
Vietnamese traditional craft and innovation in applied artsVietnamese traditional craft and innovation in applied arts
Vietnamese traditional craft and innovation in applied arts
 
“Pintxo” de poivrons de piquillos farcis au thon blanc avec anchois cantabriq...
“Pintxo” de poivrons de piquillos farcis au thon blanc avec anchois cantabriq...“Pintxo” de poivrons de piquillos farcis au thon blanc avec anchois cantabriq...
“Pintxo” de poivrons de piquillos farcis au thon blanc avec anchois cantabriq...
 

Similar a Bitcoin protocol for developers at techfest

“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
 
Bitcoin Blockchain - Under the Hood
Bitcoin Blockchain - Under the HoodBitcoin Blockchain - Under the Hood
Bitcoin Blockchain - Under the HoodGalin Dinkov
 
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 DeathsPriyanka Aash
 
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 migrationOWASP
 
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 presentationPaperchain
 
How to Build Your Own Blockchain
How to Build Your Own BlockchainHow to Build Your Own Blockchain
How to Build Your Own BlockchainLeonid Beder
 
Hitcon badge 2018
Hitcon badge 2018 Hitcon badge 2018
Hitcon badge 2018 Alan Lee
 
Cryptocurrency Mixing
Cryptocurrency MixingCryptocurrency Mixing
Cryptocurrency Mixingashmoran
 
“A bitcoin mining rig”
“A bitcoin mining rig”“A bitcoin mining rig”
“A bitcoin mining rig”glitterlabs
 
Bruno Lowagie (iText) #cfoconferenz
Bruno Lowagie (iText) #cfoconferenzBruno Lowagie (iText) #cfoconferenz
Bruno Lowagie (iText) #cfoconferenzFDMagazine
 
Crypto & Crpyocurrencies Intro
Crypto & Crpyocurrencies IntroCrypto & Crpyocurrencies Intro
Crypto & Crpyocurrencies IntroTal Shmueli
 
growthbotics audit.pdf
growthbotics audit.pdfgrowthbotics audit.pdf
growthbotics audit.pdfWilson Kao
 
How to Create AltCoin(Alternative Cryptocurrency)?
How to Create AltCoin(Alternative Cryptocurrency)?How to Create AltCoin(Alternative Cryptocurrency)?
How to Create AltCoin(Alternative Cryptocurrency)?Abdullah Khan Zehady
 
Switcheo Network - Advanced NEO Smart Contracts
Switcheo Network - Advanced NEO Smart ContractsSwitcheo Network - Advanced NEO Smart Contracts
Switcheo Network - Advanced NEO Smart ContractsSwitcheo
 
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
 
EthereumBlockchainMarch3 (1).pptx
EthereumBlockchainMarch3 (1).pptxEthereumBlockchainMarch3 (1).pptx
EthereumBlockchainMarch3 (1).pptxWijdenBenothmen1
 
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 ForwardKubeAcademy
 
J.burke HackMiami6
J.burke HackMiami6J.burke HackMiami6
J.burke HackMiami6Jesse Burke
 
Presentation topalidis giorgos
Presentation topalidis giorgosPresentation topalidis giorgos
Presentation topalidis giorgosGiorgos Topalidis
 

Similar a Bitcoin protocol for developers at techfest (20)

“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...
 
Bitcoin Blockchain - Under the Hood
Bitcoin Blockchain - Under the HoodBitcoin Blockchain - Under the Hood
Bitcoin Blockchain - Under the Hood
 
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
 
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
 
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
 
How to Build Your Own Blockchain
How to Build Your Own BlockchainHow to Build Your Own Blockchain
How to Build Your Own Blockchain
 
Hitcon badge 2018
Hitcon badge 2018 Hitcon badge 2018
Hitcon badge 2018
 
Cryptocurrency Mixing
Cryptocurrency MixingCryptocurrency Mixing
Cryptocurrency Mixing
 
“A bitcoin mining rig”
“A bitcoin mining rig”“A bitcoin mining rig”
“A bitcoin mining rig”
 
Bruno Lowagie (iText) #cfoconferenz
Bruno Lowagie (iText) #cfoconferenzBruno Lowagie (iText) #cfoconferenz
Bruno Lowagie (iText) #cfoconferenz
 
Crypto & Crpyocurrencies Intro
Crypto & Crpyocurrencies IntroCrypto & Crpyocurrencies Intro
Crypto & Crpyocurrencies Intro
 
growthbotics audit.pdf
growthbotics audit.pdfgrowthbotics audit.pdf
growthbotics audit.pdf
 
How to Create AltCoin(Alternative Cryptocurrency)?
How to Create AltCoin(Alternative Cryptocurrency)?How to Create AltCoin(Alternative Cryptocurrency)?
How to Create AltCoin(Alternative Cryptocurrency)?
 
Switcheo Network - Advanced NEO Smart Contracts
Switcheo Network - Advanced NEO Smart ContractsSwitcheo Network - Advanced NEO Smart Contracts
Switcheo Network - Advanced NEO Smart Contracts
 
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)
 
From logs to metrics
From logs to metricsFrom logs to metrics
From logs to metrics
 
EthereumBlockchainMarch3 (1).pptx
EthereumBlockchainMarch3 (1).pptxEthereumBlockchainMarch3 (1).pptx
EthereumBlockchainMarch3 (1).pptx
 
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
 
J.burke HackMiami6
J.burke HackMiami6J.burke HackMiami6
J.burke HackMiami6
 
Presentation topalidis giorgos
Presentation topalidis giorgosPresentation topalidis giorgos
Presentation topalidis giorgos
 

Más de Alberto Gomez Toribio

Más de Alberto Gomez Toribio (6)

Bitcoin introduction, El Corte Inglés
Bitcoin introduction, El Corte InglésBitcoin introduction, El Corte Inglés
Bitcoin introduction, El Corte Inglés
 
Bitcoin Development - Desarrollo con Bitcoin
Bitcoin Development - Desarrollo con BitcoinBitcoin Development - Desarrollo con Bitcoin
Bitcoin Development - Desarrollo con Bitcoin
 
Bitcoin
BitcoinBitcoin
Bitcoin
 
Agile at Work
Agile at WorkAgile at Work
Agile at Work
 
OpenData18E
OpenData18EOpenData18E
OpenData18E
 
Alcazar Open Government
Alcazar Open GovernmentAlcazar Open Government
Alcazar Open Government
 

Último

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 

Último (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 

Bitcoin protocol for developers at techfest

  • 1. 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 Leganés 6 Febrero 2013
  • 2. 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 Alberto Gómez @gotoalberto Alvaro Polo @apolovald “Software development enthusiast and aviation geek. Give me a higher-order function and I shall move the world.” “Vocational coder since childhood, he will annoy you with concepts like "monad" and "actor model" but gets the work done.” “Theoretical computer science believer by night, pragmatic ship-it developer by day. My brain runs on glucose, caffeine, general abstract nonsense and type theory.” “OpenData and Bitcoin Developer on fire. Great coders are today’s rock stars. That’s it!” Coinffeine.com Sebastián Ortega @_sortega Ximo Guanter A P2P Bitcoin exchange
  • 3. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 What is the Bitcoin Protocol? ● Network protocol ● Transactions Mechanics ○ Blockchain mining ○ Fees and commitment rules ○ Sharing protocol: Gossip, Bittorrent, Gnutella... ○ Validations of the money source ○ Protocol to spend the money ○ Bitcoin Scripting
  • 4. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 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. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 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. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 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. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 Transactions Mechanic ● Transaction anatomy { txid : 5c084b… , locktime : 0, 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… ] …} …] …}
  • 8. { txid : 5c084b… , locktime : 0, 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… ] …} …] …} Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 Transactions Mechanic ● Transaction anatomy Transaction Id, changes when a field is changed or tx is signed.
  • 9. { txid : 5c084b… , locktime : 0, 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… ] …} …] …} Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 Transactions Mechanic ● Transaction anatomy Locktime, Block or Time up to which this tx cannot be broadcasted.
  • 10. { txid : 5c084b… , locktime : 0, 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… ] …} …] …} Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 Transactions Mechanic ● Transaction anatomy TXid reference output for this input.
  • 11. { txid : 5c084b… , locktime : 0, 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… ] …} …] …} Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 Transactions Mechanic ● Transaction anatomy Output number reference in previous tx
  • 12. { txid : 5c084b… , locktime : 0, 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… ] …} …] …} Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 Transactions Mechanic ● Transaction anatomy ScriptSig which unlock the connected OutputScript
  • 13. { txid : 5c084b… , locktime : 0, 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… ] …} …] …} Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 Transactions Mechanic ● Transaction anatomy Value to transfer. The difference with the summatory of inputs values is the fee.
  • 14. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 Transactions Mechanic ● Transaction anatomy { txid : 5c084b… , locktime : 0, 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… ] …} …] …} Number of sigs required to broadcast this transaction. The signers are included in the “addresses” array.
  • 15. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 Transactions Mechanic ● Transaction anatomy { txid : 5c084b… , locktime : 0, 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… ] …} …] …} Script. It defines how the money can be spent and by whom.
  • 16. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 Transactions Mechanic ● Transaction anatomy { txid : 5c084b… , locktime : 0, 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… ] …} …] …}
  • 17. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 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. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 How Bitcoin Script works? OP_DUP OP_HASH160 cb1f48… OP_EQUALVERIFY OP_CHECKSIG (Public Key Hash)
  • 19. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 How Bitcoin Script works? OP_DUP OP_HASH160 cb1f48… OP_EQUALVERIFY OP_CHECKSIGbbba3f5… 172D5w7C… (Public Key)(Signature) (Public Key Hash)
  • 20. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 How Bitcoin Script works? Stack OP_DUP OP_HASH160 cb1f48… OP_EQUALVERIFY OP_CHECKSIGbbba3f5… 172D5w7C… (Public Key)(Signature) (Public Key Hash)
  • 21. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 How Bitcoin Script works? Stack OP_DUP OP_HASH160 cb1f48… OP_EQUALVERIFY OP_CHECKSIGbbba3f5… 172D5w7C… (Public Key)(Signature) (Public Key Hash)
  • 22. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 How Bitcoin Script works? Stack bbba3f5…(Signature) OP_DUP OP_HASH160 cb1f48… OP_EQUALVERIFY OP_CHECKSIG172D5w7C… (Public Key) (Public Key Hash)
  • 23. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 How Bitcoin Script works? Stack (Signature) bbba3f5… OP_DUP OP_HASH160 cb1f48… OP_EQUALVERIFY OP_CHECKSIG172D5w7C… (Public Key) (Public Key Hash)
  • 24. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 How Bitcoin Script works? Stack bbba3f5… 172D5w7C… (Signature) (Public Key) OP_DUP OP_HASH160 cb1f48… OP_EQUALVERIFY OP_CHECKSIG (Public Key Hash)
  • 25. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 How Bitcoin Script works? Stack bbba3f5… 172D5w7C… (Signature) (Public Key) OP_DUP OP_HASH160 cb1f48… OP_EQUALVERIFY OP_CHECKSIG (Public Key Hash)
  • 26. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 How Bitcoin Script works? Stack bbba3f5… 172D5w7C…(Public Key) (Signature) 172D5w7C…(Public Key) OP_HASH160 cb1f48… OP_EQUALVERIFY OP_CHECKSIG (Public Key Hash)
  • 27. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 How Bitcoin Script works? Stack bbba3f5… 172D5w7C…(Public Key) (Signature) 172D5w7C…(Public Key) OP_HASH160 cb1f48… OP_EQUALVERIFY OP_CHECKSIG (Public Key Hash)
  • 28. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 How Bitcoin Script works? Stack bbba3f5… 172D5w7C…(Public Key) (Signature) cb1f48…(Public Key Hash) cb1f48… OP_EQUALVERIFY OP_CHECKSIG (Public Key Hash)
  • 29. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 How Bitcoin Script works? Stack bbba3f5… 172D5w7C…(Public Key) (Signature) cb1f48…(Public Key Hash) cb1f48… OP_EQUALVERIFY OP_CHECKSIG (Public Key Hash)
  • 30. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 How Bitcoin Script works? Stack bbba3f5… 172D5w7C…(Public Key) (Signature) cb1f48…(Public Key Hash) cb1f48…(Public Key Hash) OP_EQUALVERIFY OP_CHECKSIG
  • 31. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 How Bitcoin Script works? Stack bbba3f5… 172D5w7C…(Public Key) (Signature) cb1f48…(Public Key Hash) cb1f48…(Public Key Hash) OP_EQUALVERIFY OP_CHECKSIG
  • 32. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 How Bitcoin Script works? Stack bbba3f5… 172D5w7C…(Public Key) (Signature) OP_CHECKSIG
  • 33. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 How Bitcoin Script works? Stack bbba3f5… 172D5w7C…(Public Key) (Signature) OP_CHECKSIG
  • 34. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 How Bitcoin Script works? Stack (EMPTY) (EMPTY) SUCCESS!
  • 35. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 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. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 The sky is the limit! (Odd/Even Bet) @_sortega Random diversion! <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
  • 37. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 The sky is the limit! (Odd/Even Bet) Stack <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
  • 38. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 The sky is the limit! (Odd/Even Bet) Stack <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
  • 39. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 The sky is the limit! (Odd/Even Bet) Stack <PubKey> <Sig> <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
  • 40. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 The sky is the limit! (Odd/Even Bet) Stack <7bb> <PubKey> <Sig> <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
  • 41. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 The sky is the limit! (Odd/Even Bet) Stack <5aa> <7bb> <PubKeyB> 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 <Sig>
  • 42. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 The sky is the limit! (Odd/Even Bet) Stack <7bb> <5aa> <PubKeyB> <5aa> <7bb> 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 <Sig>
  • 43. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 The sky is the limit! (Odd/Even Bet) Stack <7bb> <5aa> <PubKeyB> <aHash> <7bb> <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 <Sig>
  • 44. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 The sky is the limit! (Odd/Even Bet) Stack <5aa> <7bb> <PubKeyB> <aHash> <7bb> <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 <Sig>
  • 45. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 The sky is the limit! (Odd/Even Bet) Stack <5aa> <7bb> <PubKeyB> <7bb> 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 <Sig>
  • 46. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 The sky is the limit! (Odd/Even Bet) Stack 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 <7bb> <5aa> <PubKeyB> <7bb> <Sig>
  • 47. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 The sky is the limit! (Odd/Even Bet) Stack <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 <bHash> <5aa> <PubKeyB> <7bb> <Sig>
  • 48. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 The sky is the limit! (Odd/Even Bet) Stack 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 <bHash> <5aa> <PubKeyB> <7bb> <bHash> <Sig>
  • 49. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 The sky is the limit! (Odd/Even Bet) Stack <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 <5aa> <PubKeyB> <7bb> <Sig>
  • 50. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 The sky is the limit! (Odd/Even Bet) Stack 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 <5aa> <PubKeyB> <7bb> <Sig> <1>
  • 51. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 The sky is the limit! (Odd/Even Bet) Stack 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 <5> <PubKeyB> <7bb> <Sig>
  • 52. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 The sky is the limit! (Odd/Even Bet) Stack <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 <7bb> <PubKeyB> <5> <Sig>
  • 53. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 The sky is the limit! (Odd/Even Bet) Stack 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 <7bb> <PubKeyB> <5> <Sig> <1>
  • 54. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 The sky is the limit! (Odd/Even Bet) Stack 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 <7> <PubKeyB> <5> <Sig>
  • 55. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 The sky is the limit! (Odd/Even Bet) Stack <PubKeyB> <12> <Sig> <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
  • 56. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 The sky is the limit! (Odd/Even Bet) Stack <PubKeyB> <2> <12> <Sig> 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
  • 57. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 The sky is the limit! (Odd/Even Bet) Stack <PubKeyB> <12> <2> <Sig> 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
  • 58. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 The sky is the limit! (Odd/Even Bet) Stack <PubKeyB> <0> <Sig> OP_IF OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG OP_ELSE OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG OP_ENDIF
  • 59. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 The sky is the limit! (Odd/Even Bet) Stack <PubKeyB> <Sig> (Standard Script) OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG
  • 60. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 The sky is the limit! (Odd/Even Bet) ● Possible real use: ○ Random user to pay the transaction fees. ○ Help to define asymmetric scenario (secrets)
  • 61. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 Context: Oracles ● The oracle contract allow define how the money is spent including external state. ○ Allow to pay, only if an external condition is true, for example the result of a search in google, or the API SEUR response. ○ Allows to make reversible transactions.
  • 62. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 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: <SeurAPI(trackID) == ‘DELIVERED’> OP_HASH160 <ExternalScriptHash> OP_EQUALSVERIFY <OraclePubKey> <BobPubKey> 2 OP_CHECKMULTISIGVERIFY } TX3 in { TX1[0] } out { 1 BTC <SeurAPI(trackID) == ‘RETURNED’> OP_HASH160 <ExternalScriptHash> OP_EQUALSVERIFY <OraclePubKey> <SamPubKey> 2 OP_CHECKMULTISIGVERIFY } TX2 in { TX1[0] } out { 1 BTC
  • 63. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 Context: Oracles ● Execution <SeurAPI(trackID) == ‘RETURNED’> OP_HASH160 <ExternalScriptHash> OP_EQUALSVERIFY <OraclePubKey> <SamPubKey> 2 OP_CHECKMULTISIGVERIFY } TX2 in { TX1[0] } out { 1 BTC
  • 64. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 Context: Oracles ● Execution <OracleSig> <SamSig> <SeurAPI(trackID) == ‘RETURNED’> OP_HASH160 <ExternalScriptHash> OP_EQUALSVERIFY <OraclePubKey> <SamPubKey> 2 OP_CHECKMULTISIGVERIFY Stack
  • 65. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 Context: Oracles ● Execution <SamSig> <SeurAPI(trackID) == ‘RETURNED’> OP_HASH160 <ExternalScriptHash> OP_EQUALSVERIFY <OraclePubKey> <SamPubKey> 2 OP_CHECKMULTISIGVERIFY Stack <OracleSig>
  • 66. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 Context: Oracles ● Execution <SeurAPI(trackID) == ‘RETURNED’> OP_HASH160 <ExternalScriptHash> OP_EQUALSVERIFY <OraclePubKey> <SamPubKey> 2 OP_CHECKMULTISIGVERIFY Stack <SamSig> <OracleSig>
  • 67. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 Context: Oracles ● Execution OP_HASH160 <ExternalScriptHash> OP_EQUALSVERIFY <OraclePubKey> <SamPubKey> 2 OP_CHECKMULTISIGVERIFY Stack <SeurAPI(trackID) == ‘RETURNED’> <SamSig> <OracleSig>
  • 68. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 Context: Oracles ● Execution <ExternalScriptHash> OP_EQUALSVERIFY <OraclePubKey> <SamPubKey> 2 OP_CHECKMULTISIGVERIFY Stack <ScriptHash> <SamSig> <OacleSig>
  • 69. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 Context: Oracles ● Execution OP_EQUALSVERIFY <OraclePubKey> <SamPubKey> 2 OP_CHECKMULTISIGVERIFY Stack <ScriptHash> <ExternalScriptHash> <SamSig> <OracleSig>
  • 70. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 Context: Oracles ● Execution <OraclePubKey> <SamPubKey> 2 OP_CHECKMULTISIGVERIFY Stack <SamSig> <OracleSig>
  • 71. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 Context: Oracles ● Execution Stack SUCCESS!
  • 72. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 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. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 Micro Payment Channels Mechanic TX1 IN {0: 1 BTC } OUT {0: 1 BTC MULTISIG BOB SAM }
  • 74. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 Micro Payment Channels Mechanic TX1 IN {0: 1 BTC } OUT {0: 1 BTC MULTISIG BOB SAM } IN {TX1[0]: 1 BTC } OUT { 0 : 1 BTC BOB } LOCKTIME : 18 TX2
  • 75. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 Micro Payment Channels Mechanic TX1 IN {0: 1 BTC } OUT {0: 1 BTC MULTISIG BOB SAM } IN {TX1[0]: 1 BTC } OUT { 0 : 1 BTC BOB } LOCKTIME : 18 TX2
  • 76. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 Micro Payment Channels Mechanic TX1 IN {0: 1 BTC } OUT {0: 1 BTC MULTISIG BOB SAM } IN {TX1[0]: 1 BTC } OUT { 0 : 1 BTC BOB } LOCKTIME : 18 TX2
  • 77. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 Micro Payment Channels Mechanic TX1 IN {0: 1 BTC } OUT {0: 1 BTC MULTISIG BOB SAM } IN {TX1[0]: 1 BTC } OUT { 0 : 1 BTC BOB } LOCKTIME : 18 TX2 IN {TX1[0] 1 BTC } OUT {0: 0,9 BTC BOB 0,1 BTC SAM }
  • 78. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 Micro Payment Channels Mechanic TX1 IN {0: 1 BTC } OUT {0: 1 BTC MULTISIG BOB SAM } IN {TX1[0]: 1 BTC } OUT { 0 : 1 BTC BOB } LOCKTIME : 18 TX2 IN {TX1[0] 1 BTC } OUT {0: 0,8 BTC BOB 0,2 BTC SAM }
  • 79. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 Micro Payment Channels Mechanic TX1 IN {0: 1 BTC } OUT {0: 1 BTC MULTISIG BOB SAM } IN {TX1[0]: 1 BTC } OUT { 0 : 1 BTC BOB } LOCKTIME : 18 TX2 IN {TX1[0] 1 BTC } OUT {0: 0,7 BTC BOB 0,3 BTC SAM }
  • 80. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 Micro Payment Channels Mechanic TX1 IN {0: 1 BTC } OUT {0: 1 BTC MULTISIG BOB SAM } IN {TX1[0]: 1 BTC } OUT { 0 : 1 BTC BOB } LOCKTIME : 18 TX2 IN {TX1[0] 1 BTC } OUT {0: 0,6 BTC BOB 0,4 BTC SAM } BREAK!
  • 81. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 Micro Payment Channels Mechanic TX1 IN {0: 1 BTC } OUT {0: 1 BTC MULTISIG BOB SAM } IN {TX1[0]: 1 BTC } OUT { 0 : 1 BTC BOB } LOCKTIME : 18 TX2 IN {TX1[0] 1 BTC } OUT {0: 0,6 BTC BOB 0,4 BTC SAM }
  • 82. Bitcoin Protocol for Developers #BitcoinT3F Leganés 6 Febrero 2013 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.