ææŠãã
ã€ãŒãµãªã¢ã ã¹ããŒãã³ã³ãã©ã¯ãã®éçºè
ã¯ãäžèŠåçŽãªåé¡ã«çŽé¢ããããšããããããŸã-å°æ¥ãŸãã¯ã¹ã±ãžã¥ãŒã«ã§ã¹ããŒãã³ã³ãã©ã¯ãã³ãŒããåŒã³åºãã ããããé©åãªè§£æ±ºçã¯ãªããå¥çŽãåŒã³åºãããã®å¥åã®ãµãŒãã¹ãéçºããå¿
èŠããããŸãã
MyWishãã©ãããã©ãŒã çšã®é£çµ¡å
ãã³ãã¬ãŒããéçº
ããéãããã«ãã®å¶éã«çŽé¢ããŸããã ãããŠããã®å¶éããçŸãããåé¿ãããšããç®æšããåæ£åãœãªã¥ãŒã·ã§ã³ã®å©ããåããŠèšå®ããŸããã ãã®ã·ã¹ãã ã¯å¥çŽãéçšããå¿
èŠããããããè±åœã®ç©çåŠè
James Jouleã«æ¬æãè¡šããŠãJouleãšåä»ããããšã«ããŸããã
ãã®èšäºã§ã¯ããžã¥ãŒã«ã®éçºãã·ã¹ãã ã®åºç€ã圢æãããœãªã¥ãŒã·ã§ã³ãããã³åŸãããçµæã«ã€ããŠã話ããããšæããŸãã éçºã¯ããçšåºŠé©æ°çã§ãããé©çšããããœãªã¥ãŒã·ã§ã³ã¯Habrã®èŠèŽè
ã«ãšã£ãŠèå³æ·±ãæçšã§ãããšä¿¡ããŠããŸãã
ãœãªã¥ãŒã·ã§ã³ã説æããåã«ãEthereumãããã¯ãã§ãŒã³ã¹ããŒãã³ã³ãã©ã¯ãã«é¢ããåºæ¬çãªããšãäŒããå¿
èŠããããŸãã
ã¹ããŒãã³ã³ãã©ã¯ã
ã€ãŒãµãªã¢ã ã¹ããŒãã³ã³ãã©ã¯ãã¯ã
EVM ïŒã€ãŒãµãªã¢ã ä»®æ³ãã·ã³ïŒç°å¢ã§å®è¡ãããããã°ã©ã ã§ãã ãã®ãããªåå¥çŽã«ã¯ãäžæã®ã¢ãã¬ã¹ãæ®é«ïŒãšãŒãã«ïŒãã¹ããŒã¿ã¹ïŒèªã¿åãå°çšã¡ã¢ãªïŒãããã³åŒã³åºãã«äœ¿çšå¯èœãªïŒãŸãã¯æ©èœãªãã®ïŒé¢æ°ã®ã»ããããããŸãã
å¥çŽã®ã³ãŒããæ®é«ãã¹ããŒã¿ã¹ã¯ãããã¯ãã§ãŒã³ã«ä¿åãããŸãã
ãŠãŒã¶ãŒã¯ããã©ã³ã¶ã¯ã·ã§ã³ã䜿çšããŠã³ã³ãã©ã¯ãé¢æ°ãåŒã³åºãããšãã§ããŸãã ãŸãã¯ãé¢æ°ãå¥çŽãŸãã¯ä»ã®èª°ãã®æ®é«ã®ç¶æ
ãå€æŽããªãå Žåããã©ã³ã¶ã¯ã·ã§ã³ãªãã
å¥çŽã®æ¹æ³ã¯ãè€éã§ãå®è£
ãä»»æã§ãããåæ瀺ãå®äºããããã«å¿
èŠãªã¬ã¹ã«ãã£ãŠã®ã¿å¶éãããŸãã å¥çŽã¯æ®é«ãå€æŽããããä»ã®å¥çŽãåç
§ããããä»ã®ãããã¯ãŒã¯åå è
ããè³éãåãåãããšãã§ããŸãã
ã€ãŒãµãªã¢ã ã¯ããŠãŒã¶ãŒã ããå¥çŽåŒã³åºãã§ãããã¯ãŒã¯äžã§ãã©ã³ã¶ã¯ã·ã§ã³ãéå§ã§ããããã«é
眮ãããŠããŸãã ããšãã°ãã³ã³ãã©ã¯ããæ©èœããããã«ãç¹å®ã®ç¬éã«ã¡ãœãããåŒã³åºãå¿
èŠãããå ŽåããŠãŒã¶ãŒã¯ãããå¿é
ããå¿
èŠããããŸãã
ã³ãŒã«ã·ã¹ãã
æåã®æãããªè§£æ±ºçã¯ãé©åãªã¿ã€ãã³ã°ã§ãããã¯ãŒã¯ã«ãã©ã³ã¶ã¯ã·ã§ã³ãå
¬éãããµãŒãã¹ã§ãã
ãã®ãœãªã¥ãŒã·ã§ã³ã«ã¯å€§ããªæ¬ ç¹ããããŸã-ããã¯éäžåãœãªã¥ãŒã·ã§ã³ã§ãã ããšãã°ããµãŒãã¹ãé
眮ãããŠãããµãŒããŒã§äœããçºçããå Žåãæ¯æããè¡ãããªãããã«åæããããã眰éãç§ããããªã©ãåŒã³åºãã¯è¡ãããŸããã ãã®ãããå¥çŽã¯å±¥è¡ããããåãå
¥ããããŸããã
ãã®æ¬ ç¹ãåé¿ããããã«ãç§ãã¡ã®ããŒã ã¯ã¹ããŒãã³ã³ãã©ã¯ãã«åºã¥ããŠå®è£
ããããžã¥ãŒã«ã·ã¹ãã ãçºæããŸããã
ãžã¥ãŒã«
Jouleã¯ã
Ethereumãããã¯ãŒã¯äžã®ã¹ããŒãã³ã³ãã©ã¯ãã§ãããç¹å®ã®æç¹ã§ä»»æã®ã³ã³ãã©ã¯ããžã®åŒã³åºããç»é²ã§ããŸãã
Jouleã¯ãEthereumãŠãŒã¶ãŒãç»é²æžã¿ã®å¥çŽãåŒã³åºãæ©èœãæäŸããŸãã
ãããã¯ãŒã¯åå è
ãé»è©±ããããããã«åæ©ä»ããããã«ãå ±é
¬ãšããŒãã¹ãæ¯æãããŸãããããã¯ãé»è©±ãç»é²ããããšãã«èšå®ãããŸãã å ±é
‹njèŠãªéé¡ã®èšç®ã¯
ãžã¥ãŒã«ãè¡ããŸãã å ±é
¬ã®é¡ã¯ãé話ã«è²»ããããã¬ã¹ã®è²»çšãå®å
šã«è³ããŸãã ããŒãã¹ããŒãã®åœ¢ã§ã
WISHããŒã¯ã³ã¯é話ã«å¯ŸããŠæ¯æãããŸãïŒçŸåšã®ããŒãžã§ã³ã§ã¯å®è£
ãããŠããŸããïŒã
ã·ã¹ãã ã§ã¯ãå€ãã®å¥çŽã³ãŒã«ãåãã¿ã€ã ã¹ã¿ã³ãã§èšé²ã§ããŸãã ãŸããç°ãªãæéã«åãå¥çŽãç»é²ã§ããŸãã å¯äžã®å¶éã¯ãå®å
šã«åäžã®ãã©ã¡ãŒã¿ãŒã»ããïŒå¥çŽäœæãæéãã¬ã¹ããã³ã¬ã¹äŸ¡æ ŒïŒã§ç»é²ããããšãã§ããªãããšã§ãã
Joule㯠ãã€ãŒãµãªã¢ã ãããã¯ãŒã¯å¥çŽãšåæ§ã«ãè€æ°ã®ãŠãŒã¶ãŒãåæã«èªåèªèº«ã«é»è©±ããããããšãèš±å¯ããŸãã ãããŠãã³ãŒã«ã«å©çšå¯èœãªå¥çŽãããå€ãã®
Jouleãžã®ã³ãŒã«ããããããããŸããã ãã®å Žåãæåã®çºä¿¡è
ã®ã¿ãå ±é
¬ãåãåããŸãã
ãŠãŒã¶ãŒã¯ïŒã¹ããŒãã³ã³ãã©ã¯ãã¡ãœãããŸãã¯Webã€ã³ã¿ãŒãã§ã€ã¹ã䜿çšããŠïŒãã€ã§ããã©ã®ã³ã³ãã©ã¯ããã³ãŒã«ãã¥ãŒã«ãããã©ã®æç¹ã§ãã®ã³ãŒã«ãè¡ãå¿
èŠãããããç¥ãããšãã§ããŸãã å¥çŽã®å±¥è¡ã«å¿
èŠãªå ±é
¬ãšã¬ã¹ã®éã
ãžã¥ãŒã«å¥çŽããå
¥æã§ããŸãã
Jouleã¯ãç»é²äžã«æå®ãããæéãŸã§ã«å¥çŽãåŒã³åºãããªãããšãä¿èšŒããåŒã³åºãã®é åºãä¹±ãããšãèš±å¯ããŸããã
å®è£
ã®æè¡çå°é£
Jouleã®ãããªè€éãªå¥çŽãäœæããã«ã¯ãå€æ°ã®æè¡çãªåé¡ã解決ããå¿
èŠããããŸãã ãããã®ã¿ã¹ã¯ã®1ã€ã¯ãããŸããŸãªå¥çŽäœæãšãã®åŒã³åºãæéïŒããã³ãã®ä»ã®ãã©ã¡ãŒã¿ãŒïŒãä¿åããããšã§ãã ãã¥ãŒã«ããæåã®1ã€ãååŸããŠã³ã³ãã©ã¯ããåŒã³åºãããšã¯ãäžå®æéïŒã·ã¹ãã ã«ç»é²ãããŠããã³ã³ãã©ã¯ãã®æ°ã«é¢ä¿ãªãïŒè¡ãå¿
èŠããããŸãã
æå°ã®ã¬ã¹æ¶è²»ã§ãã¢ã«ãŽãªãºã ã®éžæã®å¿
èŠæ§ã®éçºã«ãããè¿œå ã®å°é£ã ããšãã°ãã¢ã«ãŽãªãºã ã®è€éããè¶
ãããœãªã¥ãŒã·ã§ã³ãé©çšããããšã¯ã§ããŸãã
ã ã¬ã¹ã®ã³ã¹ãã«å ããŠãã¬ã¹ã®æ°ã«ã¯ãŸã å¶éããããŸãã ããšãã°ãè€éãªã¢ã«ãŽãªãºã ã䜿çšããŠæ¬¡ã®èŠçŽ ãæ€çŽ¢ããå Žå
ãåèŠçŽ ã®æ€çŽ¢ã«ã¯
50,000åã®ã¬ã¹ãå¿
èŠã«ãªããŸã
ã185åã®èŠçŽ ãè¿œå ãããšãå¥çŽã§ã¯æ€çŽ¢ã§ããªããªããŸãïŒçŸåšã®ãã©ã³ã¶ã¯ã·ã§ã³ããã
4,600,000åã®ã¬ã¹å¶éïŒã
解決ç
ãã®ç« ã§ã¯ãJouleã·ã¹ãã ã«å«ãŸããäž»èŠãªæè¡ãœãªã¥ãŒã·ã§ã³ã«ã€ããŠèª¬æããŸãã
ã¬ã³ãŒãæ§é
ç¶æ
ïŒæ®é«ãé€ãïŒãä¿åããããã«ãå¥çŽã¯Key-Valueã¹ãã¬ãŒãžã«ã¢ã¯ã»ã¹ã§ããŸãã ãªããžããªã®ããŒã«ã¯ãä»»æã®256ãããæ°ã䜿çšã§ããŸãã å®éãä¿åããåã«ãEVMã¯
keccakïŒsha-3ïŒã¢ã«ãŽãªãºã ã䜿çšããŠããŒãã§ãã¯ãµã ãèšç®ããŸã
ã å€ã¯256ãããã®æ°å€ã§ããããŸãïŒã³ã³ãã€ã©ãŒã¯ããªãã»ãããã©ã¡ãŒã¿ãŒãããŒã«è¿œå ããããšã«ãããå€ããã倧ããªç¶æ
ã«ããããšãã§ããŸãïŒã ãããã£ãŠãã³ã³ãã©ã¯ãã¯ãããã256ãããã®2 ^ 256åã®äžæã®å€ãæ ŒçŽã§ããŸããããã¯ãããŒãºãããæ¡éãã«å€§ãããªããŸãã
ããŒå€ã¹ãã¬ãŒãžã¯ã2 ^ 256次å
ã®ã©ã³ãã ã¢ã¯ã»ã¹ã¡ã¢ãªé åãšèŠãªãããšãã§ããŸãã ãã®å ŽåãããŒã¯ã¡ã¢ãªãã±ãŒã·ã§ã³ãžã®åç
§ã§ãã ã³ãŒã«ç»é²ãä¿åããããã«å¿
èŠãªããŒã¿æ§é ã¯ãå¥çŽã®äœæãå¥çŽã³ãŒã«ã®æéãå¥çŽãã³ãŒã«ããã®ã«å¿
èŠãªã¬ã¹ã®éãããã³ã¬ã¹ã³ã¹ãã®ãã£ãŒã«ãã§æ§æãããŸãã ãã®ããŒã¿ã¯ãã¹ãŠ256ãããïŒ32ãã€ãïŒã«åãŸããŸãã
å¶éäºé
ãã®ããŒã¿ã¹ãã¬ãŒãžæ§é ã䜿çšããŠãããã€ãã®å¶éãåãå
¥ããå¿
èŠããããŸãã
- ã¢ãã¬ã¹ -20ãã€ãïŒEthereumãããã¯ãŒã¯ã¢ãã¬ã¹ïŒã
- ã¿ã€ã ã¹ã¿ã³ã -4ãã€ããæšæºUnixæéå€ã1970-01-01 00:00:00ãã2106-02-07T09ãŸã§æå¹ïŒ28:15ïŒç¬Šå·ãªãã®å€ã®å ŽåïŒã ç°¡åã«èšãã°-æ倧ç»é²æéã¯2106ã§ãã å°æ¥ããã®å€ã¯ãã¬ã¹å€ã®ãã£ãŒã«ãããäœåãªãã€ãã䜿çšããããã6812ã«å¢ããããšãã§ããŸãã
- ã¬ã¹ -4ãã€ãã§ãããå®éã«ã¯ãããã¯ãŒã¯ã§ã¯ã4,600,000ãè¶
ããªãã¬ã¹ã§1ã€ã®ãã©ã³ã¶ã¯ã·ã§ã³ãå®è¡ã§ããŸãã ãžã¥ãŒã«ã·ã¹ãã ãéçšããããã®ã¬ã¹ã³ã¹ããèãããšãå¥çŽãåŒã³åºãããæç¹ã§ã1å¥çŽããã400äžã®ã¬ã¹ã®å¶éãçŸåšèŠå®ãããŠããŸãã ãã¡ããããžã¥ãŒã«ã®åäœã«ã¯600,000ã®ã¬ã¹ã¯å¿
èŠãããŸããããå¹³åã§50,000ã®ã¬ã¹ã§ååã§ãã
- ã¬ã¹äŸ¡æ Œ -4ãã€ãã ç»é²æã®ã¬ã¹ã®æšå®ã³ã¹ãã ãã®å€ã¯gweiïŒ10 ^ 9 weiïŒã«æ ŒçŽããããããæå°ãµã€ãºã¯0.000000001ãšãŒãã«ã§ãæ倧ãµã€ãºã¯4.294967296ãšãŒãã«ã§ãã
ã¬ã³ãŒããã§ãŒã³ã¹ãã¬ãŒãž
ã¹ããŒãã³ã³ãã©ã¯ãã¯ãããŒã¿ã»ãããæ ŒçŽããããã®2ã€ã®æ§é ããµããŒãããŸããã€ã³ããã¯ã¹ã«ããã¢ã¯ã»ã¹ãæã€é
åãšãããŒã«ããã¢ã¯ã»ã¹ãæã€ãããã³ã°ã§ãã ãã ããå®éã«ã¯é
åã¯ãããã³ã°ãšããŠæ ŒçŽãããŸããããŒã¯ã€ã³ããã¯ã¹ã§ãããã¢ã¯ã»ã¹é床ã«å©ç¹ã¯ãããŸããã ããã«ãé
åã®äžå€®ã«èŠçŽ ãæ¿å
¥ããã«ã¯ããã¹ãŠã®èŠçŽ ãã·ããããå¿
èŠããããããã«ã¯èš±å®¹ã§ããªãéã®ã¬ã¹ãå¿
èŠã«ãªãå ŽåããããŸãã ãããã£ãŠããªã³ã¯ãªã¹ãã«åºã¥ããœãªã¥ãŒã·ã§ã³ã¯ããã®ã¿ã¹ã¯ã«ããé©ããŠããŸãã
ãªã¹ããæ¯çã§ä¿åããããã«ã次ã®ãã¯ãããžãŒã䜿çšãããŸããã¬ã³ãŒãå€ïŒ32ãã€ãïŒã¯ã次ã®å€ãžã®ããŒïŒãŸãã¯ãC ++èšèªãšã®é¡äŒŒæ§ãåŒãåºãå Žåã®ãªã³ã¯ïŒãšèŠãªãããŸãã
å·Šã®ç»åã¯ãç»é²ã¬ã³ãŒã
RãšããŒååŸæ©èœã瀺ããŠããŸã
å€ã®ãã§ãŒã³ã®åœ¢ã§ã å³åŽã«ã¯ãããŒãã«åœ¢åŒã®ããŒãšå€ã®ã¹ãã¬ãŒãžããããŸãã å€ãèŠãããŸã
次ã®å€ãžã®å¯äžã®ããŒã§ãããšããäºå®ã®ããã«å€±ãããŸãã å¥çŽã§ã¯ãæ¯çããããŒãèªã¿åãæ¹æ³ã¯ãããŸããã ãããè¡ãããã«ãããŒãã«ã«ã¯ãã«ãšã³ããªïŒãããïŒãå«ãŸããŠããŸããããã¯åžžã«ãã§ãŒã³ã®å
é ã®å€ã瀺ããŸãã
ãã§ãŒã³å
ã®ãšã³ããªã®é åºã¯æç³»åã®éã§ãåŒã³åºããã次ã®å¥çŽãå³åº§ã«åãåããŸãã åãç»é²æå»ãè¿œå é ã«æ¬¡ã
ãšäžŠã¹ãããŸãã
玢åŒ
ç»é²ã®ãªã¹ãããœãŒãé ã«ç¶æããã«ã¯ãæ¥ä»ã«åŸã£ãŠãšã³ããªãæ¿å
¥ããå¿
èŠããããŸãã æ°ããå€ãæ¿å
¥ããå Žæã®æ€çŽ¢ãé«éåããããã«ãããªãŒããŒã¹ã®ã€ã³ããã¯ã¹ãéçºãããŸããã
ãã®ã¢ãããŒãã§ã¯ãããªãŒå
ã®èŠçŽ ãæ€çŽ¢ãããšãdevå
ã®èŠçŽ ã®æ°ã«äŸåããªãäžå®ã®å€ã®è€éããåŸãããŸã
ã ããæªãã·ããªãªããããçŸåšã®å®è£
ã§ã¯
168åã®æ€çŽ¢ã§ãã ããªãŒã®ãã©ã³ã¹ã¯ãã¬ãã«ãšèŠå ã®æ°ãå€æŽããããšã§éžæã§ããŸãã
åã®ã¬ãã«ãšåæ§ã®æåŸã®ã¬ãã«ã«ã¯ãæ倧ã¿ã€ã ã¹ã¿ã³ããšæå°ã¿ã€ã ã¹ã¿ã³ãã®å€ãå«ãŸããŸãã
é
眮ãšã³ã³ããŒãã³ã
ãããã¯ãã§ãŒã³å
ã®å¥çŽã®ã³ãŒãã¯å€æŽã§ããŸããã ãããŠãå€æŽã®å Žåã«ã¯ãå¥çŽã®æ°ããããŒãžã§ã³ãé
眮ããå¿
èŠããããŸãã åæã«ãããŒã¿ïŒç¶æ
ïŒã¯å€ãããŒãžã§ã³ãã転éããå¿
èŠããããŸãã æ¥è§Šç¶æ
ã¯å€éšããã¢ã¯ã»ã¹ã§ããªããããããã¯å¿
ãããç°¡åã§ã¯ãããŸããã ãŸããå¥çŽã«æåã«ç¶æ
ã«ã¢ã¯ã»ã¹ããæ©èœããªãå Žåã転éã¯ã»ãšãã©äžå¯èœã«ãªããŸãã å·ãšåæ§ã«ãäºåã«æºåãããæ©èœããªããã°ãå¥çŽããã®è³éã移ãããšã¯ã§ããŸããã
ãããã®åé¡ã解決ããããã«ã
Jouleå¥çŽã¯ããã€ãã®åå¥ã®å¥çŽã«åå²ãããŠããŸãã
Jouleãšã³ã·ã¹ãã ã¯ã次ã®å¥çŽã§æ§æãããŠããŸãã
- Joule-å¥çŽã®ç»é²ãšåŒã³åºãã®äž»èŠãªããžãã¯ãå®è£
ããå¥çŽ
- ãããã·-Jouleã®æ©èœã«ã¢ã¯ã»ã¹ããããã®ãããã³ãã³ã³ãããŒã©ãŒã®æ©èœãšã®å¥çŽã ãããã·ã¯ç»é²ãåŒã³åºããåãå
¥ããç»é²ãããå¥çŽããã®åŒã³åºãã¯ãã®ã¢ãã¬ã¹ããçºä¿¡ãããŸãã ãŠãŒã¶ãŒåŽã®Jouleãšã®å¯Ÿè©±ã¯ïŒãŠãŒã¶ãŒã®åœ¹å²ã«é¢ä¿ãªãïŒ Proxyãä»ããŠè¡ãããŸãã
- Vault-åŒã³åºããè£åããããã®è³éã®ãªããžããªã
- ç»é² - ç»é²ãå«ãäžé£ã®ã¬ã³ãŒããä¿åããå¥çŽã
- ã€ã³ããã¯ã¹ -æ°ããå¥çŽãæ¿å
¥ããã¬ãžã¹ã¿å
ã®å Žæããã°ããèŠã€ããããã®å¥çŽã
- ç¶æ
-åºæ¬çãªã¹ãã¬ãŒãžæ©èœãå®è£
ããå¥çŽã ã€ã³ããã¯ã¹ããã³ç»é²å¥çŽã§äœ¿çšãããŸã ã
ãã®ã¢ãŒããã¯ãã£ã«ãããããŒã¿ã倱ãããšãªã
Jouleããžãã¯ãå€æŽã§ããŸãã ããŒã¿ã転éãŸãã¯ã³ããŒããå¿
èŠã¯ãããŸããã è³éã転éããã¡ã«ããºã ãäœæããå¿
èŠã¯ãããŸããïŒããã«ãŒæ»æã«å¯ŸããŠè匱ã§ããå¯èœæ§ããããŸãïŒã
ãããã·ã³ã³ãã©ã¯ãã䜿çšãããšãå€éšéçºè
åãã®
Jouleã·ã¹ãã ãšã®çµ±åãç°¡åã«ãªããŸãã
Jouleã§å€æŽãçºçããå Žåãå¥çŽã®äœæãå€æŽããå¿
èŠã¯ãããŸããã ç»é²ãããå¥çŽã§ãåŒã³åºãã
Jouleããã®ãã®ã§ããããšã確èªããæ¹ãç°¡åã§ãã
䜿çšãã
ãã®ããŒãã§ã¯ãçµæã®ã·ã¹ãã ã®äœ¿çšæ¹æ³ã«ã€ããŠèª¬æããŸãã
ãã€ãã³ã°
ã¢ãã¬ã¹ãæã¡ãé»è©±ããããã®ã«ååãªè³éãæã€ãããã¯ãŒã¯ãŠãŒã¶ãŒã¯ã
Jouleã§è³éãå¢ããããšãã§ããŸãã
ãããè¡ãã«ã¯ãé©åãªã¿ã€ãã³ã°ã§
Joule ïŒ
invokeãŸãã¯
invokeOnceã¡ãœãã ïŒã
åŒã³åºããŠãã©ã³ã¶ã¯ã·ã§ã³ãäœæããã ãã§ååã§ãã ãã©ã³ã¶ã¯ã·ã§ã³äžã«ã
Joule㯠ãå¥çŽã®ç»é²æã«äºçŽãããåŒã³åºãå
ã«å ±é
¬ã転éããŸãã
åŒã³åºããè¡ãããã¹ãç¬éã¯ã
getTopã¡ãœããã䜿çšããŠç°¡åã«æ±ºå®ã§ããŸãã ãã®ã¡ãœããã¯ã
ãžã¥ãŒã«ã®ãã¥ãŒã®çŸåšã®ç¶æ
ãè¿ããŸãïŒæãè¿ãã³ãŒã«ã®æéãæå°ã¬ã¹ãåå¥çŽã®å ±é
¬é¡ãããã³ãã®ä»ã®å€ã
ãã€ããŒã«ãã£ãŠç€ºããããã©ã³ã¶ã¯ã·ã§ã³ããšã®ã¬ã¹ã®éã¯ãæãè¿ãå¥çŽã®
invokeGasãã£ãŒã«ãã§æå®ãããå€ä»¥äžã§ãªããã°ãªããŸããã ã¬ã¹ã¯äºåã§å²ãåœãŠãããšãã§ããŸã-æªäœ¿çšã®ã¬ã¹ã¯è¿éãããŸãïŒè³éã¯åŒãèœãšãããŸããïŒã å®è¡ãã¥ãŒã«åŒã³åºãã®æºåãã§ããŠããããã€ãã®ã³ã³ãã©ã¯ããããå ŽåããããŸãã ãã®å Žåããã¹ãŠã®å¥çŽã®ã¬ã¹ã®åèšã«çããã¬ã¹ãèšå®ããããšããå§ãããŸãã 次ã«ïŒ
invokeã¡ãœããã®å ŽåïŒã1ã€ã®ãã©ã³ã¶ã¯ã·ã§ã³ã§è€æ°ã®ã³ã³ãã©ã¯ããåŒã³åºããããã€ããŒã¯ããããã®å ±é
¬ãåãåããŸãã
å¥çŽãç»é²ãããšãã«ãéçºè
ã¯ã¬ã¹ã®ã³ã¹ãã®æšå®å€ãèšå®ããŸãïŒãã ããå°ãªããšãæå®ãããå€ä»¥äžïŒã é»è©±ããããã«ã¯ãé±å€«ã¯ãã®ãããªã¬ã¹ã®å€ãéžæããŠããã©ã³ã¶ã¯ã·ã§ã³ãä»ã®ãã©ã³ã¶ã¯ã·ã§ã³ïŒååšããå ŽåïŒãããéãééããããã«ããŸãããå ±é
¬ã®éé¡ãããé«ãã¯ãããŸããã ã¬ã¹ã³ã¹ãã®å€ãšå ±é
¬ã®éã¯ã
getTopã¡ãœããã䜿çšããŠ
èŠã€ããããšãã§ããŸãã
ã³ãŒã«ãæåããå Žåã
Jouleã¯
Invokedã€ãã³ããå
¬éããŸããããã«ãããæåãããã¹ãŠã®ã³ãŒã«ãæ€çŽ¢ããå ±é
¬ã®æ£ç¢ºãªéé¡ã確èªã§ããŸãã
å¥çŽã®ç»é²
äœããã®ç®çã§ãæå®ãããæéã«å¥çŽã®åŒã³åºããåä¿¡ããå¿
èŠãããå Žåããã®åé¡ã®æåã®è§£æ±ºçã¯
Jouleã§ãã
ç¹å®ã®æéã®å¥çŽåŒã³åºãã
ç»é²ããã«ã¯ã次ã®ãã©ã¡ãŒã¿ãŒãæå®ããŠ
registerã¡ãœãããåŒã³åºãå¿
èŠããããŸãã
- äœæ -åŒã³åºãããå¥çŽã®äœæã
- ã¿ã€ã ã¹ã¿ã³ã -åŒã³åºããè¡ãããUNIXã¿ã€ã ã¹ã¿ã³ã圢åŒã®æç¹ã Jouleã¯ããã®æç¹ãŸã§ã«åŒã³åºããè¡ãããªãããšãä¿èšŒããã ãã§ããããšãç解ããããšãéèŠã§ãã
- GasLimit-ã³ãŒã«ã«æäŸãããæ倧ã¬ã¹å€ã å€ã«ããŒãžã³ãæå®ããããšããå§ãããŸããããããããšã§ãã¬ã¹ãäžè¶³ããŠå¥çŽã®åŒã³åºãããšã©ãŒã§çµäºããããšã¯ãããŸããã
- GasPrice-å¥çŽãåŒã³åºãããã®ã¬ã¹ã®æšå®ã³ã¹ãã
ãã©ã³ã¶ã¯ã·ã§ã³ã§ã¯ã
ç»é²ã³ãŒã«ãšãšãã«ãã³ãŒã«ã«å ±ããããã«éé¡ããšãŒãã«ã§è»¢éããå¿
èŠããããŸãã æ£ç¢ºãªéé¡ã¯ã
getPriceã¡ãœããã䜿çšããŠ
èŠã€ããããšãã§ããŸãã è¶
éé¡ãééãããå Žåãæ®é«ã¯çºåŒè
ã«è¿éãããŸãã
ã³ã³ãã©ã¯ãã¯
checkã¡ãœãããå®è£
ããå¿
èŠããããŸãã ææå°æ©ã®åŒã³åºããå¥çŽã®ããžãã¯ã«éåããããè匱æ§ãäœæãããããå¯èœæ§ãããå Žåã¯ãåŒã³åºãã
Jouleããã®ãã®ã§ããããšã確èªããå¿
èŠããããŸãã å¥çŽããã§ã«ãªã³ã©ã€ã³ã§ããã
ãã§ãã¯ã¡ãœãããè¿œå
ããæ¹æ³ããªãå Žåãç®çã®ã¡ãœãããå®è£
ããã¿ãŒã²ããã³ã³ãã©ã¯ããåŒã³åºãäžéã³ã³ãã©ã¯ãã䜿çšã§ããŸãã 次ã«ã
Jouleã«ç»é²ãããšãã«ãäžéå¥çŽã®äœæã瀺ãå¿
èŠããããŸãã
ç»é²ãæåããå Žåã
Jouleã¯
ç»é²æžã¿ã€ãã³ããå
¬éããŸããããã«ããããã¹ãŠã®ç»é²ã確èªã§ããŸãã
äž¡æ¹ã®ã¿ã€ãã®çžäºäœçšã¯ã
Ethereumãããã¯ãŒã¯ã¯ã©ã€ã¢ã³ããä»ããŠã
ParityãŸãã¯
GethïŒMistïŒãªã©ã®ã³ã³ãã©ã¯ãã䜿çšããŠçŽæ¥å®è£
ã§ããŸãã
ãŸãã䟿å®äžã
Jouleã«ã¯Webã€ã³ã¿ãŒãã§ã€ã¹ãããã
ã¡ã¿ãã¹ã¯ãªã©ã®æ¡åŒµæ©èœãã€ã³ã¹ããŒã«ããããã©ãŠã¶ãŒã®ã¿ã䜿çšããŠã
MEWãä»ããŠé»è©±ãããããå¥çŽãç»é²ãããã§ããŸãã
ãããã«
ãã®çµæãã¹ããŒãã³ã³ãã©ã¯ãã®ãã©ãããã©ãŒã å¶éãåé¿ã§ãããœãªã¥ãŒã·ã§ã³ã«ãªããŸãããŠãŒã¶ãŒã®çŽæ¥åå ãªãã«ãæå®ãããæéã«ã³ã³ãã©ã¯ããåŒã³åºãããšãã§ããŸãã
Jouleã³ãŒãã¯
githubã§å
¥æã§ããŸãã