add the crypto anarchist manifest by timothy c. may

This commit is contained in:
writer 2024-10-15 10:48:15 +09:00
parent 2e05fb2bc6
commit b6b2db512f
275 changed files with 4733 additions and 2552 deletions

80
MEV_projects/README.md Normal file
View file

@ -0,0 +1,80 @@
## projects and research
<br>
### tl; dr
<br>
* public discussion around MEV started by [pmcgooohan](https://twitter.com/pmcgoohancrypto?lang=en) on [e/ethereum](https://www.reddit.com/r/ethereum/comments/2d84yv/miners_frontrunning/), and it was formalized by [phildaiann et. al](https://twitter.com/phildaian)'s paper [flash boys 2](https://arxiv.org/abs/1904.05234). [here are the main essays and papers from the last years](history.md).
<br>
----
### what's the future of mev rewards?
<br>
here are some ideas (and below are some of the projects working on specific problems and solutions):
<br>
#### mev burning
* instead of having to deal with certain centralized actors, the network would put in place mechanism to burn mev (inspired by the burn mechanism found within EIP-1559).
* targets the centralizing potential that mev can have on validators, but removing the economic incentives of mev for validators.
* in this [ethresear.ch](https://ethresear.ch/t/burning-mev-through-block-proposer-auctions/14029/11) discussion, domothy recommends implementing an auction for the "right to build a block" on the network (happening at the validator level). networks slot times would change from 12 seconds to 16 seconds to allow for the period of bidding on block proposal rights.
<br>
#### mev smoothing
* in this [ethresear.ch](https://ethresear.ch/t/committee-driven-mev-smoothing/10408) and [this](https://notes.ethereum.org/cA3EzpNvRBStk1JFLzW8qg), francesco propose "Smoothing MEV means reducing the variance in the MEV that is captured by each validator, with the ultimate goal of getting the distribution of rewards for each validator to be as close as possible to uniform: a staker would then get a share of rewards proportional to their stake, just like with issuance."
* while smoothing is not available as an in-protocol ethereum, the general principle can be seen via smoothing liquid staking pools. rocketpool operates a [voluntary smoothing pool](https://docs.rocketpool.net/guides/node/fee-distrib-sp.html#initializing-the-fee-distributor) see also [eigenlayer discussions](https://twitter.com/sreeramkannan/status/1561736268005814273). [mev-share from flashbots](https://github.com/go-outside-labs/mev-toolkit/tree/main/MEV_projects/flashbots) has also introduced a proposal for programmable provate orderflow that rewards users (through a matchmaking protocol between users and searchers).
<br>
#### mev sharing
* while MEV smoothing/burning focuses on the end of the MEV supply chain and interactions between block builders and validators, mev sharing is in the beginning of the supply chain, for example with block builders that provide rebates (e.g. wallet-boost from blocknative).
<br>
####
<br>
---
### mev-related projects
<br>
* [espresso](espresso)
* [flashbots](flashbots)
* [manifold](manifold)
* [shutter](shutter)
* [dflow](dflow)
* [eden](eden)
* [jito](jito)
* [skip](skip)
* [cow](cow_protocol)
<br>
---
### resources
<br>
* [rules and strategies of a protocol, by data always](https://dataalways.substack.com/p/rules-and-strategies-of-a-protocol)
* [quantification of mev sharing designs (ofas), by danning sui](https://docs.google.com/presentation/d/1_pKKkUr_D-OvR2Kah56B0C0LYdO6zMECftBA_q7bM2c/edit#slide=id.g21fe09f5970_0_325)
* [projects addressing private order flows primitives](https://github.com/go-outside-labs/mev-toolkit/blob/main/MEV_searchers/private_order_flows/projects.md)
* [diamonds are forever, lvr is not, by mcmenamin et al.](https://arxiv.org/abs/2210.10601)
* [mev capturing amm, by josojo](https://ethresear.ch/t/mev-capturing-amm-mcamm/13336)
* [mev-protected cross-chain swaps, by cashmere](https://cashmerelabs.medium.com/cashmerelabs-testnet-1-0-2c11e23f36)

View file

@ -0,0 +1,32 @@
## [cow protocol](https://cow.fi/)
<br>
### tl; dr
<br>
- cow swap is the first trading interface built on top of cow protocol.
- it's a meta dex aggregator allowing to buy and sell tokens using gasless orders that are settled p2p among users or into on-chain liquidity (while providing mev protection).
- [rpc mev block](https://mevblocker.io/#rpc)
<br>
---
## resources
<br>
* [anatomy of solver bots](https://github.com/go-outside-labs/mev-toolkit/blob/main/anatomy_of_mev_bots/bots/cow-solvers.md)
* [cow protocol forum](https://forum.cow.fi/)
* [gnosis on cow protocol](https://docs.google.com/presentation/d/1vClubmyECHzYpT7-DzU6D45bc7iNpjF1NuiEblY-8ZQ/edit#slide=id.ge33f22559c_0_580)
* [dune boards for cow.fi and gnosis protocol](https://forum.cow.fi/t/cow-fi-analytics/369)
* [EIP-1271 for smart orders on cowswap](https://www.youtube.com/watch?v=6zj0_E8JWPQ)
* [useful cowswap resources](https://hackmd.io/@chenm/HJqjdkjvt)
* [yearn <> cowswap](https://medium.com/iearn/yearn-cow-swap-371b6d7cf3b3)
* [cow swap at mev.wtf 2022](https://docs.google.com/presentation/d/1vClubmyECHzYpT7-DzU6D45bc7iNpjF1NuiEblY-8ZQ/edit#slide=id.ge33f22559c_0_580)
* [examining the potential of frequent batch auctions in ethereum](https://www.youtube.com/watch?v=qSdE4LrPjG0)
* [designing an auction to process billions in volume for cow protocol, by xenophonlabs](https://mirror.xyz/xenophonlabs.eth/HcvesuQdywZ6Vg7EOrG0gl9E5V1PbLoMMVeCSYgRLNY)

View file

@ -0,0 +1,21 @@
## [dflow](https://twitter.com/DFlowProtocol)
<br>
### tl; dr
<br>
* cosmo app facilitating decentralized and transparent order flow auctions
* to create an order flow auction, a dex creates a listing on dflow that includes the amount of order flow that they are selling + price
* market makers can pay for this order flow to capitalize on any mev opportunities
<br>
---
### resources
<br>
* [dflow intro doc](https://t.co/cUEoH7rlkZ)

View file

@ -0,0 +1,22 @@
## [eden network](https://twitter.com/EdenNetwork)
<br>
### tl; dr
<br>
* ethereum infrastructure consisting of 3 core products:
1. rpc endpoint: users can add to their wallets to send txs to eden builders (frontrunning protection)
2. eden relay: connects validators to their network of block builders
3. eden bundles: connect searchers to their network of block builders
<br>
---
### resources
<br>
* [how to leverage eden network to trade with priority](https://medium.com/edennetwork/how-to-leverage-eden-network-to-trade-with-priority-1171851978c2)

View file

@ -0,0 +1,3 @@
## espresso
<br>

View file

@ -0,0 +1,55 @@
## flashbots
<br>
### tl;dr
<br>
* **flashbots** is a research and development organization focused on mitigating the negative externalities of current MEV extraction techniques.
* after the release of MEV-geth (and later MEV-boost), much of the computation related to MEV was taken off-chain, by a side-relay that allows MEV searchers to communicate directly with nodes and other participants. This lead to a decrease in fee congestion pricing.
* however, MEV “marketplaces” like flashbots, are quite centralized, since the vast majority of blocks flow through it.
<br>
##### bundles
* bundle/transaction profitability is determined by: fee per gas used, priority fee, and direct validator payments.
<br>
----
### in this dir
<br>
* [mev-boost](mev-boost)
* [suave](suave)
* [scripts](scripts)
* [tools](tools)
<br>
---
### resources
<br>
- [how to use flashbots](https://cryptomarketpool.com/how-to-use-flashbots/)
- [bundle pricing docs](https://docs.flashbots.net/flashbots-auction/searchers/advanced/bundle-pricing)
- [flashbots bundler explorer](https://flashbots-explorer.marto.lol/)
- [flashbots: frontrunning the mev crisis by thegostep](https://ethresear.ch/t/flashbots-frontrunning-the-mev-crisis/8251)
- [order flows kingmaker of block builders by noxx](https://noxx.substack.com/p/order-flows-kingmaker-of-the-block)
- [data analysis of Flashbots MEV](https://github.com/ivanmolto/mev-flashbots-unleashed)
- [flashbots' transparency board](https://transparency.flashbots.net/)
- [flashbots' research topics](https://github.com/flashbots/mev-research)
- [mev economics](https://www.youtube.com/playlist?list=PLXzKMXK2aHh7bW0j2dhpnLNiIJIMnPgsD)

View file

@ -0,0 +1,54 @@
## mev-boost
<br>
### tl,dr
<br>
* [mev-boost](https://github.com/flashbots/mev-boost#installing) is a middleware run by validators to democratize the block-building market with a implementation of [proposer-builder-separation (PBS)](https://ethresear.ch/t/proposer-block-builder-separation-friendly-fee-market-designs/9725) for proof-of-stake Ethereum.
* pbs was initially proposed by Ethereum researchers as a response to the risk that MEV poses to decentralization of consensus networks.
* [mev-boost+](https://hackmd.io/@layr/SkBRqvdC5) is an iteration that uses [eigen layer](https://github.com/go-outside-labs/mev-toolkit/blob/main/MEV_and_trading/staking/EigenLayer.md), a meta-slashing protocol on ethereum, to return agency to block proposers (allowing them to partition an execution block).
<br>
<img width="350" src="https://user-images.githubusercontent.com/1130416/190929561-afe6918f-6f34-459e-9d2b-06902918d4d0.png">
<br>
<img width="350" src="https://user-images.githubusercontent.com/1130416/208611598-ed51d4e6-b51d-44c4-9d72-cf061aea3690.png">
<br>
<br>
---
### resources
<br>
* [mev-boost, relays, self-sovereignty](https://mirror.xyz/mevwaifu.eth/Xo_5rIpRQpFOC__kYfjLJVOFwlSZH2n8tUnHoXo6VyI)
* [mev-boost on a goerli validator](https://mirror.xyz/steinkirch.eth/Xo_5rIpRQpFOC__kYfjLJVOFwlSZH2n8tUnHoXo6VyI)
* [running mev-boost-relay at scale](https://www.notion.so/Running-mev-boost-relay-at-scale-4040ccd5186c425d9a860cbb29bbfe09)
* [install mev-boost in ubuntu](https://github.com/metanull-operator/eth2-ubuntu/blob/master/v2/mev-boost.md)
* [mev-boost docker image](https://hub.docker.com/r/flashbots/mev-boost)
* [dune mev-boost dashboard](https://dune.com/ChainsightAnalytics/mev-after-ethereum-merge)
* [why mev boost](https://writings.flashbots.net/writings/why-run-mevboost/)
* [mev-boost post-merge](https://ethresear.ch/t/mev-boost-merge-ready-flashbots-architecture/11177)
* [mev-boost builder stats dune](https://dune.com/ChainsightAnalytics/mev-after-ethereum-merge)
* [flashbots analysis of mev in eth2](https://github.com/flashbots/eth2-research/blob/main/notebooks/mev-in-eth2/eth2-mev-calc.ipynb)
* [ethereum specs for block builder](https://github.com/ethereum/builder-specs)
* [list of mev-boost payout addresses](https://gist.github.com/metachris/a4d10ff59cad5ffe3cf0f2c6e91fc0bc)
* [merge ready flashbots architecture](https://hackmd.io/@manifold/S1jRmGIPF)
* [mevboost.org](https://www.mevboost.org/)

View file

@ -0,0 +1,5 @@
## scripts
<br>
* [flashbots bundle](https://github.com/bt3gl-labs/Blockchain-DeFi-and-MEV/blob/main/MEV/scripts/flashbots-bundle.py) (or full instructions, see [this post](https://lilithsecurity.substack.com/p/-mev-wednesdays-intro-to-flashbots)).

View file

@ -0,0 +1,111 @@
#!/usr/bin/env python3
# This script sends a bundle of two transactions which transfer ETH into a random account.
# Full instructions: https://mirror.xyz/steinkirch.eth/rGyGGoOLek_pCoJVlSFSjjFL-b5_Mw_P5hC3giwUCtc
import os
import secrets
from pathlib import Path
from dotenv import load_dotenv
from flashbots import flashbot
from eth_account.account import Account
from eth_account.signers.local import LocalAccount
from web3 import Web3, HTTPProvider
from web3.exceptions import TransactionNotFound
from web3.types import TxParams
def env(key: str) -> str:
load_dotenv(Path('.') / '.env')
return os.getenv(key)
def random_account() -> LocalAccount:
key = "0x" + secrets.token_hex(32)
return Account.from_key(key)
def main():
SENDER_KEY = env("SENDER_KEY")
SIGNER_KEY = env("SIGNER_KEY")
PROVIDER_URL = env("PROVIDER_URL")
CHAIN_ID = int(env("CHAIN_ID"))
# 1. account to send the transfer and sign transactions
sender: LocalAccount = Account.from_key(SENDER_KEY)
# 2. account to receive the transfer
receiverAddress: str = random_account().address
# 3. account to sign bundles and flashbots reputation
signer: LocalAccount = Account.from_key(SIGNER_KEY)
w3 = Web3(HTTPProvider(PROVIDER_URL))
flashbot(w3, signer, "https://relay-goerli.flashbots.net")
print(f"✅ Sender address: {sender.address}")
print(f"✅ Receiver address: {receiverAddress}")
print(f"✅ Sender account balance: {Web3.fromWei(w3.eth.get_balance(sender.address), 'ether')} ETH")
print(f"✅ Receiver account balance: {Web3.fromWei(w3.eth.get_balance(receiverAddress), 'ether')} ETH")
# 4. bundle two EIP-1559
nonce = w3.eth.get_transaction_count(sender.address)
tx1: TxParams = {
"to": receiverAddress,
"value": Web3.toWei(0.005, "ether"),
"gas": 21000,
"maxFeePerGas": Web3.toWei(300, "gwei"),
"maxPriorityFeePerGas": Web3.toWei(50, "gwei"),
"nonce": nonce,
"chainId": CHAIN_ID,
"type": 2,
}
tx1_signed = sender.sign_transaction(tx1)
tx2: TxParams = {
"to": receiverAddress,
"value": Web3.toWei(0.005, "ether"),
"gas": 21000,
"maxFeePerGas": Web3.toWei(300, "gwei"),
"maxPriorityFeePerGas": Web3.toWei(50, "gwei"),
"nonce": nonce + 1,
"chainId": CHAIN_ID,
"type": 2,
}
bundle = [
{"signed_transaction": tx1_signed.rawTransaction},
{"signer": sender, "transaction": tx2},
]
# 5. Send bundle until it gets mined
while True:
block = w3.eth.block_number
print(f"✨ Simulating on block {block}...")
try:
w3.flashbots.simulate(bundle, block)
print("✅ Simulation successful!")
except Exception as e:
print(f"🚨 Simulation error: {e}")
return
print(f"Sending bundle targeting next block: {block+1}...")
send_result = w3.flashbots.send_bundle(bundle, target_block_number=block + 1)
send_result.wait()
try:
receipts = send_result.receipts()
print(f"\n✅ Bundle was mined in block {receipts[0].blockNumber}\a")
break
except Exception as e:
print(f"Bundle not found in block {block+1}: {e}")
print(f"✅ Sender account balance: {Web3.fromWei(w3.eth.get_balance(sender.address), 'ether')} ETH")
print(f"✅ Receiver account balance: {Web3.fromWei(w3.eth.get_balance(receiverAddress), 'ether')} ETH")
if __name__ == "__main__":
main()

View file

@ -0,0 +1,25 @@
## suave
<br>
### tl; dr
<br>
* the thesis is that private order flow and cross-domain MEV may be the primary risk factors for centralization in the supply chain
* suave will be an app chain to serve as a plug-and-play mempool and decentralized block builder for any blockchain
* suave is developing three components:
* universal preference environment: a chain and mempool aggregator
* optimal execution environment: a network of executors to provide the best transaction execution
* a decentralized block building network
<br>
---
### resources
<br>
* [first article designing suave](https://writings.flashbots.net/the-future-of-mev-is-suave)
* [suave economic model](https://collective.flashbots.net/t/suave-economic-security-models/1070)

View file

@ -0,0 +1,7 @@
## tools
<br>
* [mev-inspect-py](https://github.com/flashbots/mev-inspect-py)
* [mev bundle generator](https://github.com/Alcibiades-Capital/mev_bundle_generator).

69
MEV_projects/history.md Normal file
View file

@ -0,0 +1,69 @@
### canonical readings
<br>
#### 2023
- [⭐️⭐⭐⭐ illuminating ethereum's order flow landscape, by angela lu](https://writings.flashbots.net/illuminate-the-order-flow)
#### 2022
- [⭐️⭐⭐⭐ towards a theory of mev I, by diamandis et al.](https://people.eecs.berkeley.edu/~ksk/files/MEV_CFMM.pdf)
#### 2021
- [⭐⭐⭐ mev and me, by paradigm](https://research.paradigm.xyz/MEV)
- [⭐⭐⭐ return to the dark forest, by rekt](https://rekt.news/return-to-the-dark-forest/)
- [⭐⭐⭐ hiding in plain sight, by samczsun](https://samczsun.com/hiding-in-plain-sight/)
- [⭐⭐⭐⭐ we live in a mempool, by tom schmidt](https://medium.com/dragonfly-research/we-live-in-a-mempool-backrunning-the-mev-crisis-a4ea0b493b05)
- [⭐️⭐⭐ how to light up the dark forest, by robert miller](https://writings.flashbots.net/writings/the-anatomy-of-an-inspector/)
- [⭐️⭐ the 0 to 1 guide to mev, by blockchain at berkeley](https://calblockchain.mirror.xyz/c56CHOu-Wow_50qPp2Wlg0rhUvdz1HLbGSUWlB_KX9o)
- [⭐️⭐ how to build an ethereum mining pool, by dragonfly](https://medium.com/dragonfly-research/how-to-build-an-ethereum-mining-pool-6be356520b7a)
- [⭐️⭐⭐️ how i learned to stop worrying and love mev, by sreeni](https://medium.com/dragonfly-research/dr-reorg-or-how-i-learned-to-stop-worrying-and-love-mev-2ee72b428d1d)
- [⭐️⭐️⭐️ quantifying blockchain extractable value: how dark is the forest?, by kaihua qin et al.](https://arxiv.org/pdf/2101.05511.pdf)
- [⭐️⭐️⭐️ the enemy of your enemy is not your friend, by kobayashi](https://fiona.mirror.xyz/QXdCOAggA5g_j5R_JpO-V5LqK89EbimnYIV6c2rOsT0)
- [⭐️⭐️⭐️⭐️ foundations of blockchains and mev, by tim roughgarden](https://timroughgarden.github.io/fob21/)
#### 2020
- [⭐️⭐⭐⭐⭐ escaping the dark forest, by samczsun](https://samczsun.com/escaping-the-dark-forest/)
- [⭐️⭐⭐ ethereum is a dark forest, by paradigm](https://www.paradigm.xyz/2020/08/ethereum-is-a-dark-forest)
- [⭐️⭐️⭐️ tricking frontrunners into being transaction relayers, by sankar4033](https://ethresear.ch/t/surrogeth-tricking-frontrunners-into-being-transaction-relayers/6937/1)
#### 2019
- [⭐⭐⭐⭐ flash boys 2.0, by p. daian et al.](https://arxiv.org/pdf/1904.05234.pdf)
- [⭐⭐️⭐️ transparent dishonesty: front-running attacks on blockchain, by shayan eskandari et al.](https://arxiv.org/pdf/1902.05164.pdf)
#### 2017
- [⭐️⭐️⭐️⭐️ implementing ethereum trading front-runs on the bancor exchange, by ivan bogatyy](https://hackernoon.com/front-running-bancor-in-150-lines-of-python-with-ethereum-api-d5e2bfd0d798)
<br>
---
### [bonus] 𝕥𝕙𝕖 𝕞𝕒𝕜𝕖 𝕠𝕗 𝕒 𝕔𝕪𝕡𝕙𝕖𝕣𝕡𝕦𝕟𝕜
<br>
* [⭐️⭐️⭐️ teal organizations wiki](https://reinventingorganizationswiki.com/)
* [⭐️⭐️⭐️⭐️⭐️ the hacker manifest, by the mentor](http://phrack.org/issues/7/3.html)
* [⭐️⭐️⭐️⭐️⭐️ bitcoin whitepaper, by satoshi nakamoto](https://bitcoin.org/bitcoin.pdf)
* [⭐️⭐️⭐️⭐️ the cypherpunk manifest, by eric hughes](https://activism.net/cypherpunk/manifesto.html)
* [⭐️⭐️⭐️ the meaning of decentralization, by vitalik](https://medium.com/@VitalikButerin/the-meaning-of-decentralization-a0c92b76a274)
* [⭐️⭐️⭐️⭐️ the crypto anarchist manifest, by timothy c. may](https://nakamotoinstitute.org/crypto-anarchist-manifesto/)
* [⭐️⭐️⭐️⭐️⭐️ a graduate course in applied cryptography, by dan boneh](http://toc.cryptobook.us/)
<br>
<br>

View file

@ -0,0 +1,21 @@
## [jito labs](https://twitter.com/jito_labs)
<br>
### tl; dr
<br>
* solana liquid staking service that distributes mev rewards to users
* $SOL holders can swap to JitoSol, enabling constant liquidity and mev rewards
<br>
---
### resources
<br>
* [jito labs intro docs](https://t.co/nM9SQbEP2e)

View file

@ -0,0 +1,21 @@
## [manifold](https://twitter.com/foldfinance)
<br>
### tl; dr
<br>
* manifold works direct with order flow producers to split profits between manifold and the protocol
* big hyped integration with sushiswap
<br>
---
### resources
<br>
* [manifold introduces mevETH](https://twitter.com/foldfinance/status/1643244617284870144)

View file

@ -0,0 +1,23 @@
## [shutter dao](https://twitter.com/project_shutter)
<br>
### tl; dr
<br>
* shutter plans to encrypt txs using threshold cryptography on ethereum and l2s.
* shutter dao hires nodes called keypers, which generate cryptographic keys with which users encrypt their txs
* keypers act as a set of nodes that encrypt and decrypt txs in a decentralized manner. txs are fully encrypted until the order of the txs in a block is finalized.
<br>
---
### resources
<br>
* [shutter docs](https://t.co/g6QILKlpRH)

View file

@ -0,0 +1,23 @@
## [skip](https://twitter.com/SkipProtocol)
<br>
### tl; dr
<br>
* on cosmos, txs are processed "first come first server", which prevents frontrunning and sandwich attacks but incentivizes searchers to spam the network when profitable mev opportunies are found.
* skip is creating a marketplace where searchers can submit bundles for quicker execution at the cost of a fee (which is redistributed to validators and user).
<br>
---
### resources
<br>
* [skip protocol docs](https://twitter.com/maria_defiyield/status/1595060020601028609/photo/1)
* [mev on osmosis](https://twitter.com/SkipProtocol/status/1631399189920768005)