本文作者:Ethernaut CTF[1]
这个手册是为有抱负的超级开发者策划的 EVM 学习的资源清单。
在第一性原理的思考中,你把事情归结为最基本的真理,然后你从那里推理。 ---- Elon Musk
在智能合约领域,"以太坊虚拟机" 以及其算法和数据结构就是第一性原理。
从单个合约层面和以太坊的整体世界状态深入解释 EVM 的视频。
涵盖了 EVM 如何工作的基本原理,并展示了 EVM 如何与协议层互动。
一组博文,帮助你了解 solidity 代码是如何被 EVM 解释和执行的。
一组博客文章,深入 EVM 的特定部分,让你从 solidity 代码到 EVM 的操作代码。
一组博文,用 Python 从头开始实现 EVM,参考 Ethereum 黄皮书并涉及 EVM 的机制
一篇博文介绍了 EVM 的基本概况,在向我们展示如何编写一些汇编之前,解释了堆栈的工作原理。
PPT 演示,提供了奇妙的视觉效果,不仅展示了 EVM 是如何工作的,而且还展示了世界状态(存储),交易如何操作世界状态,以及更多。
一个互动的网站和 EVM Playground。对 EVM 开发者来说是最有价值的工具之一。它包含一个所有操作码的列表,以及描述和一个你可以观察它们如何工作的 Playground。
GitHub 上的交互式 EVM 谜题集,这些谜题可以帮助你巩固从其他资源中学到的知识。
Fvictorio 的互动式 EVM 谜题的 "第二部分",有一组新的挑战,这些谜题同样可以帮助巩固你的学习。
一篇博文,对合约存储的数据结构做了很好的概述
一篇关于 EVM 汇编、操作码和在 solidity 中使用汇编的博文。
一段深入的视频,介绍了合约如何被编译成字节码,如何处理其内存/存储,以及如何被 EVM 解释。
一段深入的视频,探讨了用于存储 Ethereum 世界状态的算法和数据结构。
官方 Solidity 文档,介绍如何在 solidity 合约中处理存储、内存和 calldata。
[1]
Ethernaut CTF: https://learnblockchain.cn/people/11048
[2]
EVM 解释(Youtube): https://www.youtube.com/watch?v=kCswGz9naZg&feature=youtu.be
[3]
第13章 - 以太坊虚拟机: https://github.com/ethereumbook/ethereumbook/blob/develop/13evm.asciidoc
[4]
第1部分 - 介绍: https://blog.openzeppelin.com/deconstructing-a-solidity-contract-part-i-introduction-832efd2d7737/
[5]
第2部分 - 运行时间与创建字节码: https://blog.zeppelin.solutions/deconstructing-a-solidity-contract-part-ii-creation-vs-runtime-6b9d60ecb44c
[6]
第3部分 - 函数选择器: https://blog.zeppelin.solutions/deconstructing-a-solidity-contract-part-iii-the-function-selector-6a9b6886ea49
[7]
第4部分 - 函数封装器: https://blog.zeppelin.solutions/deconstructing-a-solidity-contract-part-iv-function-wrappers-d8e46672b0ed
[8]
第5部分 - 函数主体: https://blog.zeppelin.solutions/deconstructing-a-solidity-contract-part-v-function-bodies-2d19d4bef8be
[9]
第六部分 - 元数据哈希: https://blog.zeppelin.solutions/deconstructing-a-solidity-contract-part-vi-the-swarm-hash-70f069e22aef
[10]
第1 部分 - 函数选择器深入分析: https://noxx.substack.com/p/evm-deep-dives-the-path-to-shadowy?s=r
[11]
第2部分 - EVM中的内存: https://noxx.substack.com/p/evm-deep-dives-the-path-to-shadowy-d6b?s=r
[12]
第3部分 - EVM中的存储: https://noxx.substack.com/p/evm-deep-dives-the-path-to-shadowy-3ea?s=r
[13]
第4部分 - Go Ethereum(Geth)客户端的存储操作码: https://noxx.substack.com/p/evm-deep-dives-the-path-to-shadowy-5a5?utm_source=%2Fprofile%2F80455042-noxx&utm_medium=reader2&s=r
[14]
第5部分 - 委托调用深入研究: https://noxx.substack.com/p/evm-deep-dives-the-path-to-shadowy-a5f?utm_source=%2Fprofile%2F80455042-noxx&utm_medium=reader2&s=r
[15]
第1部分 - 基本执行环境: https://www.notion.so/Building-an-EVM-from-scratch-part-1-the-execution-context-c28ebb4200c94f6fb75948a5feffc686
[16]
第2部分 - Branching指令: https://www.notion.so/Building-an-EVM-from-scratch-part-2-branching-instructions-d864da164256426a9a1a0f7cc475c840
[17]
Part 1 - A Playdate with the EVM: https://femboy.capital/evm-pt1
[18]
EVM图解: https://takenobu-hs.github.io/downloads/ethereum_evm_illustrated.pdf
[19]
了解以太坊智能合约存储: https://programtheblockchain.com/posts/2018/03/09/understanding-ethereum-smart-contract-storage/
[20]
Solidity Tutorial All About Assembly: https://jeancvllr.medium.com/solidity-tutorial-all-about-assembly-5acdfefde05c
[21]
EVM从Solidity到字节码、内存和存储: https://www.youtube.com/watch?v=RxL_1AfV7N4&t=2s
[22]
Ethereum 背后的秘密: 算法与数据结构: https://www.youtube.com/watch?v=OxofT39TJgg
[23]
存储中的状态变量布局: https://learnblockchain.cn/docs/solidity/internals/layout_in_storage.html
[24]
内存中的布局: https://learnblockchain.cn/docs/solidity/internals/layout_in_memory.html
[25]
Calldata的布局: https://learnblockchain.cn/docs/solidity/internals/layout_in_calldata.html