Upgrade to Pro — share decks privately, control downloads, hide ads and more …

bancor-token-economy-made-with-ruby

 bancor-token-economy-made-with-ruby

bancor: Token economy made with Ruby

2018.05.31 RubyKaigi 2018
http://rubykaigi.org/2018/

Yuta Kurotaki

May 31, 2018
Tweet

More Decks by Yuta Kurotaki

Other Decks in Programming

Transcript

  1. Yuta Kurotaki / GMO Pepabo, Inc.

    2018.05.31 RubyKaigi 2018
    bancor: Token economy
    made with Ruby

    View Slide

  2. Senior Software Engineer
    Yuta Kurotaki @kurotaky

    View Slide

  3. View Slide

  4. View Slide

  5. SUZURI People
    https://people.suzuri.jp/

    View Slide

  6. View Slide

  7. View Slide

  8. View Slide

  9. View Slide

  10. Crypto currency “SUKISUKI” corps
    • Introduced OKIMOCHI to Pepabo’s Slack

    • OKIMOCHI: Send bit coins with reaction on Slack

    • Research and development of Kaleidscope

    • KVS on IPFS

    • Web service development using Bancor Protocol

    • and More !
    https://speakerdeck.com/kentaro/wips-for-cryptocurrency-at-pepabo

    View Slide

  11. Outline
    • Blockchain

    • Smart Contract

    • Token Economy

    • Bancor Protocol & Ruby

    • Conclusion & Future plans

    View Slide

  12. Blockchain

    View Slide

  13. What is Blockchain?
    • Decentralized ledger

    • P2P Network

    • Proof of Work

    View Slide

  14. Pros
    • Decentralized ledger

    • Tamper resistant ledger

    Cons
    • Scalability problem

    View Slide

  15. Blockchain Applications
    • Financial services

    • Healthcare

    • Personal Identification

    • Contracts

    View Slide

  16. View Slide

  17. Smart Contracts

    View Slide

  18. Ethereum
    • A Next-Generation Smart Contract and Decentralized
    Application Platform
    https://github.com/ethereum/wiki/wiki/White-Paper

    View Slide

  19. What is Smart Contracts?
    •A smart contract is the simplest form of decentralized
    automation, and is most easily and accurately defined
    as follows: a smart contract is a mechanism involving
    digital assets and two or more parties, where some or
    all of the parties put assets in and assets are
    automatically redistributed among those parties
    according to a formula based on certain data that is not
    known at the time the contract is initiated.
    https://blog.ethereum.org/2014/05/06/daos-dacs-das-and-more-an-incomplete-terminology-guide/

    View Slide

  20. Example
    •A wants to pay $500 to B to build a website. The contract
    would work as follows: A puts $500 into the contract, and
    the funds are locked up.
    •When B finishes the website, B can send a message to the
    contract asking to unlock the funds. If A agrees, the funds
    are released.
    •If B decides not to finish the website, B can quit by
    sending a message to relinquish the funds.
    •If B claims that he finished the website, but A does not
    agree, then after a 7-day waiting period it’s up to judge J to
    provide a verdict in A or B’s favor.
    https://blog.ethereum.org/2014/05/06/daos-dacs-das-and-more-an-incomplete-terminology-guide/

    View Slide

  21. Token Economy

    View Slide

  22. ICO(Initial Coin Offering)

    View Slide

  23. ICO(Initial Coin Offering)
    • ALIS ICO Results

    • 430 million yen !

    • Openness
    https://alisproject.github.io/whitepaper/whitepaper_v1.01.pdf

    View Slide

  24. Token Economy
    • Token economy means economy by token (electronic
    vouchers / substitute money)

    • Make something of value realized by tokenizing and make
    it possible to trade

    View Slide

  25. Problems in Minor Token Economy
    • Coincidence of Wants Problem

    • Agreement on price is required between selling side and
    buying side

    • Minor currencies are hard to distribute. I can not sell(buy) it
    when I want to sell(buy) it

    *XBOUUPTFMM
    GPS
    *XBOUUPCVZJU
    GPS
    Coincidence of Wants Problem

    View Slide

  26. #BODPS1SPUPDPM

    View Slide

  27. Bancor Protocol ͸τʔΫϯΤίϊϛʔΛࢧ͑Δେൃ໌ͱͳΔ͔ʁʢલฤʣ

    View Slide

  28. Bancor Protocol
    • Automatic determination of transaction price

    • Continuous liquidity

    View Slide

  29. A New Method for Price Discovery
    • Balance: Reserve Token Balance

    • Supply: Smart Token Supply

    • CRR: Constant Reserve Ratio
    https://bravenewcoin.com/assets/Whitepapers/Bancor-Protocol-Whitepaper-en.pdf

    View Slide

  30. Price Calculation Per Transaction
    • T = Smart tokens received in exchange for E (reserve
    tokens), given R, S and F

    • E = Reserve tokens received in exchange for T (smart
    tokens), given R, S and F
    R - Reserve Token Balance

    S - Smart Token Supply

    F - Constant Reserve Ratio (CRR)

    View Slide

  31. #BODPSHFN

    View Slide

  32. Motivation
    • It takes money (Gas) to do with a block chain

    • It takes time for transactions

    • It takes cost to understand the structure and language of
    the block chain

    View Slide

  33. Motivation
    • Bancor Protocol implemented in Ruby

    View Slide

  34. Bancor
    • https://rubygems.org/gems/bancor

    • https://github.com/kurotaky/bancor

    View Slide

  35. Bancor Whitepaper Price Calculation Examples
    https://bravenewcoin.com/assets/Whitepapers/Bancor-Protocol-Whitepaper-en.pdf

    View Slide

  36. Demo

    View Slide

  37. View Slide

  38. View Slide

  39. $PODMVTJPO

    View Slide

  40. Conclusion
    • Implementing the Bancor protocol in Ruby makes it easy
    to simulate web applications built with Rails without using
    smart contracts

    View Slide

  41. Future plans
    • Decimal point operation

    • Ethereum World Idea implements in Ruby World

    • Ruby World Ideas implements in Ethereum World

    • Ruby Ethereum

    View Slide

  42. Enjoy
    RubyKaigi 2018 !!

    View Slide