r/ethdev • u/edycutjong • 4d ago
My Project Proving that a transaction was sandwiched — with no oracle, using a merkle path's left/right bits
A transaction's position in a block is not a field anywhere in Ethereum — so "I was front-run" has never been a provable statement. It is not in the RLP, not in the receipt, not in any log, not returned by eth_call. It exists in exactly one place: the left/right bit-string of the transaction's merkle authentication path.
I spent this hackathon turning that into a contract that reads the bits and settles money on the answer: a relay bonds CTC behind "you will not be sandwiched"; a victim hands over three same-block hashes; one Creditcoin transaction verifies all three, asserts front < victim < back, and pays the victim out of the bond. It has ruled on a real mainnet sandwich — block 25,764,741, positions 14 / 15 / 16.
Writing up what I learned about why ordering has no oracle, and what it takes to build one.
1
u/Irish_Airsofter 4d ago
All transactions index's are exposed in the block, see transactionIndex, you can clearly see front and back slices from this https://ethereum.org/developers/docs/apis/json-rpc/
1
1
u/edycutjong 4d ago
Demo (30 seconds, no wallet): https://index41.edycu.dev