Trust Is Risk

Games, Network Health,

Risk Invariance Algorithms

& Implementation

Orfeas Stefanos Thyfronitis Litos (U of Edinburgh)

Christos Porios (Imperial College London)

Dionysis Zindros (U of Athens)

OB1

Outline

  • Financial Crypto 2017

  • Game Theoretic Proposal: Two distinct games

  • Network Health: Connectedness & Centrality

  • Risk Invariance algorithms: Pay for purchases

  • Bitcoin JS implementation

FC17

Financial Crypto 17

  • Trust is risk paper accepted in FC17

  • Heavy review, important corrections

  • Presentation well received

  • Tough questions by Vitalik etc. (privacy!)

  • Many ideas for new directions (Miller etc.)

Game theory

Games: approach

  • Players' strategies and utilities definition

  • One player: free to deviate

    • She deviates: not a Nash Equilibrium...

    • She doesn't deviate: Nash Equilibrium!

Design choices

  • Initially random network

  • All information is public

  • Transaction fees ignored

  • Finite games

  • Highly exponential!

  • No time for thorough description now...

  • All players have single strategy

  • Random buyer and seller at the end

  • If there is enough trust, they exchange

  • Utilities: Capital

    • For buyer, seller: + product value

    • Other variants are described

Game 1: Random Roles

  • Three strategies: Buyers, Sellers, Middlemen

  • Buyers

    • Only outgoing trust

    • Want to buy many products

  • Sellers

    • Only incoming trust

    • Want to sell stock at highest price

  • Middlemen

    • Everything allowed

    • Want to maximize capital

Game 2: Marketplace

Network health metrics

  • Connectedness

    • Expected indirect trust amongst all players

  • Centrality

    • Variance of impact of player removal on indirect trusts

Network Health

Examples

Trust redistribution algorithms

  • Alice wants to buy from Bob a product that costs V.

  • Before paying, Alice should reduce her indirect trust to Bob by V.

  • Input: Alice, Bob, V, graph

  • Output: How much to reduce direct trust

    • From Alice to each of her friends

    • Sum of reductions ≥ V

Risk Invariance Algorithms

Use of the Strong Duality Theorem:

  • Describe maxFlow as linear program

  • Find dual linear program

  • Equate the two optimizations; this is a new constraint

  • New optimization: minimize sum of direct trust reductions

Linear Program:

Direct trust reduction minimizer

Implementation

  • Works on the bitcoin blockchain
  • A full node for now

    • SPV later

  • Just a small library with "trust" access

    • CLI / UI later

Implementation

  • Javascript on node.js

  • Heavy use of ES6+, promises, async/await

  • Built on bcoin.js

  • Strongly typed with Facebook's flow

    • We contribute types to bcoin.js also

  • Well tested (unit & end-to-end)

    • with should/sinon & travis

Technologies

// finding trust (allowed spending)
TIR = new TrustIsRisk.FullNode(...);
valueInSatoshis = TIR.trust.getTrust(
    myAddr, vendorAddr
);
// increasing trust
tx = TIR.trust.createTrustIncreasingMTX(
    privKey, pubKey, txToSpend, amountInSatoshis
);
broadcast(tx);
// decreasing trust
tx = TIR.trust.createTrustDecreasingMTXs(
    privKey, pubKey, amountInSatoshis
);
broadcast(tx);

Example usage

Demo

Thank you!

deliverable 31/5/2017

By orfeas

deliverable 31/5/2017

  • 789