Bitcoin Signetハンズオン

Bitcoin Signetハンズオン

ビットコインとか勉強会第34回にて、Bitcoin SignetをDockerで動かすハンズオンを行いました。

https://cryptocurrency.connpass.com/event/148425/

D3e027f453bb96ac1398cc98620f2920?s=128

Shu Kobuchi

October 17, 2019
Tweet

Transcript

  1. ϏοτίΠϯͱ͔ษڧձ #JUDPJO4JHOFUϋϯζΦϯ ೥݄೔!)BTI)VC খᔹप 4IV,PCVDIJ

  2. ࣗݾ঺հ 2 খᔹपɹ4IV,PCVDIJɹ!TIV@LPCTIVLPCVDIJ ෱Ԭݝ൧௩ࢢੜ·Εɹฌݿݝ੢ٶࢢɾๅ௩ࢢҭͪ ਆށେֶւࣄՊֶ෦ଔۀ ಸྑઌ୺Պֶٕज़େֶӃେֶ৘ใՊֶݚڀՊम࢜ྃ ৽ଔͰՈిϝʔΧʔͰιϑτ΢ΣΞ։ൃ ͦͷޙ4*FSͰͷडୗ։ൃ౳ େࡕͷϕϯνϟʔͰ#JUDPJO8FC8BMMFUࢼ࡞඼։ൃ ʙגࣜձࣾΩϡʔϒγεςϜ

    w ʙେࡕʹͯɺڭҭܥେن໛جװγεςϜͷ։ൃͱอक w ʙɹ౦ژసۈɺٕज़ઓུࣨʢϒϩοΫνΣʔϯͳͲʣ ʙϑϨηοπגࣜձࣾͷγχΞιϑτ΢ΣΞΤϯδχΞ w Ծ૝௨՟ࣄۀऀ޲͚΢ΥϨοτ։ൃΛ୲౰
  3. ίϛϡχςΟ঺հ ೔ຊ҉߸௨՟ϢʔβձɹIUUQTDSZQUPDVSSFODZDPOOQBTTDPN ʮϏοτίΠϯͱ͔ษڧձʯʢ݄̍ճɿฏ೔໷ʣ w ࣍ճ͸೥݄೔ ౔ ʲಛผاըʳ.0/"ࡇΓ!ळ༿ݪ ʮ҉߸௨՟ಡॻձʯʢ݄̍ճɿฏ೔໷ʣ w ࣍ճ͸೥݄೔

    ਫ αΠυνϟωϧ߈ܸ!౦ژେֶೆݚڀ౩ DSBTIBDBEFNZ *5ܥಈը഑৴ ʹͯϏοτίΠϯͱ͔ษڧձͷΞʔΧΠϒ഑৴த
 IUUQTDSBTIBDBEFNZDPNNVOJUZDSZQUPDVSSFODZ :PV5VCFνϟϯωϧʢษڧձʗಡॻձʣIUUQCJUMZZPVUVCFDDTUVEZ 3
  4. ࠓճͷૂ͍ CJUDPJOE #JUDPJO$PSF Λ৮ͬͨ͜ͱͳ͍ਓͰ΋ɺ#JUDPJOϓϩάϥϜͷೖ໳ ͕Ͱ͖Δ CJUDPJOE #JUDPJO$PSF Λ৮ͬͨ͜ͱ͋ΔਓͰ΋ɺ4JHOFUΛ஌ΕΔ
 %PDLFSͰͷ։ൃʹࢹ໺Λ޿͛Δ͜ͱ͕Ͱ͖Δ 4

  5. ։ൃ༻ωοτϫʔΫ ։ൃʹຊ෺ͷϏοτίΠϯΛ࢖ͬͯɺࣗ෼͔Βࣗ෼ʹૹۚͨ͠ͱͯ͠΋ωοτ ϫʔΫख਺ྉ͕͔͔Δ ։ൃ༻ʹؾܰʹૹ͕ۚͰ͖ΔΑ͏5FTUOFU͕ଘࡏ͢Δ 5FTUOFU#5$͸ແՁ஋ 5 Maine ʢຊ෺ʣ Testnet ಠཱ

  6. 4JHOFU։ൃऀͱ4JHOFU։ൃͨ͠ཧ༝ ,BMMFXPPG ,BSM+PIBO"MNʮ5FTUOFU͸յΕ͍ͯΔɻϒϩοΫͱ͔SFPSH͢Δ͠ʯ 3FHUFTU͸ωοτϫʔΫͰ͸ͳ͍ ϒϩοΫʹॺ໊͢Δͷ͕4JHOFU 6

  7. খᔹ͕ߟ͑Δ5FTUOFUͷ໰୊఺ 1P8ܕͷ5FTUOFU͸ϚΠχϯάͷϋογϡύϫʔ͕҆ఆ͠ͳ͍ 5FTUOFU͸ϚΠφʔ͕ϚΠχϯάͷςετʹ΋࢖͍ͬͯͯɺ#JUDPJOͷϒ ϩοΫੜ੒ִ͕ؒඵͱ͔ʹͳͬͨͱ͖΋ ൓໘ɺύϫʔμ΢ϯ͢Δͱɺʙ෼ʹϒϩοΫ w #JUDPJOͩͱ5FTUOFUͰ΋෼ʹϒϩοΫ ଞͷ௨՟΋5FTUOFU͸҆ఆ͠ͳ͍ &UIFSFVN5FTUOFU3PQTUFOͰ*TUBOCVM)BSE'PSLࣦഊ Ϣʔβ͸ϑϧϊʔυΛΞοϓάϨʔυ͍͕ͯͨ͠ɺ3PQTUFOओཁϚΠφʔ

    ͕஌Βͳ͔ͬͨ ϋʔυϑΥʔΫͨ͠νΣʔϯͷϒϩοΫ͕Կ࣌ؒ΋۷ΒΕͳ͍ࣄଶʹ 5FTUOFUͷίΠϯ͸ແՁ஋Ͱ1P8ͷΠϯηϯςΟϒ͕ͳ͘ɺ1P8ܕ5FTUOFU͸ ෆ҆ఆ 7
  8. #JUDPJOͰ΋1P"ܕ5FTUOFU͕஀ੜ 3JOLFCZ ,PWBO 1SPPGPG"VUIPSJUZɿ1P" தԝूݖܕঝೝ #JUDPJOͰ1P"͸ͳ͔͕ͬͨɺ4JHOFU͕Α͏΍͘ొ৔ 8

  9. CUDOFXTͰͷղઆ IUUQTCUDOFXTKQZOEKY 9

  10. %PDLFSΛΠϯετʔϧ %PDLFSΛΠϯετʔϧ IUUQTXXXEPDLFSDPN .BDʹ%PDLFSΛΠϯετʔϧ IUUQTIVCEPDLFSDPNFEJUJPOTDPNNVOJUZEPDLFSDFEFTLUPQ NBD 6CVOUVʹ%PDLFSͱ%PDLFSDPNQPTFΛΠϯετʔϧ IUUQTRJJUBDPNZPVUBOHBJJUFNT⒎DF⒎BFCBG 10

  11. %PDLFSͰ4JHOFUϊʔυΛ্ཱͪ͛Δ NLEJSXPSLTQBDF DEXPSLTQBDF HJUDMPOFIUUQTHJUIVCDPNLBMMFXPPGTJHOFUQMBUGPSNHJU DETJHOFUQMBUGPSNGVMMOPEF SVOTI DE)0.&EPDLFSTJHOFU WJCJUDPJODPOG·ͨ͸OBOPCJUDPJODPOG Ұߦ໨ɿFTJHOFUͷzFzΛফͯ͠อଘ DE)0.&XPSLTQBDFTJHOFUQMBUGPSNGVMMOPEF

    SVOTI ˞੨ࣈ͸λʔϛφϧͰ࣮ߦ͢ΔίϚϯυ 11
  12. %PDLFSͰ4JHOFUϊʔυΛ্ཱͪ͛Δ ผͷλʔϛφϧΛ։͍ͯ EPDLFSQTTJHOFUͷίϯςφ*%Λݟ͚ͭΔʢجຊ͸Ұ൪্ʹ͋Δ͸ͣʣ *%999TJHOFUͷίϯςφ*% BMJBTCDMJEPDLFSFYFD*%CJUDPJODMJ CDMJHFUCMPDLDIBJOJOGP ࣍ทͷΤΫεϓϩʔϥͱϒϩοΫΛݟൺ΂ͯ·͠ΐ͏ 12

  13. 4JHOFUϒϩοΫνΣʔϯΤΫεϓϩʔϥ IUUQTFYQMPSFSCDKQ 13

  14. #JUDPJO/FUXPSLผͷϒϩοΫ਺ൺֱ 4JHOFU·ͩສϒϩοΫʹຬͨͳ͍ͷͰ͙͢ʹಉظ 59΋গͳ͘༰ྔ΋͍ܰ 5FTUOFUͩͱສϒϩοΫ ͨͩ͠59͸গͳ͍ .BJOOFUͩͱ΋͏͙͢ͰສϒϩοΫ 59͸ଟ͍ͷͰɺ59΋શͯऔಘ͢Δͱ༰ྔ͸େ͖͍ 14

  15. HFUDPJO EPDLFSFYFD*%HFUDPJOTTI 1BZNFOUPG#5$TFOUXJUIUYJE EBFDCDBBGDBCCEGCGCF FBFC CDMJHFUVODPOpSNFECBMBODF  IUUQTFYQMPSFSCDKQ
 Ͱ59Λݕࡧ 15

  16. ΞυϨεΛऔಘ CDMJHFUOFXBEESFTT D(#25"#8VHG#5XR#NVKT)XCSK2 CDMJHFUOFXBEESFTTCFDI TCROTGUHEXUQLYXQTWWWKTDNZIBO 16

  17. 'BVDFUΛཱͯΔ DE)0.&XPSLTQBDFTJHOFUQMBUGPSNGBVDFU SVOTI ผλʔϛφϧ DE)0.&CJUDPJO@EBUBEJS WJCJUDPJODPOG·ͨ͸OBOPCJUDPJODPOG Ұߦ໨ɿFTJHOFUͷzFzΛফͯ͠อଘ ಉظ͢Δ·Ͱ͠͹Β͘଴ͭ IUUQMPDBMIPTUʹϒϥ΢βͰΞΫηε 17

  18. 'BVDFUͷը໘ ઌ΄Ͳೖखͨ͠ΞυϨεΛೖྗͯ͠4JHOFU#5$Λήοτ ҰఆֹΛ΋Β͍ͬͯΔͱ͖ͳͲ͸z/VIVIzͱදࣔ͞Ε΋Β͑ͳ͍ 18

  19. &YQMPFSFSͷ্ཱͪ͛ DE)0.&XPSLTQBDFTJHOFUQMBUGPSNFYQMPSFS TUBSUTI QPSU͕࢖ΘΕ͍ͯΔࢫͷΤϥʔ͸'BVDFU͕࢖͍ͬͯΔ͔Β EPDLFSQTͰGBVDFUͷίϯςφ*%Λௐ΂Δ EPDLFSTUPQ999 TUBSUTI΋͏Ұճ IUUQMPDBMIPTUʹϒϥ΢βͰΞΫηε 19

  20. FYQMPSFSͷCBDLFOE FYQMPSFSͷCBDLFOEͷDPPLJF໰୊ explorer_backend_1 | 2019-10-15T15:54:24.369+00:00 - WARN - reconnecting to

    bitcoind: failed to read cookie from "/root/.bitcoin/ signet/.cookie" ผλʔϛφϧͰ TUPQTI DE)0.&CJUDPJO@EBUBEJS OBOPCJUDPJODPOG SQDVTFS SQDQBTTXPSEΛίϝϯτΞ΢τ DE)0.&CJUDPJO@EBUBEJSTJHOFU OBOPDPPLJFԼهΛهೖͯ͠อଘ @@DPPLJF@@FGFBBBDEDFEEC GDGFFDB TUBSUTI 20
  21. 4JHOFU#MPDL&YQMPSFS -PDBMͰͷ্ཱͪ͛੒ޭ 21

  22. 1SJWBUF4JHOFUͰϒϩοΫੜ੒ "%%3 CDMJHFUOFXBEESFTT  13*7,&: CDMJEVNQQSJWLFZ"%%3  CDMJHFUBEESFTTJOGP"%%3cHSFQQVCLFZ QVCLFZ FCECFEDFFGDDDCFDGC

    GCBE  FDIP13*7,&: ;$WS["#ST3'%DHFNS:.'3$TG"3BEIUJQ;P2#T%Y;/Y6S,S  4$3*15FCECFED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TUCMPDLIBTI lGEBEEFDBD⒎FFFGBGGD BFDE 26
  27. ϒϩοΫੜ੒ใुΛૹΔ59Λ֬ೝ ϒϩοΫੜ੒ใु͸ঝೝ͠ͳ͍ͱ࢖͑ͳ͍ ࢒ߴʹ΋൓ө͞Εͳ͍  $ bcli listtransactions [ { "address":

    "c8o7PwcL9r8gKVwQF8CmKU8gfsz7rijWH7", "category": "immature", "amount": 50.00000000, "label": "", "vout": 0, "confirmations": 2, "generated": true, "blockhash": "000024347b5a6441ac73a15db9d622afc3660b916f409e59709312a470e1641e", "blockindex": 0, "blocktime": 1571291254, "txid": "d4a2d4a289dc89de0bd7cd5357238859cac137f13373c273273c81565ce28a37", "walletconflicts": [ ], "time": 1571291254, "timereceived": 1571291289, "bip125-replaceable": "no" }, { "address": "cJiHCEyTmFKa7vrGMBZKtBsWLtbgxBRhb2", "category": "immature", "amount": 50.00000000, "label": "", "vout": 0, "confirmations": 1, "generated": true, "blockhash": "0000030f40d78a8d4dec84338ac04ff316409e41e2e55696fa3f2f7c6ae64c9d", "blockindex": 0, "blocktime": 1571291584, "txid": "dd38dedddd96bff0ee1ea9c127f7e49a2e05c8e2fb99e33d50de5b1120867480", "walletconflicts": [ ], "time": 1571291584, "timereceived": 1571291590, "bip125-replaceable": "no" } ] 27
  28. ࢀߟʣCJUDPJOEΛϏϧυͯ͠TJHOFU࢖༻ IUUQTHJTUHJUIVCDPNLBMMFXPPG CEECFECGEBEEDDEBBB 28

  29. ࢀߟʣCJUDPJOEΛϏϧυͯ͠TJHOFU࢖༻ .BDͩͱ͏·͍͔͘ͳ͍͔΋ 7BHSBOUͰ6CVOUVೖΕΔͳΓͯ͠ࢼ͍ͯͩ͘͠͞ Ϗϧυલʹґଘ͢ΔϥΠϒϥϦΛΠϯετʔϧ͓ͯ͘͠ IUUQTRJJUBDPNLFBDIJUFNTCCDDFG HJUDMPOFIUUQTHJUIVCDPNCJUDPJOCJUDPJO DECJUDPJO HJUGFUDIPSJHJOQVMMIFBETJHOFU HJUDIFDLPVUTJHOFU BVUPHFOTI

    DPOpHVSF NBLF ˢNBLFKͩͱɺWJSUVBMNFNPSZFYIBVTUFE$BOOPUBMMPDBUFNFNPSZ TVEPNBLFJOTUBMM 29
  30. ίϛϡχςΟ঺հ ೔ຊ҉߸௨՟ϢʔβձɹIUUQTDSZQUPDVSSFODZDPOOQBTTDPN ʮϏοτίΠϯͱ͔ษڧձʯʢ݄̍ճɿฏ೔໷ʣ w ࣍ճ͸೥݄೔ ౔ ʲಛผاըʳ.0/"ࡇΓ!ळ༿ݪ ʮ҉߸௨՟ಡॻձʯʢ݄̍ճɿฏ೔໷ʣ w ࣍ճ͸೥݄೔

    ਫ αΠυνϟωϧ߈ܸ!౦ژେֶೆݚڀ౩ DSBTIBDBEFNZ *5ܥಈը഑৴ ʹͯϏοτίΠϯͱ͔ษڧձͷΞʔΧΠϒ഑৴த
 IUUQTDSBTIBDBEFNZDPNNVOJUZDSZQUPDVSSFODZ :PV5VCFνϟϯωϧʢษڧձʗಡॻձʣIUUQCJUMZZPVUVCFDDTUVEZ 30