基本原理解析:当小明给小红转了1个ETH,背后都发生了什么?

ETH中文网Опубліковано о 2022-09-27Востаннє оновлено о 2022-09-27

Анотація

本文剖析了以太坊交易中的元数据、缓存和数据三个重要组成部分,手把手地教会读者看懂一笔交易的数据。

本文剖析了以太坊交易中的元数据、缓存和数据三个重要组成部分,手把手地教会读者看懂一笔交易的数据。

发送了 ETH?有为 AMM 提供流动性?部署了新的合约?你所做的任何事都会在世界计算机上留下链上记录。想知道你的交易中有些什么吗?

以太坊计算中逐个原子单位的指南

以太坊是一台世界计算机:一个存在于上千台计算机网络之间的全球共享基础设施。

用户可以通过钱包(比如 MetaMask)与以太坊进行交互,钱包可以创建和发送交易到网络中。一旦接收了交易,它就会被写入区块中。

额外的益处:对数据进行哈希计算(应用哈希函数)

哈希函数:这是一段用于将任意数据量转换为一个压缩、统一数值的代码。它的输入数据可以是任意长度,但输出数据的长度则是一样的。

哈希函数不能反向运行。

cr. @SalomonCrypto

一笔以太坊交易由三个部分组成:

元数据(metadata),包括发送/接受的 ETH 金额、gas 详细信息以及签名数据

缓存(cache),交易预计会使用的账户和私钥的列表。

数据,交易的 payload(智能合约代码或者 API 调用)

元数据 —— 交易相关信息

以下的图片展示了所有元数据字段。我们会在接下来探讨其中不显著的部分。

chainid—— 由 EIP-155 提出,用来保护链不受 ETC 的重放攻击。

type—— 这里有两种类型:一个新的合约(0x0)还有其他所有合约(0x2)。EIP-2718 提出了一个封装功能(0x2),让更多不影响以太坊核心规范的类型得以使用。

nonce—— 从特定地址发送过来的交易数量。一旦交易打包到区块上,钱包的 nonce 值就增加了。避免受到重放攻击。

to—— 接受交易的地址(钱包或智能合约)

value—— 将要转账的 ETH 数额。请注意 —— 这里只计算 ETH,不计算其他代币。

gas—— 这笔交易所使用的 gas 单位

maxFeePerGas—— 创建交易的用户愿意支付的最高费用(每 gas 要支付 WEI。译者注:WEI 是 ETH 的最小单位,1 个 ETH 相当于 10 的18次方 WEI。)它包括了基础费用和优先费。

maxPriorityFeePerGas—— 创建交易的用户在基础费用(base fee)之外愿意支付的最高优先费(每 gas 要支付的 WEI)。这笔费用会直接支付给矿工/验证者,作为激励打包的小费。

gasPrice—— 这笔交易需支付的每 gas 单位的成本。

(r, s, v)—— 构成创建该交易的用户签名的三个值。它们可以用于验证用户是否在此交易上 EVM 执行之前许可了这笔交易。

更多信息,可以自行查阅:Elliptic Curve Digital Signature Algorithm (ECDSA)

缓存

这个部分包括了访问列表(accessList),它是交易将用到的地址和私钥的列表。这笔交易还可以使用该列表以外的资源,但成本会比较高。

访问列表是由 EIP-2929 提案提出的,让客户端可以获取/缓存交易期间的数据。

现在,通过访问列表获取地址和私钥数据的折扣是 9 折。但这个折扣会随着未来以太坊支持更多轻客户端而变得更多。

数据 —— 交易中传输的 payload 数据

数据可以用三种方式进行:

ETH 转账 —— 空白

智能合约 API 调用 —— 函数和参数的名字

新的智能合约 —— 智能合约的代码

输入字段的数据以二进制形式记录,但它可以转译成人类可读的形式。

基本原理解析:当小明给小红转了1个ETH,背后都发生了什么?

输入字段存在于链上,但它不是 EVM 状态的一部分。它只是在交易期间为合约提供数据,无法被以太坊追踪到,也不能在共识层上使用。

EVM 只能使用在此交易中提供的数据;它无法查看过去的交易。

这一特质对于想要将历史数据写入以太坊区块链(比如,用于稍后的手动检索)但不考虑直接访问 EVM 的应用程序来说十分有用。

Rollup 是最早充分利用这个想法的一种应用程序。

有时间我们会谈谈 Rollup。现在,Rollup 依靠着这样一种现实:将数据写入输入字段比直接写入以太坊 EVM 状态中要相对便宜。

你现在可以看啦!这就是一笔以太坊交易的样子!

Пов'язані матеріали

The Full Story of How Crypto Unicorn Blockstream Is Mired in Serious Fraud Allegations

This article details serious allegations of fraud against Bitcoin infrastructure company Blockstream, founded by Bitcoin pioneer Adam Back. In June 2024, investigative account NatInfoSec published a report accusing Blockstream's mining note (BMN) program of potentially operating a multi-billion dollar scheme with Ponzi-like characteristics. The core allegations focus on Blockstream Mining Notes (BMNs), which offer investors fixed annual yields up to approximately 20% from Bitcoin mining. NatInfoSec's investigation raises several key issues: 1. **Suspicious Hashrate & Payout Capacity**: The analysis suggests Blockstream would need 20-45 EH/s of mining power to cover its BMN obligations, but its public dashboard shows only around 15 EH/s. Furthermore, no verifiable public evidence (e.g., grid connection records, import data) was found to support the massive mining operation required. 2. **Questionable Payout Source**: The BMN contract allows Blockstream to use Bitcoin from *any source* (Substitute Performance BTC) to fulfill investor payouts, raising concerns that payouts may not come from actual mining revenue. 3. **High-Risk, Fixed Returns**: Offering ~20% fixed yields in the volatile, cyclical Bitcoin mining industry is viewed as highly unusual and requires clear explanation. 4. **Undisclosed Criminal Record of Key Figure**: Christopher William Cook, a key figure in Blockstream's mining operations and CEO of spin-off Exacore, was found to have a federal felony conviction for mail fraud in 2008, a fact not disclosed in BMN offering documents. His background was also allegedly embellished. 5. **Potential Contagion to BSTR SPAC**: Questions were raised about whether these liabilities and Cook's record should have been disclosed in the SEC filings for Bitcoin Standard Treasury Company (BSTR), a separate Adam Back-associated firm planning a SPAC merger. The crypto community is divided. BitMEX Research validated Cook's criminal record and expressed concern over the high yields but found other evidence lacking or misleading, noting the legal separation between BMN, Blockstream, and BSTR. Blockstream defenders, like Samson Mow, argue the mining is real. Critics, however, emphasize the lack of independent, verifiable proof of the mining operation's scale and the true source of investor payouts. The article concludes that BMN remains shrouded in key unanswered questions regarding its actual size, the verifiability of its underlying mining assets and payouts, the source of its high yields, and the full role and disclosure concerning Chris Cook. Blockstream had not issued a comprehensive response at the time of writing.

marsbit1 год тому

The Full Story of How Crypto Unicorn Blockstream Is Mired in Serious Fraud Allegations

marsbit1 год тому

The Full Story Behind Encryption Unicorn Blockstream's Deep Entanglement in Serious Fraud Allegations

This article details allegations of serious fraud surrounding the crypto company Blockstream, founded by Bitcoin pioneer Adam Back. Investigation account NatInfoSec accuses Blockstream of raising billions through its Blockstream Mining Note (BMN) products, which offer high fixed yields of up to 20% from purported mining revenue. The core allegations are: 1) Blockstream's public mining hash rate (15 EH/s) appears insufficient to cover the massive payout obligations from sold BMN notes, raising questions about the true source of investor payouts. 2) Key executive Christopher William Cook, central to the mining operations, has a prior federal conviction for mail fraud, a fact not disclosed to investors. Cook's background and lavish lifestyle are highlighted as red flags. 3) The structure allows payouts from any source of BTC, not necessarily mining revenue, which critics argue gives it Ponzi-like characteristics. The controversy also touches on Bitcoin Standard Treasury Company (BSTR), a related entity planning a SPAC上市. Critics question whether BMN's liabilities and Cook's record should be disclosed in BSTR's filings. BitMEX Research offered a tempered analysis, confirming Cook's criminal record is likely true and the high yields concerning, but found other claims like insufficient抵押证据 less substantiated. Community debate centers on the need for verifiable proof of Blockstream's mining output and revenue. The article concludes that while fraud is not proven, BMN presents significant, unresolved questions regarding its actual scale, the source of its high fixed returns, the verifiability of its mining operations and payouts, and the full disclosure of associated risks and personnel backgrounds. Blockstream has not yet issued a formal response.

链捕手2 год тому

The Full Story Behind Encryption Unicorn Blockstream's Deep Entanglement in Serious Fraud Allegations

链捕手2 год тому

Торгівля

Спот
Ф'ючерси
活动图片