-
Groundhog: Linearly-Scalable Smart Contracting via Commutative Transaction Semantics
Authors:
Geoffrey Ramseyer,
David Mazières
Abstract:
Groundhog is a novel design for a smart contract execution engine based around concurrent execution of blocks of transactions. Unlike prior work, transactions within a block in Groundhog are not ordered relative to one another. Instead, our key design insights are first, to design a set of commutative semantics that lets the Groundhog runtime deterministically resolve concurrent accesses to shared…
▽ More
Groundhog is a novel design for a smart contract execution engine based around concurrent execution of blocks of transactions. Unlike prior work, transactions within a block in Groundhog are not ordered relative to one another. Instead, our key design insights are first, to design a set of commutative semantics that lets the Groundhog runtime deterministically resolve concurrent accesses to shared data. Second, some storage accesses (such as withdrawing money from an account) conflict irresolvably; Groundhog therefore enforces validity constraints on persistent storage accesses via a reserve-commit process. These two ideas give Groundhog a set of semantics that, while not as powerful as traditional sequential semantics, are flexible enough to implement a wide variety of important applications, and are strictly more powerful than the semantics used in some production blockchains today. Unlike prior smart contract systems, transactions throughput never suffers from contention between transactions. Using 96 CPU cores, Groundhog can process more than half a million payment transactions per second, whether between 10M accounts or just 2.
△ Less
Submitted 4 April, 2024;
originally announced April 2024.
-
Pricing Personalized Preferences for Privacy Protection in Constant Function Market Makers
Authors:
Mohak Goyal,
Geoffrey Ramseyer
Abstract:
Constant function market makers (CFMMs) are a popular decentralized exchange mechanism and have recently been the subject of much research, but major CFMMs give traders no privacy. Prior work proposes randomly splitting and shuffling trades to give some privacy to all users [Chitra et al. 2022], or adding noise to the market state after each trade and charging a fixed `privacy fee' to all traders…
▽ More
Constant function market makers (CFMMs) are a popular decentralized exchange mechanism and have recently been the subject of much research, but major CFMMs give traders no privacy. Prior work proposes randomly splitting and shuffling trades to give some privacy to all users [Chitra et al. 2022], or adding noise to the market state after each trade and charging a fixed `privacy fee' to all traders [Frongillo and Waggoner 2018]. In contrast, we propose a noisy CFMM mechanism where users specify personal privacy requirements and pay personalized fees. We show that the noise added for privacy protection creates additional arbitrage opportunities. We call a mechanism priceable if there exists a privacy fee that always matches the additional arbitrage loss in expectation. We show that a mechanism is priceable if and only if the noise added is zero-mean in the asset amount. We also show that priceability and setting the right fee are necessary for a mechanism to be truthful, and that this fee is inversely proportional to the CFMM's liquidity.
△ Less
Submitted 26 September, 2023;
originally announced September 2023.
-
Fair Ordering via Streaming Social Choice Theory
Authors:
Geoffrey Ramseyer,
Ashish Goel
Abstract:
Prior work studies the question of ``fairly'' ordering transactions in a replicated state machine. Each of $n$ replicas receives transactions in a possibly different order, and the system must aggregate the observed orderings into a single order. We argue that this problem is best viewed through the lens of social choice theory, in which (in the preference aggregation problem) rankings on candidat…
▽ More
Prior work studies the question of ``fairly'' ordering transactions in a replicated state machine. Each of $n$ replicas receives transactions in a possibly different order, and the system must aggregate the observed orderings into a single order. We argue that this problem is best viewed through the lens of social choice theory, in which (in the preference aggregation problem) rankings on candidates are aggregated into an election result.
Two features make this problem novel. First, the number of transactions is unbounded, and an ordering must be defined over a countably infinite set. And second, decisions must be made quickly, with only partial information. Additionally, some faulty replicas might alter their reported observations; their influence on the output should be bounded and well understood.
Prior work studies a ``$γ$-batch-order-fairness'' property, which divides an ordering into contiguous batches. If a $γ$ fraction of replicas receive $τ$ before $τ^\prime$, then $τ^\prime$ cannot be in an earlier batch than $τ$. We strengthen this definition to require that batches have minimal size ($γ$-batch-order-fairness can be vacuously satisfied by large batches) while accounting for the possibility of faulty replicas.
This social choice lens enables an ordering protocol with strictly stronger fairness and liveness properties than prior work. We study the Ranked Pairs method. Analysis of how missing information moves through the algorithm allows our streaming version to know when it can output a transaction. Deliberate construction of a tiebreaking rule ensures our algorithm outputs a transaction after a bounded time (in a synchronous network). Prior work relies on a fixed choice of $γ$ and bound on the number of faulty replicas $f$, but our algorithm satisfies our definition for every $\frac{1}{2}<γ\leq 1$ simultaneously and for any $f$.
△ Less
Submitted 27 February, 2024; v1 submitted 5 April, 2023;
originally announced April 2023.
-
Finding the Right Curve: Optimal Design of Constant Function Market Makers
Authors:
Mohak Goyal,
Geoffrey Ramseyer,
Ashish Goel,
David Mazières
Abstract:
Constant Function Market Makers (CFMMs) are a tool for creating exchange markets, have been deployed effectively in prediction markets, and are now especially prominent in the Decentralized Finance ecosystem. We show that for any set of beliefs about future asset prices, an optimal CFMM trading function exists that maximizes the fraction of trades that a CFMM can settle. We formulate a convex prog…
▽ More
Constant Function Market Makers (CFMMs) are a tool for creating exchange markets, have been deployed effectively in prediction markets, and are now especially prominent in the Decentralized Finance ecosystem. We show that for any set of beliefs about future asset prices, an optimal CFMM trading function exists that maximizes the fraction of trades that a CFMM can settle. We formulate a convex program to compute this optimal trading function. This program, therefore, gives a tractable framework for market-makers to compile their belief function on the future prices of the underlying assets into the trading function of a maximally capital-efficient CFMM.
Our convex optimization framework further extends to capture the tradeoffs between fee revenue, arbitrage loss, and opportunity costs of liquidity providers. Analyzing the program shows how the consideration of profit and loss leads to a qualitatively different optimal trading function. Our model additionally explains the diversity of CFMM designs that appear in practice. We show that careful analysis of our convex program enables inference of a market-maker's beliefs about future asset prices, and show that these beliefs mirror the folklore intuition for several widely used CFMMs. Develo** the program requires a new notion of the liquidity of a CFMM, and the core technical challenge is in the analysis of the KKT conditions of an optimization over an infinite-dimensional Banach space.
△ Less
Submitted 2 March, 2023; v1 submitted 6 December, 2022;
originally announced December 2022.
-
Augmenting Batch Exchanges with Constant Function Market Makers
Authors:
Geoffrey Ramseyer,
Mohak Goyal,
Ashish Goel,
David Mazières
Abstract:
Batch auctions are a classical market microstructure, acclaimed for their fairness properties, and have received renewed interest in the context of blockchain-based financial systems. Constant function market makers (CFMMs) are another market design innovation praised for their computational simplicity and applicability to liquidity provision via smart contracts. Liquidity provision in batch excha…
▽ More
Batch auctions are a classical market microstructure, acclaimed for their fairness properties, and have received renewed interest in the context of blockchain-based financial systems. Constant function market makers (CFMMs) are another market design innovation praised for their computational simplicity and applicability to liquidity provision via smart contracts. Liquidity provision in batch exchanges is an important problem, and CFMMs have recently shown promise in being useful within batch exchanges. Different real-world implementations have used fundamentally different approaches towards integrating CFMMs in batch exchanges, and there is a lack of formal understanding of different design tradeoffs.
We first provide a minimal set of axioms that are well-accepted rules of batch exchanges and CFMMs. These are asset conservation, uniform valuations, a best response for limit orders, and non-decreasing CFMM trading function. In general, many market solutions may satisfy all our axioms. We then describe several economically useful properties of market solutions. These include Pareto optimality for limit orders, price coherence of CFMMs (as a defence against cyclic arbitrage), joint price discovery for CFMMs (as a defence against parallel running), path independence for simple instances, and a locally computable response of the CFMMs in equilibrium (to provide them predictability on trade size given a market price). We show fundamental conflicts between some pairs of these properties. We then provide two ways of integrating CFMMs in batch exchanges, which attain different subsets of these properties. We further provide a convex program for computing Arrow-Debreu exchange market equilibria when all agents have weak gross substitute (WGS) demand functions on two assets -- this program extends the literature on Arrow-Debreu exchange markets and may be of independent interest.
△ Less
Submitted 21 June, 2024; v1 submitted 10 October, 2022;
originally announced October 2022.
-
SPEEDEX: A Scalable, Parallelizable, and Economically Efficient Decentralized EXchange
Authors:
Geoffrey Ramseyer,
Ashish Goel,
David Mazières
Abstract:
SPEEDEX is a decentralized exchange (DEX) that lets participants securely trade assets without giving any single party undue control over the market. SPEEDEX offers several advantages over prior DEXes. It achieves high throughput -- over 200,000 transactions per second on 48-core servers, even with tens of millions of open offers. SPEEDEX runs entirely within a Layer-1 blockchain, and thus achieve…
▽ More
SPEEDEX is a decentralized exchange (DEX) that lets participants securely trade assets without giving any single party undue control over the market. SPEEDEX offers several advantages over prior DEXes. It achieves high throughput -- over 200,000 transactions per second on 48-core servers, even with tens of millions of open offers. SPEEDEX runs entirely within a Layer-1 blockchain, and thus achieves its scalability without fragmenting market liquidity between multiple blockchains or rollups. It eliminates internal arbitrage opportunities, so that a direct trade from asset $\mathcal{A}$ to asset $\mathcal{B}$ always receives as good a price as trading through some third asset such as USD. Finally, it prevents certain front-running attacks that would otherwise increase the effective bid-ask spread for small traders. SPEEDEX's key design insight is its use of an Arrow-Debreu exchange market structure that fixes the valuation of assets for all trades in a given block of transactions. We construct an algorithm, which is both asymptotically efficient and empirically practical, that computes these valuations while exactly preserving a DEX's financial correctness constraints. Not only does this market structure provide fairness across trades, but it also makes trade operations commutative and hence efficiently parallelizable. SPEEDEX is prototyped but not yet merged within the Stellar blockchain, one of the largest Layer-1 blockchains.
△ Less
Submitted 2 March, 2023; v1 submitted 4 November, 2021;
originally announced November 2021.
-
Continuous Credit Networks and Layer 2 Blockchains: Monotonicity and Sampling
Authors:
Ashish Goel,
Geoffrey Ramseyer
Abstract:
To improve transaction rates, many cryptocurrencies have implemented so-called ''Layer-2'' transaction protocols, where payments are routed across networks of private payment channels. However, for a given transaction, not every network state provides a feasible route to perform the payment; in this case, the transaction must be put on the public ledger. The payment channel network thus multiplies…
▽ More
To improve transaction rates, many cryptocurrencies have implemented so-called ''Layer-2'' transaction protocols, where payments are routed across networks of private payment channels. However, for a given transaction, not every network state provides a feasible route to perform the payment; in this case, the transaction must be put on the public ledger. The payment channel network thus multiplies the transaction rate of the overall system; the less frequently it fails, the higher the multiplier.
We build on earlier work on credit networks and show that this network liquidity problem is connected to the combinatorics of graphical matroids. Earlier work could only analyze the (unnatural) scenario where transactions had discrete sizes.
Superficially, it might seem like the continuous case would be harder to examine. However, removing this assumption lets us make progress in two important directions. First, we give a partial answer to the ``monotonicity conjecture'' that previous work left open. This conjecture asks that the network's performance not degrade as capacity on any edge increases. And second, we construct here a network state sampling procedure with much faster asymptotic performance than off-the-shelf Markov chains ($O(\vert E\vert β(\vert E\vert))$, where $β(x)$ is the complexity of solving a linear program on $x$ constraints.)
We obtain our results by map** the underlying graphs to convex bodies and then showing that the liquidity and sampling problems reduce to bounding and computing the volumes of these bodies. The transformation relies crucially on the combinatorial properties of the underlying graphic matroid, as do the proofs of monotonicity and fast sampling.
△ Less
Submitted 26 June, 2020; v1 submitted 7 April, 2020;
originally announced April 2020.
-
Liquidity in Credit Networks with Constrained Agents
Authors:
Geoffrey Ramseyer,
Ashish Goel,
David Mazieres
Abstract:
In order to scale transaction rates for deployment across the global web, many cryptocurrencies have deployed so-called "Layer-2" networks of private payment channels. An idealized payment network behaves like a Credit Network, a model for transactions across a network of bilateral trust relationships. Credit Networks capture many aspects of traditional currencies as well as new virtual currencies…
▽ More
In order to scale transaction rates for deployment across the global web, many cryptocurrencies have deployed so-called "Layer-2" networks of private payment channels. An idealized payment network behaves like a Credit Network, a model for transactions across a network of bilateral trust relationships. Credit Networks capture many aspects of traditional currencies as well as new virtual currencies and payment mechanisms. In the traditional credit network model, if an agent defaults, every other node that trusted it is vulnerable to loss. In a cryptocurrency context, trust is manufactured by capital deposits, and thus there arises a natural tradeoff between network liquidity (i.e. the fraction of transactions that succeed) and the cost of capital deposits.
In this paper, we introduce constraints that bound the total amount of loss that the rest of the network can suffer if an agent (or a set of agents) were to default - equivalently, how the network changes if agents can support limited solvency guarantees.
We show that these constraints preserve the analytical structure of a credit network. Furthermore, we show that aggregate borrowing constraints greatly simplify the network structure and in the payment network context achieve the optimal tradeoff between liquidity and amount of escrowed capital.
△ Less
Submitted 17 March, 2020; v1 submitted 4 October, 2019;
originally announced October 2019.