David Schwartz Proposes Reserved Slots to Prevent XRP Ledger Trades From Being Front-Run by Bots

Photo of Sam Daodu
By Sam Daodu Published

Quick Read

  • David Schwartz, the XRP Ledger's co-creator, has proposed a transaction reservation system that lets users book a priority slot and reveal their trade only after the order is locked, making those protected trades impossible to front-run.

  • The XRP Ledger already shuffles transactions into an unpredictable order to discourage front-running, but its own documentation admits the attack is hard rather than impossible, and a 2023 study estimated front-runners could extract around $1.4 million over two months.

  • Under the plan, reserving a slot would cost at least double the normal fee and be limited to the next 16 ledgers, with rising fees making it too expensive for anyone to hog the slots.

  • The proposal is not yet a formal amendment and would need support from at least 80% of XRP Ledger validators for two consecutive weeks before it could go live.

  • The Motley Fool told its subscribers to buy Amazon in 2002, Netflix in 2004, and Nvidia in 2005. Stock Advisor still publishes two new stock picks every month — and over 23 years, has more than quadrupled the S&P 500. Click here to receive the next recommendation.

This post may contain links from our sponsors and affiliates, and Flywheel Publishing may receive compensation for actions taken through them.
David Schwartz Proposes Reserved Slots to Prevent XRP Ledger Trades From Being Front-Run by Bots

© Ripple CTO David Schwartz, ALTA Blockchain Labs Co-founder and CVO Yaroslav Ivanov, and ALTA CBDO Brandon Crenshaw at Consensus 2024 in Austin, TX (CC0 1.0) by lazyamericanfox

Trades on the XRP Ledger, the network behind XRP (CRYPTO:XRP), sometimes settle for slightly less than the quoted price. Often that’s just the market moving, but other times, a bot sees the order coming, slips in front of it, and skims the difference—and that isn’t something supposed to be possible.

The issue drew attention when XRPresso, an XRP Ledger marketplace, said a serious front-running problem still hurts regular users on the network. David Schwartz—the ledger’s co-creator and now Ripple’s CTO Emeritus—said he wasn’t that worried about it, then proposed a simple fix to eliminate the attack. So, is it really a problem or not?

What Front-Running and Sandwich Attacks Do to a Trade

Xrp ripple altcoin trading on smartphone close up

DUSAN ZIDAR / Shutterstock.com

Front-running is exactly what it sounds like. A bot spots a trade that’s about to move the price and rushes its own order in ahead of it. It buys first, the trade pushes the price up, and the original trader pays more than they would have a second earlier—and the bot pockets the difference.

A sandwich attack is an even greedier version of that. The bot buys right before the target trade and sells right after it, leaving that trade squeezed in the middle—the filling between its two slices. The trader gets the worst price going in, and the bot books a profit on both sides. None of this breaks any rule of the blockchain, so the bot just takes advantage of the trade being visible before it goes through.

On most blockchains, a trade goes into a public queue before it’s processed, so anyone watching can see what’s coming and jump in front of it. On Ethereum (CRYPTO:ETH), where little stands in the way, it runs wild. One trader watched a $220,000 swap come back worth about $5,000 last year, after the bots were done with it. 

The XRP Ledger was built to make this much harder, which is why the new concern surprised people.

Why the XRP Ledger Was Supposed to Be Safe From This

Ripple (XRP) digital crypto currency. Stack of black and silver coins. Cyber money.

RuskaDesign / Shutterstock.com

The XRP Ledger handles the order of trades differently from a chain like Ethereum. There are no miners or block builders deciding which transaction goes first, and there’s no single operator who can quietly slot their own order ahead of everyone else’s. Instead, once the network agrees on a batch of transactions, it shuffles them into a set order using a formula that’s deliberately hard to predict. The whole point of that shuffle was to make front-running difficult.

However, difficult was never the same as impossible, and the people who built the ledger have always said so. The XRP Ledger’s own documentation calls the order hard to game, then admits front-running is “difficult, but not impossible.” 

The shuffle is only partly random, so a bot trying to jump a trade has roughly a coin-flip’s chance of getting in front of it. And because fees on the network are tiny, it can keep trying until one works. A 2023 study estimated that front-runners could have pulled around $1.4 million out of XRP Ledger traders over two months.

The fresh concern, raised by XRPresso, is about who gets an early look at the queue. Validators and the better-connected computers running the network can see the transactions waiting in line before the order is locked in. That lets them spot a pending trade, work out whether front-running or sandwiching it would pay, and fire off their own transactions to jump ahead of it.

The problem bites hardest on the ledger’s exchange and its automated market makers—the pools traders swap against instead of another person—because those are the easiest places to sandwich a trade.

How David Schwartz’s Reservation Fix Would Work

Businessman hand holding cryptocurrency XRP Ripple coin, Virtual money for internet banking and digital payment concept

CYB3RUSS / Shutterstock.com

Schwartz’s fix doesn’t try to hide every trade or rebuild how the ledger works. It lets a trader reserve a protected slot in a future round, while the actual trade stays hidden until the network locks in the order. By the time anyone can see it, it’s too late to get in front, and the reserved trade still runs first.

Under the hood, the plan adds two new pieces to the ledger. One, called ReservedTxns, is a list that holds the slots booked for an upcoming round. The other, a transaction type called TxnReserve, is what a trader sends to claim one of those slots. When that round arrives, the network runs the reserved trades first, in the order they were booked, then clears them out so they can’t run twice. Everyone else’s transactions get processed afterward, the usual way.

There are limits, on purpose. Booking a slot costs at least double the normal fee, and a reservation can only reach 16 ledgers ahead. Each round also caps how many slots exist, so no one can flood it. That higher fee does double duty, because the obvious worry is someone hogging every slot to freeze others out. 

The cost of doing that climbs as the slots fill, so an attacker would have to keep paying through the nose while everyone else waits them out.

Why the XRP Ledger Needs This Fix Now Even If It’s Not Urgent

Ripple XRP cryptocurrency physical coin placed on laptop keyboard and lit with blue and purple lights

DIAMOND VISUALS / Shutterstock.com

So if the ledger’s own co-creator isn’t worried, why bother building this at all? This is because of where the XRP Ledger is heading, not where it is today. For most of its life, the network’s exchange saw thin trading, so a rare front-run here or there cost almost nothing. That’s changing. The ledger now has more than 27,500 automated market maker pools, and trading activity is growing on it for the first time in years.

More upgrades are on the way, too. A draft change called AMM Swappable Curves would deepen the ledger’s trading pools, and native lending is working its way through the approval process. As more money moves on-chain, the size of a front-running problem grows with it, and a gap that didn’t matter at low volume starts to matter at high volume. The XRP Ledger has spent years selling itself as the safe, institution-ready chain, the one where whole categories of attacks can’t happen. Closing this gap fits that pitch.

Is XRP Ledger Front-Running a Real Threat or Just Housekeeping?

This seems more like housekeeping, not an emergency. The risk is genuine but small today, and Schwartz’s plan closes the opening before the XRP Ledger’s growing trading activity makes it worth attacking.

Moreover, the idea itself is sound. But the real test is whether it survives the process. For this to become anything, it has to be written up as a formal change and win support from at least 80% of the network’s validators, and held there for two weeks straight. Until there’s working code and a vote, this remains a strong proposal and a healthy debate rather than a comfirmed feature.

Photo of Sam Daodu
About the Author Sam Daodu →

Sam Daodu is a crypto analyst who's spent nearly a decade making blockchain understandable—no easy task when most whitepapers read like fever dreams. He writes for 24/7 Wall St., covering Bitcoin, altcoins, and crypto market analysis for investors. Before crypto, he was a tech writer (back when explaining "the cloud" was peak innovation). Since 2018, he's written for CoinTelegraph, Yahoo Finance, The Block, Cryptonews, Zypto, Rain, and more—basically anywhere people want crypto news without the headache. Sam runs MacLabs Marketing, a content agency for crypto brands tired of sounding like AI wrote their website. He also publishes free crypto education on his site for Web3 enthusiasts who think "gas fees" is a typo. When he's not writing or staring at charts, Sam's either: - Watching anime (currently convinced One Piece has better tokenomics than most altcoins) - At the gym sculpting himself into a Greek god - Listening to the music your mum warned you only bad boys listen to Connect: LinkedIn | Email | MacLabs Marketing

Featured Reads

Our top personal finance-related articles today. Your wallet will thank you later.

Continue Reading

Top Gaining Stocks

GLW Vol: 11,918,511
AMAT Vol: 6,908,249
CHTR Vol: 8,163,147
KLA
KLAC Vol: 5,902,592
WDC Vol: 5,338,513

Top Losing Stocks

HON Vol: 2,664,598
CTRA Vol: 73,319,495
VZ Vol: 28,777,829
MLM Vol: 557,041
EMN Vol: 330,369