Skip to content

Commit 9fb007a

Browse files
committed
update through hash-function-precompile
1 parent 6b9be90 commit 9fb007a

37 files changed

+328
-500
lines changed

content/course/customizing-evm/02-intro-to-evm/00-evm-and-precompiles.mdx

Lines changed: 0 additions & 15 deletions
This file was deleted.
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
---
22
title: Origin of the EVM
3-
description: Learn about the origin of Ethereum Virtual Machine (EVM).
4-
updated: 2024-05-31
5-
authors: [ashucoder9]
3+
description: Learn about the origin of the Ethereum Virtual Machine.
4+
updated: 2024-09-27
5+
authors: [ashucoder9, owenwahlgren]
66
icon: BookOpen
77
---
88

9-
The Ethereum Virtual Machine (EVM) is a key component of Ethereum’s infrastructure, responsible for executing smart contracts across the network. The origins of the EVM can be traced back to the creation of the Ethereum blockchain itself, which was proposed in a whitepaper by Vitalik Buterin in late 2013.
9+
The **Ethereum Virtual Machine (EVM)** is a fundamental component of Ethereum’s infrastructure, responsible for executing smart contracts across the network. The origins of the EVM can be traced back to the creation of the Ethereum blockchain itself, proposed in a whitepaper by **Vitalik Buterin** in late 2013.
1010

11-
Buterin and the founding Ethereum team envisioned a platform where developers could build decentralized applications (dApps) on a blockchain. To accomplish this, they needed a way to execute arbitrary, complex computations in a secure and decentralized way. This is where the idea of the EVM was born.
11+
Buterin and the founding Ethereum team envisioned a platform where developers could build **decentralized applications (dApps)** on a blockchain. To accomplish this, they needed a way to execute arbitrary, complex computations in a secure and decentralized manner. This is how the concept of the EVM was born.
1212

13-
The EVM, an integral part of the Ethereum ecosystem, operates as a quasi-Turing complete machine. This means it can run nearly any algorithm, given enough resources, and it's isolated from the main network, providing a sandboxed environment for smart contract execution.
13+
The EVM, an integral part of the Ethereum ecosystem, operates as a **quasi-Turing complete machine**. This means it can run nearly any algorithm, given enough resources. It's isolated from the main network, providing a sandboxed environment for smart contract execution.
1414

15-
After the whitepaper was published, the Ethereum project moved into a development phase, with the first live version of the Ethereum network, including the EVM, launching on July 30, 2015. The Ethereum blockchain was designed to include the EVM at the protocol level to allow users to create and execute smart contracts. These smart contracts are essentially programs or scripts that autonomously execute the terms of a contract, and they are written in a high-level language such as Solidity or Vyper, which are then compiled down to EVM bytecode for execution on the EVM.
15+
Following the publication of the whitepaper, the Ethereum project moved into development. The first live version of the Ethereum network, including the EVM, launched on **July 30, 2015**. The Ethereum blockchain was designed with the EVM at the protocol level, enabling users to create and execute smart contracts. These smart contracts are essentially programs that autonomously execute the terms of an agreement. They are written in high-level languages like **Solidity** or **Vyper**, which are then compiled down to EVM bytecode for execution on the EVM.
1616

17-
Since its creation, the EVM has become a vital component of the Ethereum blockchain, and it has set a precedent for other blockchain platforms that have adopted similar models for executing smart contracts. The advent of the EVM has undoubtedly revolutionized the blockchain world, introducing the concept of programmable blockchains.
17+
Since its creation, the EVM has become a crucial component of the Ethereum blockchain and has set a standard for other blockchain platforms that have adopted similar models for executing smart contracts. The advent of the EVM has undoubtedly revolutionized the blockchain world by introducing the concept of **programmable blockchains**.
Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,37 @@
11
---
2-
title: Accounts, Keys and Addresses
3-
description: Learn about Accounts, Keys and Addresses in EVM.
4-
updated: 2024-05-31
5-
authors: [ashucoder9]
2+
title: Accounts, Keys, and Addresses
3+
description: Learn about Accounts, Keys, and Addresses in EVM.
4+
updated: 2024-09-27
5+
authors: [ashucoder9, owenwahlgrne]
66
icon: BookOpen
77
---
88

99
## Accounts
1010

1111
In the EVM, there are two types of accounts:
1212

13-
1. **Externally Owned Accounts (EOAs)**: These are accounts controlled by private keys and have no associated code with them. They can send transactions by creating and signing them with their private keys. Essentially, if you are an end user of Ethereum, you're likely using an EOA.
13+
1. **Externally Owned Accounts (EOAs)**: These accounts are controlled by private keys and do not have associated code. They can send transactions by creating and signing them with their private keys. If you're an end user of Ethereum, you're likely using an EOA.
1414

15-
2. **Contract Accounts**: These are accounts that have associated code with them (Smart Contracts). Contract accounts can't initiate transactions on their own. Instead, they only perform an operation when instructed to do so by an EOA. This could be a simple token transfer or a function call in a smart contract.
15+
2. **Contract Accounts**: These accounts have associated code (smart contracts). Contract accounts can't initiate transactions on their own; instead, they only perform actions when instructed by an EOA. This could be as simple as a token transfer or a function call within a smart contract.
1616

1717
## Public and Private Keys
1818

19-
In Ethereum, as in many blockchain platforms, a cryptographic algorithm called the Elliptic Curve Digital Signature Algorithm (ECDSA) is used to generate a pair of keys: a public key and a private key.
19+
In Ethereum, as in many blockchain platforms, the **Elliptic Curve Digital Signature Algorithm (ECDSA)** is used to generate a pair of keys: a public key and a private key.
2020

21-
The private key is a 32-byte number generated randomly.
22-
23-
The public key is derived from the private key using a specific elliptic curve cryptography function. It is 64 bytes long, consisting of two concatenated 32-byte coordinates.
21+
- The **private key** is a 32-byte number generated randomly.
22+
- The **public key** is derived from the private key using elliptic curve cryptography. It is 64 bytes long, made up of two concatenated 32-byte coordinates.
2423

2524
## Addresses
2625

2726
An EVM address is derived from the public key through the following steps:
2827

29-
1. **Keccak-256 Hashing**: The public key is first passed through the Keccak-256 hashing function (the version of SHA-3 used by Ethereum). Keccak-256 outputs a 64-byte string:
28+
1. **Keccak-256 Hashing**: The public key is first passed through the Keccak-256 hashing function (the version of SHA-3 used by Ethereum). Keccak-256 outputs a 64-byte string, for example:
3029
`025ad33e2479a53b02dc0be66eb0ce272fc0f4358c57a8f0a442410c3d831a`
3130

32-
2. **Rightmost 20 bytes**: The resulting string is truncated to keep only the last 20 bytes. In hexadecimal, this means retaining the rightmost 40 hex digits (since two hex digits represent one byte):
31+
2. **Rightmost 20 bytes**: The resulting string is truncated to keep only the last 20 bytes. In hexadecimal, this means retaining the rightmost 40 hex digits (since two hex digits represent one byte), like so:
3332
`e66eb0ce272fc0f4358c57a8f0a442410c3d831a`
3433

35-
3. **Adding '0x'**: Finally, "0x" is added at the start of the address for a total of 42 characters. The "0x" prefix indicates that what follows is a hexadecimal number, a common convention in the Ethereum ecosystem:
34+
3. **Adding '0x'**: Finally, "0x" is prefixed to the address for a total of 42 characters. The "0x" indicates that the following characters represent a hexadecimal number, a common convention in Ethereum:
3635
`0xe66eb0ce272fc0f4358c57a8f0a442410c3d831a`
3736

38-
This process ensures that each Ethereum address corresponds uniquely to a public key. Since the address is a truncated hash of the public key, it's not possible to reverse-engineer the public key from the address.
37+
This process ensures that each Ethereum address uniquely corresponds to a public key. Since the address is a truncated hash of the public key, it's impossible to reverse-engineer the public key from the address.

content/course/customizing-evm/02-intro-to-evm/03-transactons-and-blocks.mdx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
---
22
title: Transactions and Blocks
33
description: Learn about another fundamental aspect of the Ethereum ecosystem - Transactions and Blocks.
4-
updated: 2024-05-31
5-
authors: [ashucoder9]
4+
updated: 2024-09-27
5+
authors: [ashucoder9, owenwahlgren]
66
icon: BookOpen
77
---
88

99
## Transactions
1010

11-
In the EVM, a transaction is the smallest unit of work that can be included in a block. It represents a state transition, modifying account data and moving Ether across the network.
11+
In the EVM, a transaction is the smallest unit of work that can be included in a block. It represents a **state transition**, modifying account data and transferring Ether across the network.
1212

1313
Transactions can either transfer Ether or invoke smart contracts. Each transaction includes the following components:
1414

1515
- **Nonce**: A unique value set by the sender to ensure the transaction is processed only once, preventing replay attacks.
16-
- **Gas Price**: The amount the sender is willing to pay per unit of gas, typically measured in `nanoAvax`, where 1 `nAvax` = 1/(10^9) Avax. This consists of three components:
16+
- **Gas Price**: The amount the sender is willing to pay per unit of gas, typically measured in `nanoAvax` (1 `nAvax` = 1/(10^9) Avax). It consists of three parts:
1717
- **Base Gas Fee**: The minimum `nAvax` required per unit of gas.
18-
- **Maximum Priority Gas Fee**: Additional `nAvax` the sender is willing to pay per unit of gas, on top of the base fee.
19-
- **Maximum Total Gas Fee**: The maximum `nAvax` the sender is willing to spend per unit of gas. The gas price paid equals the maximum total gas fee if the base gas fee plus the maximum priority fee exceeds the maximum total gas fee.
20-
- **Gas Limit**: The maximum amount of gas units the sender is willing to pay for executing the transaction. If the gas limit is reached, the transaction fails, preventing indefinite execution.
18+
- **Maximum Priority Gas Fee**: Additional `nAvax` the sender is willing to pay on top of the base fee.
19+
- **Maximum Total Gas Fee**: The maximum `nAvax` the sender is willing to spend per unit of gas. If the sum of the base gas fee and the priority gas fee exceeds this amount, the gas price paid will be capped at the maximum total gas fee.
20+
- **Gas Limit**: The maximum amount of gas units the sender is willing to pay for executing the transaction. If this limit is reached, the transaction fails, preventing indefinite execution.
2121
- **To**: The recipient's Ethereum address or the target smart contract.
2222
- **V, R, S**: Cryptographic data used to create the sender's signature.
2323

2424
## Blocks
2525

26-
A block in the EVM consists of a set of transactions that have been validated by miners, bundled together, and linked to the previous block. Each block contains:
26+
A block in the EVM is a bundle of validated transactions, grouped together and linked to the previous block. Each block contains:
2727

28-
- **Block Number**: The index of the block, viewed as a position in a zero-indexed linked list.
28+
- **Block Number**: The index of the block, representing its position in a zero-indexed linked list.
2929
- **Timestamp**: The time the block was mined.
3030
- **Transactions Root**: The Merkle root of all transactions within the block.
3131
- **Receipts Root**: The Merkle root of all transaction receipts.
Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
title: Different Versions of EVM
3-
description: Learn about the different versions of the Ethereum Virtual Machine (EVM) in the Avalanche ecosystem.
4-
updated: 2024-05-31
5-
authors: [ashucoder9]
3+
description: Learn about the different versions of the Ethereum Virtual Machine in the Avalanche ecosystem.
4+
updated: 2024-09-27
5+
authors: [ashucoder9, owenwahlgren]
66
icon: BookOpen
77
---
88

@@ -12,20 +12,17 @@ Geth (or [go-ethereum](https://github.com/ethereum/go-ethereum)) is the official
1212

1313
## Coreth
1414

15-
[Coreth](https://github.com/ava-labs/coreth) is a fork of Geth maintained by Ava Labs that implements the Virtual Machine for the C-Chain. It has been adapted to work with Avalanche Consensus.
15+
[Coreth](https://github.com/ava-labs/coreth) is a fork of Geth maintained by Ava Labs. It implements the EVM for the C-Chain and has been adapted to work with Avalanche Consensus.
1616

1717
## Subnet-EVM
1818

19-
[Subnet-EVM](https://github.com/ava-labs/subnet-evm) is a fork of Coreth designed to make it easy to launch customized EVM-based blockchains on an Avalanche L1. It differs from Coreth in the following ways:
19+
[Subnet-EVM](https://github.com/ava-labs/subnet-evm) is a fork of Coreth designed to facilitate launching customized EVM-based blockchains on an Avalanche L1. It differs from Coreth in the following ways:
2020

21-
→ **Configurable fees and gas limits added in the genesis file**
22-
23-
→ **Avalanche hardforks merged into a single "Subnet-EVM" hardfork**
24-
25-
→ **Atomic transactions and shared memory removed**
26-
27-
→ **Multicoin contracts and state removed**
21+
- **Configurable Fees and Gas Limits**: Customizable fees and gas limits can be set in the genesis file.
22+
- **Unified Subnet-EVM Hardfork**: All Avalanche hardforks are merged into a single "Subnet-EVM" hardfork.
23+
- **Atomic Transactions and Shared Memory Removed**: Support for atomic transactions and shared memory has been removed.
24+
- **Multicoin Contracts and State Removed**: Multicoin contracts and state tracking are no longer supported.
2825

2926
## Precompile-EVM
3027

31-
Precompile-EVM allows precompiles to be registered with Subnet-EVM without forking the Subnet-EVM codebase. This simplifies common customizations to Subnet-EVM, making them more accessible and easier to maintain. It also streamlines updates for Subnet-EVM.
28+
Precompile-EVM allows precompiles to be registered with Subnet-EVM without needing to fork the Subnet-EVM codebase. This simplifies common customizations to Subnet-EVM, making them more accessible and easier to maintain. It also streamlines updates for Subnet-EVM.

content/course/customizing-evm/03-development-env-setup/00-intro.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Setting Up Our Development Environment
2+
title: Set Up Development Environment
33
description: Start by setting up your development environment.
44
updated: 2024-05-31
55
authors: [ashucoder9]

content/course/customizing-evm/03-development-env-setup/02-what-is-codespaces.mdx

Lines changed: 0 additions & 46 deletions
This file was deleted.

content/course/customizing-evm/03-development-env-setup/04-codespace-in-vscode.mdx renamed to content/course/customizing-evm/03-development-env-setup/03-codespace-in-vscode.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Open Codespace in VS Code
2+
title: Codespace in VS Code
33
description: Learn how to setup GitHub Codespaces.
44
updated: 2024-05-31
55
authors: [ashucoder9]
Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,22 @@
11
---
22
title: Your Own EVM Blockchain
33
description: Learn how to spin up your own EVM blockchain.
4-
updated: 2024-05-31
5-
authors: [ashucoder9]
4+
updated: 2024-09-27
5+
authors: [ashucoder9, owenwahlgren]
66
icon: Book
77
---
88

9-
In this part of our course, we'll explore how to run your own Avalanche Network with a custom EVM. Running your own EVM allows you to address specific use cases and highlights one of the key advantages of multi-chain systems over monolithic ones.
9+
In this part of the course, we'll explore how to run your own Avalanche L1 with a custom EVM. Running your own EVM allows you to address specific use cases, showcasing one of the key advantages of multi-chain systems over monolithic blockchains.
1010

11-
## Hands-On Exercise
11+
## Topics
1212

13-
In this section, you won't need to write any Go code. Instead, you'll run some commands to set up your EVM blockchain.
13+
We’ll cover the following topics:
1414

15-
## Structure of This Section
15+
- **Avalanche CLI**: Learn how to configure and launch an Avalanche L1 using the Avalanche CLI.
16+
- **Token Transfer**: Explore how to perform token transfers with Foundry.
1617

17-
We will cover the following topics:
18-
19-
- **Avalanche CLI**: Learn how to use this tool to create your own Avalanche Network and add Avalanche L1s and blockchains.
20-
- **Token Transfer**: Discover how to perform token transfers with Foundry.
21-
22-
This practical exercise will help you consolidate your knowledge and see the impact of customizations on EVM performance firsthand.
18+
This hands-on exercise will solidify your knowledge and allow you to observe how customizations impact EVM performance.
2319

2420
## Learning Objective
2521

26-
By the end of this section, you'll be equipped with the skills to effectively run your own Avalanche Network with a custom EVM blockchain, paving the way for your blockchain projects.
22+
By the end of this section, youll have the skills to effectively run your own Avalanche L1 with a custom EVM blockchain, empowering you to start building your blockchain projects!

0 commit comments

Comments
 (0)