Share
Embed
Transcript
31 slides
-
Content What is the Transaction ? EOA & CA Message
call Contract Creation Life Cycle of Transaction State Change -
What is transaction more mathematicallyɾɾɾ Transactions is like a map
from previous state to next state on the Ethererum World State σ m World State σ m+1 Transactions A transaction is a single cryptographically-signed instruction. References : [2] -
What is transaction From the view point of State, transaction
is also like “Chain” of the State Chain. orld State σ m World State σ m+1 Transactions World S σ m Transactions References : [2] -
What is transaction τϥϯβΫγϣϯ͕ຬ͖ͨ݅͢ τϥϯβΫγϣϯɺRLPϑΥʔϚοτʹै͍ͬͯΔɻ (RLPrecursive length prefixͷུ) τϥϯβΫγϣϯͷॺ໊͕༗ޮͰ͋Δɻ τϥϯβΫγϣϯͷnonce͕༗ޮͰ͋Δɻɹɹɹɹɹɹɹɹɹɹɹɹɹ
ૹ৴ऀͷݱࡏͷnonceͱ͍͔͠Ͳ͏͔ݕূ͢Δɻ τϥϯβΫγϣϯʹࣄલʹఆΊΒΕ͍ͯΔGasྔΑΓɺɹɹɹɹɹɹ gas limit͕େ͖͘ઃఆ͞Ε͍ͯΔɻ ૹ৴ऀͷΞΧϯτͷߴ͕ɺࢧ͍ͷඅ༻ΑΓ্ճ͍ͬͯΔɻ ☑ ☑ ☑ ☑ ☑ -
What is transaction τϥϯβΫγϣϯͷݕূ͕ߦΘΕͨΒɺsubstate͕࡞͞ΕΔɻ substateɺ self-destruct set τϥϯβΫγϣϯมߋޙʹه͞ΕΔΞΧϯτใ log sires
τϥϯβΫγϣϯ͕Ͳ͜·Ͱ࣮ߦ͞Εͨͷ͔Λอ࣋͢Δ refund balance τϥϯαΫγϣϯྃޙʹϝϞϦʔΛݮΒͨ͠ͱͯ͠ฦ͞ΕΔeth ͔ΒͳΔɻ Substate -
EOA & CA EthereumͷAccountʹɼೋछྨ͋Δ EOA(Externally Owned Account) ֎෦ΞΧϯτ CA(Contract Account)
ίϯτϥΫτ༻ͷΞΧϯτ τϥϯβΫγϣϯɺ͜ΕΒͷΞΧϯτؒͰߦΘΕΔɻ CAɺContrac༻ͷ CodeΛ͍࣋ͬͯΔ -
EOA & CA EOA STORAGE BLANCE NONCE CODE ADDREDD CA
STORAGE BLANCE NONCE CODE ADDREDD EOAɺൿີ伴Ͱཧ͞ΕɺCodeΛ࣋ͨͳ͍ɻ CAɺEVM codeΛͪɺEVMCodeͰཧ͞ΕΔɻ References : [2] -
EOA & CA def mk_contract_address(sender, nonce): return sha3(rlp.encode([normalize_address(sender), nonce]))[12:] ͪͳΈʹɺCA(Contract
Account)ͷΞυϨεɺ senderͷΞυϨεͱnonce͔Βࢉग़͞ΕΔ https://github.com/ethereum/pyethereum/blob/782842758e219e40739531a5e56fff6e63ca567b/ethereum/ utils.py -
input code Contract Creation World State σm World State σ
m+1 Transactions Init code Account State A Account State B Account State C ɾ ɾ ɾ Account State A Account State B Account State C ɾ ɾ Account State X NEW ৽͍͠CAͷΞυϨεΛੜ͠ॳظઃఆޙɺτϥϯβΫγϣϯͱͯ͠initίʔυ ΛૹΔ͜ͱͰίϯτϥΫτΞΧϯτ͕ੜ͞ΕΔ References : [2] -
Message Call World State σm World State σ m+1 Transactions
Init data Account State A Account State B Account State C ɾ ɾ Account State A Account State B Account State C ɾ ɾ Account State X Update Message CallʹΑͬͯContract Accountͷσʔλupdate͞ΕΔɻ input data Account State X References : [2] -
Information of Transaction blockHash: “0x3584caa04632ce227cf259ab8086d460d497067e666fdf9c5b58756f738ad51c", blockNumber: 37214317, from: “0x0eea8963fd6f19ff4299ac9ccb774266a98ba6b1", gas:
4600000, gasPrice: 100000000000, hash: “0xd59f0a4c159aa2a2058bd7d8dc4b759d1d6474d3f4b85606e3b4a3d00ff73e10", input: "0x", nonce: 42, r; “0xa4c159aa2a2058bd7d8dca4c159aa2a2058bd7d8dca4c159aa2a2058bd7d” s; “0xb759d1d6474d3f4b85606e3b4a3b759d1d6474d3f4b85606e3b4a34279a6” to: “0x0f0a4c159aa2a2058bd7d8dc4b759d1d6474d3f", transactionIndex: 3, v; “0x66” value: 5000000000 -
GAS LIMIT GAS PRICE NONCE INIT / DATA R.S.V TO
VALU Information of Transaction -
https://y0za.github.io/2017-12-24/geth-transaction/ Reference https://takenobu-hs.github.io/downloads/ethereum_evm_illustrated.pdf https://speakerdeck.com/yamarkz/detail-ethereum-transaction [1] [2] [3] https://kb.myetherwallet.com/gas/what-is-gas-ethereum.html [4] [5]
https://ja.wikipedia.org/wiki/ %E3%83%88%E3%83%A9%E3%83%B3%E3%82%B6%E3%82%AF%E3%82 %B7%E3%83%A7%E3%83%B3