cargo
Rust package manager (36 subcommands).
boneh-roughgarden-wev
Boneh-Roughgarden WEV Skill
Full skill instructions
Trit: 0 (ERGODIC) - Mechanism design at equilibrium
Stanford FDCI research bridge connecting Dan Boneh's cryptographic primitives (ZK proofs, BLS signatures, threshold cryptography) with Tim Roughgarden's mechanism design (TFM, MEV mitigation, welfare maximization).
WEV = World Extractable Value: Protocol-aligned value extraction via GF(3) conservation, not adversarial MEV.
| Research | Authors | Key Insight | WEV Connection |
|---|---|---|---|
| SPEEDEX | Ramseyer, Ruan, Goyal, Duffie, Mazières | Batch DEX eliminating front-running | No ordering → no MEV → pure WEV |
| Groundhog | Ramseyer, Mazières | Commutative transaction semantics | Deterministic concurrency = SPI |
| TFM Post-MEV | Bahrani, Garimidi, Roughgarden | Active block producer model | Searcher-Proposer separation |
| Collusion-Resilience | Chung, Roughgarden, Shi | Collusion-proof mechanisms | GF(3) tripartite structure |
| Primitive | Paper | Application |
|---|---|---|
| BLS Signatures | Boneh-Lynn-Shacham 2001 | Threshold aggregation, DRAND |
| ZK Proofs | Groth16, PLONK contributions | On-chain state verification |
| VRFs | Micali, Rabin, Vadhan + Boneh | Unpredictable determinism |
| Recursive SNARKs | Nova (Kothapalli, Setty, Boneh) | Incremental verification |
| Concept | Application | GF(3) Mapping |
|---|---|---|
| Incentive Compatibility | Users report true valuations | Reafference = prediction ≡ observation |
| Welfare Maximization | Total surplus optimization | sum(trits) ≡ 0 ⟹ balanced extraction |
| DSIC + OCA-proofness | No collusion advantage | Tripartite prevents 2-party collusion |
| SAKA Mechanism | ~50% welfare guarantee | Reserve-commit = bulk-boundary |
MEV = Adversarial extraction by block producers
= front-running + sandwich attacks + reordering
= User harm + market inefficiency
WEV = Protocol-aligned extraction
= base_value × staleness_mult × scarcity_mult
= Sequencing advantage without user harm
Key Difference: WEV emerges from GF(3)-conserved triads, not transaction reordering.
From GAY_LITEPAPER:
# WEV extraction function
function extract_wev(agent, world)
base = compute_base_value(agent.colors)
staleness = exp(world.age / STALENESS_CONSTANT)
scarcity = 1 / (1 + world.color_frequency[agent.current_color])
return base * staleness * scarcity
end
# GF(3) conservation ensures no zero-sum extraction
# WEV(A) + WEV(B) + WEV(C) > 0 when sum(trits) ≡ 0 (mod 3)
SPEEDEX eliminates MEV via batch execution with Arrow-Debreu pricing:
Traditional DEX:
tx_1 → tx_2 → tx_3 (ordering matters → MEV)
SPEEDEX:
{tx_1, tx_2, tx_3} → uniform_price (batch → no MEV)
GF(3) Mapping:
struct SPEEDEXTriad
sell_order::Order # trit = -1 (supply)
price_oracle::Oracle # trit = 0 (equilibrium)
buy_order::Order # trit = +1 (demand)
end
# Conservation: supply + equilibrium + demand = 0
# No ordering → no front-running → pure WEV
Groundhog's key insight: Commutative semantics = Order independence = SPI.
# From Groundhog paper (arXiv:2404.03201)
#
# Transactions within a block are NOT ordered relative to one another.
# Instead: commutative semantics deterministically resolve concurrent accesses.
struct GroundhogBlock
transactions::Set{Transaction} # Unordered set
reserve_commit::TwoPhaseProtocol
# Commutative resolution
function execute(self)
# All tx execute concurrently
# Conflicts resolved via reserve-commit (not ordering)
parallel_execute(self.transactions)
end
end
# This IS SPI: same transactions, any order → same result
WEV in Groundhog:
Roughgarden's SAKA mechanism separates roles:
Traditional:
Proposer = Searcher = Block Producer (can extract MEV)
SAKA:
Searcher: Finds value extraction opportunities
Proposer: Commits to block without seeing content
→ Searchers compete, proposer is "MEV-blind"
GF(3) Tripartite Mapping:
const TRIPARTITE_ROLES = (
MINUS = :Verifier, # Checks validity, slashes violations
ERGODIC = :Coordinator, # SAKA mechanism, price oracle
PLUS = :Searcher, # Finds WEV opportunities
)
struct TripartiteTFM
searchers::Vector{Agent} # trit = +1, find opportunities
coordinator::SAKA # trit = 0, mechanism
verifiers::Vector{Agent} # trit = -1, check proofs
# Conservation: searcher revenue funds verifier/coordinator
# No single party extracts MEV
end
using Catlab.CategoricalAlgebra, ACSets
@present SchWEVExtraction(FreeSchema) begin
# Actors
Agent::Ob
Searcher::Ob
Proposer::Ob
# Resources
Transaction::Ob
Block::Ob
# Extraction
WEVOpportunity::Ob
# Morphisms
searcher_agent::Hom(Searcher, Agent)
proposer_agent::Hom(Proposer, Agent)
finds::Hom(WEVOpportunity, Searcher)
involves::Hom(WEVOpportunity, Transaction)
included_in::Hom(Transaction, Block)
proposed_by::Hom(Block, Proposer)
# Attributes
Value::AttrType
Trit::AttrType
Seed::AttrType
Color::AttrType
opportunity_value::Attr(WEVOpportunity, Value)
opportunity_trit::Attr(WEVOpportunity, Trit)
tx_seed::Attr(Transaction, Seed)
tx_color::Attr(Transaction, Color)
block_gf3_sum::Attr(Block, Trit)
# GF(3) Constraint: sum of trits in block ≡ 0 (mod 3)
end
@acset_type WEVExtraction(SchWEVExtraction,
index=[:searcher_agent, :finds, :included_in])
Shaw's lalalune/predimarket represents prediction market meets AI agents:
# Connection: AI agents as searchers in TFM
struct ElizaSearcher <: AbstractSearcher
model::ElizaOS
strategy_space::Vector{Symbol}
wev_history::Vector{Float64}
trit::Int # GF(3) assignment
end
# Agents find WEV by predicting outcomes
function find_wev(agent::ElizaSearcher, market::PredictionMarket)
prediction = agent.model(market.state)
if confidence(prediction) > THRESHOLD
return WEVOpportunity(
agent=agent,
market=market,
expected_value=prediction.value,
trit=sign(prediction.direction)
)
end
end
The Stanford AI x Web3 Lab (FDCI + Eliza Labs partnership) focuses on:
WEV extraction operates across the bulk-boundary correspondence:
BOUNDARY (Agents) BULK (Entropy/Proofs)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Searcher agents ←→ WEV opportunities (stored)
Proposer commits ←→ Block entropy records
Verifier proofs ←→ Reafference proofs
Color generation ←→ Deterministic seeds
/// WEV Extraction via Boneh-Roughgarden TFM
module wev_extraction::tfm {
use hyperbolic_bulk::entropy_triads::{EntropyRecord, EntropyTriad};
struct WEVOpportunity has store, drop, copy {
searcher: address,
tx_set: vector<u64>, // References to EntropyRecords
expected_value: u64,
trit: u8,
commitment_hash: vector<u8>,
}
struct SAKABlock has store, drop, copy {
opportunities: vector<WEVOpportunity>,
proposer: address,
gf3_sum: u8,
gf3_conserved: bool,
extracted_wev: u64,
}
/// Commit WEV opportunity (searcher phase)
public entry fun commit_opportunity(
account: &signer,
tx_set: vector<u64>,
commitment_hash: vector<u8>,
) acquires WEVStore {
// Searcher commits without revealing content
// Commitment = hash(opportunity || nonce)
}
/// Reveal and extract (proposer phase)
public entry fun reveal_and_extract(
account: &signer,
opportunity_id: u64,
nonce: vector<u8>,
) acquires WEVStore {
// Verify commitment
// Check GF(3) conservation
// Extract WEV proportionally
}
}
boneh-roughgarden-wev (0) ⊗ gay-mcp (+1) ⊗ bisimulation-game (-1) = 0 ✓
speedex-batch (0) ⊗ groundhog-commutative (0) ⊗ hyperbolic-bulk (0) = 0 ✓
tfm-post-mev (0) ⊗ searcher (+1) ⊗ verifier (-1) = 0 ✓
from wev_extraction import TFMEngine, WEVOpportunity, SAKAMechanism
# Initialize TFM with GF(3) constraints
tfm = TFMEngine(
mechanism=SAKAMechanism(welfare_bound=0.5),
gf3_conservation=True,
seed=0x42D
)
# Searcher finds opportunity
opportunity = WEVOpportunity(
tx_set=[tx1, tx2, tx3],
expected_value=100.0,
trit=1 # PLUS (generative)
)
# Commit (hash only, no content revealed)
commitment = tfm.commit(opportunity, nonce=random_bytes(32))
# Later: reveal and extract
wev_extracted = tfm.reveal_and_extract(
commitment,
opportunity,
nonce
)
# Verify GF(3) conservation
assert tfm.gf3_conserved()
using BonehRoughgardenWEV
# Create TFM with SAKA mechanism
tfm = TFMEngine(
mechanism = SAKAMechanism(welfare_bound = 0.5),
gf3_conservation = true,
seed = 0x42D
)
# Find WEV opportunities
opportunity = find_wev(tfm, transaction_pool)
# Extract with GF(3) balance
wev = extract_wev!(tfm, opportunity)
# Verify conservation
@assert gf3_conserved(tfm) "GF(3) violation!"
lib/tfm_engine.jl - Transaction Fee Mechanism corelib/saka.jl - SAKA mechanism implementationlib/speedex_batch.jl - SPEEDEX batch executionlib/groundhog_commutative.jl - Commutative semanticslib/wev_extraction.jl - WEV computationcontracts/wev_extraction.move - Aptos Move contractSkill Name: boneh-roughgarden-wev
Type: Mechanism Design / Cryptographic Economics
Trit: 0 (ERGODIC)
Key Property: GF(3)-conserved value extraction via commutative TFM
Rust package manager (36 subcommands).
Translate Figma nodes into production-ready code with 1:1 visual fidelity using the Figma MCP workflow (design context, screenshots, assets, and project-convention translation). Trigger when the user provides Figma URLs or node IDs, or asks to implement designs or components that must match Figma...
**Status**: 🌳 Production Ready (upstream in StringZilla v3+) **Type**: High-Performance String Operations / SIMD-Accelerated Text Processing **Principle**: Zero-copy views, SIMD/SWAR acceleration, deterministic hashing **Frame**: Cross-language interoperability (C, C++, Python, Rust, Go, Swift, ...
Conformal Geometric Algebra (CGA) for circles, spheres, and Möbius transformations
Verifies code implements exactly what documentation specifies for blockchain audits. Use when comparing code against whitepapers, finding gaps between specs and implementation, or performing compliance checks for protocol implementations.
Systems programming and performance optimization using Zig. Provides low-level abstractions, memory-safe compiled code, and performance benchmarking. Use for system-level operations, optimization, and interoperability with C/POSIX APIs.
PayPal MCP server integration for invoices, payments, subscriptions, disputes, and transaction reporting via @paypal/mcp.
Unison language - content-addressed functional programming with abilities for effects, distributed computing, and structural types. Use for pure functional code, effect management, distributed systems, and refactoring-safe codebases.
Google Tasks management via TasksACSet. Transforms task operations into GF(3)-typed Interactions, routes to triadic queues, detects saturation for task-zero-as-condensed-state.
World C Skill
Syrup binary serialization for OCapN/CapTP wire format. Canonical encoding for capability messages.
Install Codex skills into $CODEX_HOME/skills from a curated list or a GitHub repo path. Use when a user asks to list installable skills, install a curated skill, or install a skill from another repo (including private repos).
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience