PEER-TO-PEER AFFINE
COMMITMENT USING BITCOIN
AUTHORS: KARL CRARY, MICHAEL J. SULLIVAN
PRESENTED BY: KRUTI SHARMA
CS594: SOFTWARE TESTING, VERIFICATION AND VALIDATION
BASIC TERMINOLOGIES
• Peer-to-Peer: A mechanism in which instead of keeping all the information at
one centralized location, the information is distributed over the network.
• Commitment: Once a transaction has been done, the state of this transaction
is changed and is now irreversible.
• Logic: Consists of the systematic study of the form of arguments.
• Linear Logic: This logic is resource conscious logic. So for a linear logic,
each of the resource must be used exactly once.
• Affine Logic: This is characterized as linear logic with weakening i.e. each of
the resource must be used at most once.
EXAMPLE:
So now in order to make a burger, we use one bun, one ham and
once it is prepared, we can say that now the resources have been
used and the state of bread and ham is changed.
Other words, if we have a counter for bun = 3 and ham = 2, now the
counter for both is reduced by one and the state is committed.
APPLICATION OF LINEAR/AFFINE LOGIC
<Prof. Mark>may-write(Shiwangi,Report)
This is basically <K>P which is read as “The principal K says P”, so now
Shiwangi can submit the report to Prof. Mark.
Now making it more precise : Prof. would want Shiwangi to submit the report
only once, so this proposition will now be made as a linear or affine resource,
allowing Shiwangi to submit the report exactly once. This is basically affirming
of resources – authorizing the resources to be used only once or as required.
PROBLEM
• We generally have a third party (say – google wallet, pay pal etc.) which
allows us to transfer money securely to anyone around the world, but this
makes the system centralized and everyone needs to trust the third party.
• This leads to single point failure.
• In a peer-to-peer setting, it is difficult to force principals to commit to state
changes. The principals performs a state change while retaining the old state,
thereby allowing an undo.
MOTIVATION
• For commitment, we want a peer-to-peer solution – one that is distributed ,
trust-free and avoids any single point failures.
• Linear/Affine credentials – should not be copied and should be held
collectively on the network.
• Represent authorization as logical propositions.
• Bitcoin: The paper uses Bitcoin for generalizing to carry logical propositions.
OVERVIEW OF BITCOINS
Banking with Bitcoin: An owner has:
1. Private Key (the most important)
2. Public Key
3. Address.
Money Network Cryptographic key Bitcoins
A record of this public is
stored in the block chain – this
helps to identify the user
anonymously.
Used by the
owner to validate
and sign the
bitcoin before
sending it to
some one else
OVERVIEW CONT.
BITCOIN TRANSACTION
BITCOIN TRANSACTIONS CONT.
Bitcoin peer-to-peer network An owner of tries to submit same transaction
twice for different address.
In order to prevent the owner spend the same coin for two
different transactions, Bitcoin maintains a common Global
Ledger of all transactions.
BLOCKCHAIN
• Consists of a set of blocks – each containing multiple transactions and a
cryptographic hash of the previous block.
• How is the block created :
When a user wants to purchase
something from the bitcoin => the
user broadcasts a request on the
bitcoin network.
BLOCKCHAIN CONT.
1. These computers and their owners are called miners.
2. Each Miner gets an incentive for creating a new block
3. Creating a new block is very complex, but the
verification is easy.
Each of the miner tries to solve
the complex problem. The first
miner to solve the problem,
adds the new block to the block
chain.
The newly created block is
pushed into the network and
verified by the other miners.
TYPECOIN IMPLEMENTATION
• Bitcoins mainly deal with coins – crypto currency. This paper intends to
generalize each amount to a “TYPE”.
• In Bitcoins, the transaction consists of: a set of inputs and a set of outputs.
• In order to generalize each amount in Typecoin, we have each input and
output as- bitcoin amount (a1 or b1) + type (A1 or B1) + proof term (M).
TYPECOIN TRANSACTION
• For a Bitcoin transaction to be valid:
1. The sum of outputs must equal to sum of inputs, i.e.
a1+a2+……+am = b1+ b2+…… bn
2. Each input amount must be equal to the output amount it identifies.
Since in Typecoin, we have a type associated with each bitcoin, the bitcoin
protocol verifies- do the Bitcoin amounts agree? So now we require them to
agree type-theoretically: i.e.:
├ M : (A1 A2 ... Am) (B1 B2 … Bn)
• Example:
We have 2 + 2 = 1 + 3, if we consider each amount as a coin, so we have
(coin coin) (coin coin) (coin (coin coin coin))
This is the scenario where we consider Typecoin dealing with a single resource.
In order to represent more complex systems using Typecoin, consider the same
proof authorization example: <Prof Mark>may-write(Shiwangi,Report)
Prof. Mark signs the transaction and directs the output to Shiwangi i.e. => lock the
output using Shiwangi’s public key.
In order to submit the report =>
may-write(Shiwangi, Report) may-write-this(Shiwangi, Report, n)
TRANSACTIONS CONT.
• Other conditions that a Bitcoin Transaction checks:
3. Each input is unspent.
4. All digital signatures are valid.
New plan of Typecoin overlays on top of Bitcoin:
TYPE CHECKING
• Bitcoin only checks the amount, but in order to validate the type, other type
checker may check as:
1. Continuing our example: as Shiwangi turns in her Report, she identifies
herself to the filesystem a txout => I => type is may-write-this(…..)
2. To substantiate this claim, she provides Typecoin transaction TI that
outputs I + the set of all Typecoin transactions upstream TI
METADATA IN BITCOIN
• The implementation of Typecoin requires us to embed the transaction hash
into the Bitcoin transaction. This is achieved using a standard script– 1-of-2
form.
• This is basically using the schema m-of-n script where
Output => n public keys
Input => provide signature for m of them.
Thus 1(m)-of-2(n) form is => One of the public key is the actual public key and
the other “public key” is the desired metadata for Typecoin.
EXAMPLE
• Considering NEWCOINS is the new currency, so we have
SYNTAX
• Types: this is inhabited by Index Terms. In order to define index terms, we use LF i.e.
Logical Framework.
The type “Principal” => cryptographic hashes of public key
The type “Nat” => Natural Numbers
• Proof Terms: standard affine logics => sayreturn, saybind, assert(K,A,sig) and
assert!(K,A,sig)
• Receipts: these records the fact that a payment is made.
Example: receipt(A → K) => resource of type A is sent to principal K.
• Transactions: Five components: local basis(set of constant declarations), proposition (affine
grant), inputs ,outputs and a proof term.
EXPIRATION AND REVOCATION
• Lets say we want a resource to be available for certain duration only.
receipt(solution → Prof. Mark) if(before(t),commodity)
So now until time t, the students can provide solution to Prof. Mark.
before(t) => expresses expiration.
• For revocation i.e. where the owner can revoke the offer by spending the
resource.
receipt(solution → Prof. Mark) if(┐spent(I), commodity)
SUMMARY
• Typecoin is flexible peer-to-peer logical commitment mechanism based on
Bitcoin Protocol to carry logical propositions.
• The flexibility to define this for any type and use peer-to-peer network allows
to remove the dependency on any third party clients.
CRITIQUE
• Bitcoin itself has not proved to be very safe, thus using the Bitcoin protocol to make
commitment for resources is not very secure.
• Tracking back any transaction in Bitcoin is almost impossible.
• Since every user can see every other users balance, even though the users identity is
hidden, but trusting an unknown set of users over the network is risky.
• Since there is no third party or bank, in case of any loss, the owner cannot file any
complain against anyone.
• If an owner losses their private key, there is no way for the owner to retrieve their
bitcoins back.
• Overall before generalizing the Bitcoin protocol for carrying logical proposition, it
is important for the Bitcoin network to be safe.
REFERENCES
• http://slideshot.epfl.ch/play/icc_roger_wattenhofer
• http://homepages.inf.ed.ac.uk/gdp/publications/Framework_Def_Log.pdf
• http://spectrum.ieee.org/video/computing/networks/video-the-bitcoin-
blockchain-explained
THANK YOU !!!!

Peer_to_Peer_Affine_Commitment

  • 1.
    PEER-TO-PEER AFFINE COMMITMENT USINGBITCOIN AUTHORS: KARL CRARY, MICHAEL J. SULLIVAN PRESENTED BY: KRUTI SHARMA CS594: SOFTWARE TESTING, VERIFICATION AND VALIDATION
  • 2.
    BASIC TERMINOLOGIES • Peer-to-Peer:A mechanism in which instead of keeping all the information at one centralized location, the information is distributed over the network. • Commitment: Once a transaction has been done, the state of this transaction is changed and is now irreversible. • Logic: Consists of the systematic study of the form of arguments. • Linear Logic: This logic is resource conscious logic. So for a linear logic, each of the resource must be used exactly once. • Affine Logic: This is characterized as linear logic with weakening i.e. each of the resource must be used at most once.
  • 3.
    EXAMPLE: So now inorder to make a burger, we use one bun, one ham and once it is prepared, we can say that now the resources have been used and the state of bread and ham is changed. Other words, if we have a counter for bun = 3 and ham = 2, now the counter for both is reduced by one and the state is committed.
  • 4.
    APPLICATION OF LINEAR/AFFINELOGIC <Prof. Mark>may-write(Shiwangi,Report) This is basically <K>P which is read as “The principal K says P”, so now Shiwangi can submit the report to Prof. Mark. Now making it more precise : Prof. would want Shiwangi to submit the report only once, so this proposition will now be made as a linear or affine resource, allowing Shiwangi to submit the report exactly once. This is basically affirming of resources – authorizing the resources to be used only once or as required.
  • 5.
    PROBLEM • We generallyhave a third party (say – google wallet, pay pal etc.) which allows us to transfer money securely to anyone around the world, but this makes the system centralized and everyone needs to trust the third party. • This leads to single point failure. • In a peer-to-peer setting, it is difficult to force principals to commit to state changes. The principals performs a state change while retaining the old state, thereby allowing an undo.
  • 6.
    MOTIVATION • For commitment,we want a peer-to-peer solution – one that is distributed , trust-free and avoids any single point failures. • Linear/Affine credentials – should not be copied and should be held collectively on the network. • Represent authorization as logical propositions. • Bitcoin: The paper uses Bitcoin for generalizing to carry logical propositions.
  • 7.
    OVERVIEW OF BITCOINS Bankingwith Bitcoin: An owner has: 1. Private Key (the most important) 2. Public Key 3. Address. Money Network Cryptographic key Bitcoins
  • 8.
    A record ofthis public is stored in the block chain – this helps to identify the user anonymously. Used by the owner to validate and sign the bitcoin before sending it to some one else OVERVIEW CONT.
  • 9.
  • 10.
    BITCOIN TRANSACTIONS CONT. Bitcoinpeer-to-peer network An owner of tries to submit same transaction twice for different address. In order to prevent the owner spend the same coin for two different transactions, Bitcoin maintains a common Global Ledger of all transactions.
  • 11.
    BLOCKCHAIN • Consists ofa set of blocks – each containing multiple transactions and a cryptographic hash of the previous block. • How is the block created : When a user wants to purchase something from the bitcoin => the user broadcasts a request on the bitcoin network.
  • 12.
    BLOCKCHAIN CONT. 1. Thesecomputers and their owners are called miners. 2. Each Miner gets an incentive for creating a new block 3. Creating a new block is very complex, but the verification is easy.
  • 13.
    Each of theminer tries to solve the complex problem. The first miner to solve the problem, adds the new block to the block chain. The newly created block is pushed into the network and verified by the other miners.
  • 14.
    TYPECOIN IMPLEMENTATION • Bitcoinsmainly deal with coins – crypto currency. This paper intends to generalize each amount to a “TYPE”. • In Bitcoins, the transaction consists of: a set of inputs and a set of outputs. • In order to generalize each amount in Typecoin, we have each input and output as- bitcoin amount (a1 or b1) + type (A1 or B1) + proof term (M).
  • 15.
    TYPECOIN TRANSACTION • Fora Bitcoin transaction to be valid: 1. The sum of outputs must equal to sum of inputs, i.e. a1+a2+……+am = b1+ b2+…… bn 2. Each input amount must be equal to the output amount it identifies. Since in Typecoin, we have a type associated with each bitcoin, the bitcoin protocol verifies- do the Bitcoin amounts agree? So now we require them to agree type-theoretically: i.e.: ├ M : (A1 A2 ... Am) (B1 B2 … Bn)
  • 16.
    • Example: We have2 + 2 = 1 + 3, if we consider each amount as a coin, so we have (coin coin) (coin coin) (coin (coin coin coin)) This is the scenario where we consider Typecoin dealing with a single resource. In order to represent more complex systems using Typecoin, consider the same proof authorization example: <Prof Mark>may-write(Shiwangi,Report) Prof. Mark signs the transaction and directs the output to Shiwangi i.e. => lock the output using Shiwangi’s public key. In order to submit the report => may-write(Shiwangi, Report) may-write-this(Shiwangi, Report, n)
  • 17.
    TRANSACTIONS CONT. • Otherconditions that a Bitcoin Transaction checks: 3. Each input is unspent. 4. All digital signatures are valid. New plan of Typecoin overlays on top of Bitcoin:
  • 18.
    TYPE CHECKING • Bitcoinonly checks the amount, but in order to validate the type, other type checker may check as: 1. Continuing our example: as Shiwangi turns in her Report, she identifies herself to the filesystem a txout => I => type is may-write-this(…..) 2. To substantiate this claim, she provides Typecoin transaction TI that outputs I + the set of all Typecoin transactions upstream TI
  • 19.
    METADATA IN BITCOIN •The implementation of Typecoin requires us to embed the transaction hash into the Bitcoin transaction. This is achieved using a standard script– 1-of-2 form. • This is basically using the schema m-of-n script where Output => n public keys Input => provide signature for m of them. Thus 1(m)-of-2(n) form is => One of the public key is the actual public key and the other “public key” is the desired metadata for Typecoin.
  • 20.
    EXAMPLE • Considering NEWCOINSis the new currency, so we have
  • 21.
    SYNTAX • Types: thisis inhabited by Index Terms. In order to define index terms, we use LF i.e. Logical Framework. The type “Principal” => cryptographic hashes of public key The type “Nat” => Natural Numbers • Proof Terms: standard affine logics => sayreturn, saybind, assert(K,A,sig) and assert!(K,A,sig) • Receipts: these records the fact that a payment is made. Example: receipt(A → K) => resource of type A is sent to principal K. • Transactions: Five components: local basis(set of constant declarations), proposition (affine grant), inputs ,outputs and a proof term.
  • 22.
    EXPIRATION AND REVOCATION •Lets say we want a resource to be available for certain duration only. receipt(solution → Prof. Mark) if(before(t),commodity) So now until time t, the students can provide solution to Prof. Mark. before(t) => expresses expiration. • For revocation i.e. where the owner can revoke the offer by spending the resource. receipt(solution → Prof. Mark) if(┐spent(I), commodity)
  • 23.
    SUMMARY • Typecoin isflexible peer-to-peer logical commitment mechanism based on Bitcoin Protocol to carry logical propositions. • The flexibility to define this for any type and use peer-to-peer network allows to remove the dependency on any third party clients.
  • 24.
    CRITIQUE • Bitcoin itselfhas not proved to be very safe, thus using the Bitcoin protocol to make commitment for resources is not very secure. • Tracking back any transaction in Bitcoin is almost impossible. • Since every user can see every other users balance, even though the users identity is hidden, but trusting an unknown set of users over the network is risky. • Since there is no third party or bank, in case of any loss, the owner cannot file any complain against anyone. • If an owner losses their private key, there is no way for the owner to retrieve their bitcoins back. • Overall before generalizing the Bitcoin protocol for carrying logical proposition, it is important for the Bitcoin network to be safe.
  • 25.
  • 26.