- tags: Blockchain
Ethereum
Links to this note
Uniswap V3 Event Log
tags: Uniswap V3, Ethereum POST https://rpc.ankr.com/eth Content-Type: application/json { "jsonrpc": "2.0", "id": 1, "method": "eth_getTransactionReceipt", "params": ["0xeedf302cc12f4b7194742694aabec075c1c229f7b9d8e57a53c44c992bc6690c"] }
Ethereum Networking Layer
tags: Ethereum source: https://ethereum.org/en/developers/docs/networking-layer/
Ethereum Simulator Node
tags: Ethereum Simulator Only use the data of the mainnet to simulate transaction, and DONOT commit the final transaction to the mainnet. Relay To identify our transactions that need to simulate, if it’s failed then drop that tx, otherwise commit the final transaction to the mainnet. Things need to consider: How to limit or identify transactions that need to simulate? Only execute the transactions from local txpool. Where to execute the transction previously?...
Ethereum Signing Data
tags: Ethereum, Sign Message source: “Signing Data | MetaMask Docs.” Accessed April 6, 2023. https://docs.metamask.io/guide/signing-data.html#signtypeddata-v4. Five Methods1 eth_sign allow to sign arbitrary hash.2 personal_sign add prefix to data and human readable text that encoded UFT-8.3 signTypedData or signTypedData_v1 first release that lacked some later security improvements. signTypedData_v3 signTypedData_v4 compatible with V3. Differences Between V3 and V44 Some input types that V3 doesn’t support but V4 does: Custom type array Custom type with null input Some input types that V4 doesn’t support but V3 does:...
EIP 1559
tags: Ethereum Before EIP 1559 The miner receive both fees and block reward. After EIP 1559 The fee divide to 2 parts: Base Fee Priority Fee The miner receive priority fee and block reward, the base fee will be burned.
Decode input data of Ethereum
tags: Ethereum,Blockchain,Tron source: https://ethereum.stackexchange.com/a/110498 const data = '0x7ff36ab50000000000000000000000000000000000000000000000bc18ba4144048bbab00000000000000000000000000000000000000000000000000000000000000080000000000000000000000000c0c5eb43e2df059e3be6e4fb0284c283caa5991900000000000000000000000000000000000000000000000000000000614d87a80000000000000000000000000000000000000000000000000000000000000002000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c00000000000000000000000008ba0619b1e7a582e0bce5bbe9843322c954c340'; ethers.utils.defaultAbiCoder.decode( ['uint256', 'address[]', 'address', 'uint256'], ethers.utils.hexDataSlice(data, 4) ) // gives: [e, ["0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c", "0x08ba0619b1e7A582E0BCe5BBE9843322C954C340"], "0xC0C5eb43E2dF059e3Be6E4fb0284C283CAa59919", e] (4) Online tools: Playground.
Ethereum Layer 2
tags: Ethereum Knowning Layer 2 Chain Rollup(or bundle) transactions off-chain to reduce fee and scale capacity, such as Bitcoin Lightning. Two layer 2 rollups Optimistic Rollups Zero-Knowledge Rollups Record on-chain state by writing calldata to L1(Ethereum), which more cheaper than change state on L1 chain. Fees Some layer 2 chain like Optimism should plus l1 fee when executing transaction on layer 1.1 Many Ethereum applications display estimated fees to users by multiplying the gas price by the gas limit....
Uniswap
tags: Blockchain,Ethereum,DeFi
Non-Fungible Tokens vs. Fungible Tokens
tags: Blockchain,Ethereum source: “Graphical Guide to Understanding Uniswap - EthHub.” Accessed August 23, 2022. https://docs.ethhub.io/guides/graphical-guide-for-understanding-uniswap/. ERC20 tokens are the most common type of token built on top of Ethereum. They are fungible in nature, meaning that there isn’t a distinction between individual tokens. For example, if I have 100 metal marbles in my hand that are all the same size and color, it doesn’t matter which one I give you....
Account-Model Blockchain Systems
tags: Starcoin Web3 StarTrek,Ethereum,Merkle tree
Patricia Merkle Tree
tags: Starcoin Web3 StarTrek,Merkle tree,Ethereum Powers the widely known Ethereum network.
Ethereum development
tags: Ethereum
Set up your local development environment
tags: Smart contracts,Ethereum,Ethereum development source: ethereum.org. “Ethereum Local Development Setup.” Accessed January 7, 2022. https://ethereum.org. Local development node: Use Hardhat to build the ethereum development environment. And also there are some tools that based on Hardhat: scaffold-eth: forkable Ethereum dev stack focused on fast product iterations Ganache: A tool for creating a local blockchain for fast Ethereum development. Tools that based on Ganache: Python based: brownie Testing tools: Waffle: ethers....
Ethereum: Deploying your first smart contract
tags: Smart contracts,Ethereum,Ethereum development source: ethereum.org. “Deploying Your First Smart Contract.” Accessed January 7, 2022. https://ethereum.org.
PoA
tags: Blockchain Proof,Ethereum
Skiff x Ethereum Naming Service
tags: Ethereum,MetaMask,Online Tools source: https://www.skiff.org/updates/skiff-ens
Smart contracts
tags: Blockchain,Ethereum source: https://ethereum.org/en/developers/docs/smart-contracts/ A type of Ethereum account. Some code deployed and running in some VM, like Ethereum Virtual Machine.
Decentralized autonomous organizations (DAOs)
tags: Ethereum,Smart contracts,Blockchain,Web3 source: https://ethereum.org/en/dao/ Based on smart contracts and use tokens for voting. Tokens can be exchanged in the market.
Ethereum: Shard chains
tags: Ethereum,Proof-of-stake source: https://ethereum.org/en/eth2/shard-chains/ Sharding is the process of splitting a database horizontally to spread the load – it’s a common concept in computer science. In an Ethereum context, sharding will reduce network congestion and increase transactions per second by creating new chains, known as “shards”. This is important for reasons other than scalability.
Ethereum: The Beacon Chain
tags: Ethereum,Proof-of-stake source: https://ethereum.org/en/eth2/beacon-chain/ Extra coordination for the Ethereum: Shard chains. The beacon chain receives state information from shards and makes it available for other shards, allowing the network to stay in sync. The beacon chain will also manage the validators from registering their stake deposits to issuing their rewards and penalties.
How does Ethereum's proof-of-stake work?
tags: Ethereum,Proof-of-stake source: https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/#how-does-pos-work When you submit a transaction on a shard, a validator will be responsible for adding your transaction to a shard block. Validators are algorithmically chosen by Ethereum: The Beacon Chain to propose new blocks. Attestation If a validator isn’t chosen to propose a new shard block, they’ll have to attest to another validator’s proposal and confirm that everything looks as it should. It’s the attestation that is recorded in the beacon chain rather than the transaction itself....
ETH
tags: Ethereum
Proof-of-stake
tags: Blockchain,Blockchain Proof,Ethereum,Solana source: https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/ Proof workflow: Users stake money(ETH) to become a validator. Validators are chosen at random to create blocks and are responsible for checking and confirming blocks they don’t create. user’s stake is also used as a way to incentivise good validator behavior. For example, a user can lose a portion of their stake for things like going offline (failing to validate) or their entire stake for deliberate collusion....
Proof-of-work
tags: Blockchain Proof,Blockchain,Ethereum source: https://ethereum.org/en/developers/docs/consensus-mechanisms/pow/ Wikipedia: https://en.wikipedia.org/wiki/Proof%5Fof%5Fwork A key feature of proof-of-work schemes is their asymmetry: the work – the computation – must be moderately hard (yet feasible) on the prover or requester side but easy to check for the verifier or service provider. With a hash function, let’s say SHA-1. For example, to do PoW, we need to generate a SHA-1 hash of the given data that must begins 52 binary zeros, that is 13 hexadecimal zeros:...