msfew

发布于 2023-08-19到 Mirror 阅读

Wait it’s all PoW

0. Intro to PoW

Proof of Work (PoW, “one CPU one vote”) is a sexy mechanism.

It implements many features and solves many problems, including:

  • Decentralized and permissionless system (Bitcoin)

  • High security when total computing power is large

  • Truly clean and private money (clean ETH)

  • Relatively fair launch (Bitcoin again)

The only downsides might be "potential monopolization" and "energy consumption".

But in my opinion (I took a class on waste and energy last year as a sophomore, and did research on Bitcoin and Waste), it is acceptable to support a decentralized global financial system with some energy.

Overall, PoW is a good mechanism. Although Ethereum has struggled over the years to convert from PoW to PoS, PoW is still dominant in Ethereum's overall system and network or application layers.

PoWs are everywhere, and they are all PoWs.

1. PoW in Address

EOA & Contract

The address string (EOA address or contract address) is generated completely randomly, so in order to generate good looking address (like 0xdef1…) or more efficient address (like address with more 0s), numerous random computation need to be done, just like PoW.

Some tools for mining address:

Function Selector

Another kind of “address” is EVM function selector. Usually developers (especially MEV bot) mine for an efficient one with more 0s in it to save gas. There is also a database for function selectors (4byte.directory and samczsun’s eth sig).

Some tools for mining function selector:

Uniswap v4 Hooks

A newer one of “address” requires PoW is the Uniswap v4 hooks. “The hook permissions are determined by the hook address so you have to grind one with the desired permissions”. It is very dirty and clever.

2. PoW in DDoS

In an ideal world, the highest transaction quality means: anyone can send a transaction (no censorship); no spam; low fees.

However, we cannot achieve the perfect network. PoW is a simple and elegant approach to prevent spam by adding an extra layer of computing.

Testnet Faucet

I use Goerli PoW Faucet a lot in my daily development and testing.

While the usual testnet faucet is to sign up with an account and receive a fixed amount of testnet ETH, the PoW testnet faucet allows you to receive more testnet ETH depending on the amount of power you consume. More flexible.

PoW NFT Contract

At the beginning of the popular NFT project mint, the gas cost usually shoots up to a very high level, because a lot of people are doing the same mint operations, making the overall usage of the network very high.

This NFT contract does something like "PoW" within the contract, which increases the gas usage and mint cost on the validator side. This prevents DDoS and allows more suitable people to get the NFT.

Arbitrum Sequencer PoW Connection

The single sequencer model of rollup always faces the problem reliability and spam. There are multiple cases where rollup sequencer is down: Arbitrum Token Launch, and Optimism Delay.

Arbitrum had a proposal to score connections by PoW to disincentivize massive sybil attacks by MEV searchers on the Arbitrum sequencer.

3. Outro

In the finance world, winning requires you to be first, be smarter, or cheat.

PoW only requires you to be first. Maybe it’s fairer.