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

0x Community Japan Meetup #1

1VQ9
October 27, 2018

0x Community Japan Meetup #1

Introduction of 0x community Japan meetup #1 and Introduction of 0x protocol.

1VQ9

October 27, 2018
Tweet

More Decks by 1VQ9

Other Decks in Technology

Transcript

  1. YQSPUPDPMΛ࢖༻͢ΔE"QQT։ൃऀͷίϛϡχςΟ YQSPUPDPMͷٕज़తͳϊ΢ϋ΢ͷ஝ੵɺڞ༗ ΨόφϯεϞσϧ΍ؔ࿈ϓϩδΣΫτͳͲʹؔ͢Δ৘ใͷڞ༗ dϲ݄ʹճఔ౓ͷษڧձ ࠓ೔ͷϥΠϯφοϓ d Y$PNNVOJUZ+BQBO Y1SPKFDUͷ঺հ 72 d

    5BMLBOE2"TFTTJPO .BUUGSPNY1SPKFDU d ٳܜ d 5BMLBOE2"TFTTJPO 8IJUOFZGSPN3BEBS3FMBZ d Y1SPUPDPMʹ͓͚ΔΨόφϯεʹ͍ͭͯ $P⒎FF5JNFT58 d ࠙਌ձ
  2. World in which all forms of value are tokenized on

    public blockchains ༷ʑͳܗͷՁ஋͕ύϒϦοΫɾνΣʔϯ্ͰτʔΫϯԽ͞Εͨੈք ௨՟ Currency ैདྷͷࢿ࢈ Traditional Assets σδλϧͳ঎඼ Digital Goods
  3. ' ! ! ! ! ! ! ! ! With

    centralized exchange, users has to give control of their assets to trusted third party தԝूݖతͳऔҾॴͰ͸ɺऔҾΛߦ͏ࡍʹɺ৴ པ͞Εͨୈࡾऀʹࢿ࢈Λ༬͚Δඞཁ͕͋Δ
  4. “Create a tokenized world where all value can flow freely.”

    zશͯͷՁ஋͕ࣗ༝ʹߦ͖དྷ͢ΔɺτʔΫϯԽ͞ΕͨੈքΛ࡞Δz 0xͷϛογϣϯ 0x Mission Statement
  5. makerAddress 0x000… makerAssetData ZRX makerAssetAmount 237 takerAddress 0x000… takerAssetData WETH

    takerAssetAmount 1 Order Object (JSON) ! ϝΠΧʔ͸஫จ಺༰Λهࡌͨ͠0SEFSΦϒδΣΫτ +40/ Λ࡞੒͠ɺ ൿີ伴Ͱॺ໊͢Δ Exchange contract ! Maker ) ! Taker )
  6. Exchange contract ! Maker ) ! Taker ) Signed Order

    Object (JSON) * ϝΠΧʔ͸ॺ໊ࡁ0SEFSΦϒδΣΫτΛ5BLFSͱڞ༗͢Δ Maker shares signed Order object with Taker
  7. Exchange contract ! Maker ) ! Taker ) ςΠΧʔ͸਺ྔΛࢦఆͯ͠&YDIBOHFDPOUSBDUͷϝιουΛݺͼग़͢ Taker

    invoke method of Exchange contract with amount to fill Signed Order Object (JSON) *
  8. ! Maker ! Taker Exchange contract ) ) 1 WETH

    ! 237 ZRX &YDIBOHFίϯτϥΫτ͕͓ޓ͍ͷ΢ΥϨοτͷؒͰτʔΫϯͷަ׵Λߦ͏ Exchange contract transfers tokens for each wallet directly
  9. 0xProject - Introduction Y1SPUPDPM YKTFYBNQMF { "metadata" : { "takerToken"

    : { "name" : "Wrapped Ether", "decimals" : 18, "symbol" : "WETH" }, "makerToken" : { "symbol" : "ZRX", "name" : "0x", "decimals" : 18 } }, "signedOrder" : { "expirationUnixTimestampSec" : "1535607960", "maker" : "0x00 “, "makerFee" : "0", "feeRecipient" : "0x0000000000000000000000000000000000000000", "takerTokenAmount" : "1000000000000000000", "makerTokenAddress" : "0xe41d2489571d322189246dafa5ebde1f4699f498", "ecSignature" : { "r" : "0xc370fdb353f34c22499dcb299338f7152ab48258d9bafec85c40ff420c58b390", "s" : "0x1f08d374ec972fa4034275c174ac445b8b0a3e9e03b8eab0b2588c203d388ccc", "v" : 27 }, "takerFee" : "0", "makerTokenAmount" : "100000000000000000000", "salt" : "525051204772790397684327286494460896733275278658192814608150085920209666577", "taker" : "0x0000000000000000000000000000000000000000", "takerTokenAddress" : "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "exchangeContractAddress" : "0x12459c951127e0c374ff9105dda097662a027093" } } 0SEFS0CKFDUͷྫ
  10. 0xProject - Introduction Y1SPUPDPM YKTFYBNQMF // fill͢ΔྔΛܾΊΔ const shouldThrowOnInsufficientBalanceOrAllowance =

    true; const fillTakerTokenAmount = ZeroEx.toBaseUnitAmount(new BigNumber(0.1), DECIMALS); // fillOrderAsync Ͱfill͢Δ const txHash = await zeroEx.exchange.fillOrderAsync( signedOrder, fillTakerTokenAmount, shouldThrowOnInsufficientBalanceOrAllowance, takerAddress, ); ! Taker
  11. ! Maker ! Taker Exchange contract Signed Order Object (JSON)

    * ) ) Signed Order Object (JSON) * Order Object (JSON) ! 0SEFSΦϒδΣΫτͷ࡞੒΍໿ఆɺΦʔμʔϒοΫͷ؅ཧɺΠϯλʔϑΣʔ εͷఏڙͳͲΛߦ͏ͷ͕ϦϨʔϠʔͷ໾ׂ Relayers maintains order book, provides user interface, creates order object and fill them
  12. ! ! ! ! ! ! ! ! ! !

    ! ! ! ! ! Liquidity Pool ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! Liquidity Pool Relayer B Relayer A Standard Relayer API 4UBOEBSE3FMBZFS"1*ʹ४ڌ͢Δ͜ͱͰɺ3FMBZFSಉ͕࢜ྲྀಈੑΛڞ༗͢Δ͜ͱ͕Մೳ With Standard Relayer API, Relayers can share their liquidity pool