https://github.com/Quertyy/reth-private-transaction
https://github.com/Quertyy/reth-private-transaction
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/Quertyy/reth-private-transaction
- Owner: Quertyy
- Created: 2024-12-14T23:39:48.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-15T01:56:11.000Z (about 1 year ago)
- Last Synced: 2025-01-08T09:02:56.716Z (12 months ago)
- Language: Rust
- Size: 52.7 KB
- Stars: 27
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-reth - reth-private-transaction
README
# reth private transaction
This project extends [reth](https://github.com/paradigmxyz/reth) with a custom RPC method that allows users to bypass the public mempool and send transactions directly to block builders, protecting against frontrunning and sandwich attacks.
## Overview
This extension adds a new RPC method `eth_sendPrivateRawTransaction` to the standard Ethereum JSON-RPC API that enables private transaction submission directly to the following block builders:
- **Titan**
- **Beaverbuild**
- **rsync-builder**
By bypassing the public mempool, transactions are kept private until they are included in a block, significantly reducing the risk of frontrunning and sandwich attacks.
## Installation
```bash
# build the binary
cargo build --release
# run the binary with the `reth` commands
./target/release/reth-private-transaction node --authrpc.jwtsecret \
--datadir /data/mainnet/ \
--authrpc.jwtsecret /data/mainnet/secrets/jwt.hex \
--http --ws --http.addr 0.0.0.0 --ws.addr 0.0.0.0 \
--http.api txpool,web3,eth,debug,trace \
--ws.api txpool,web3,eth,debug,trace \
```
The RPC method will be automatically registered under the `eth` namespace
## Usage
Send a raw transaction privately using the new RPC method:
```json
{
"jsonrpc": "2.0",
"method": "eth_sendPrivateRawTransaction",
"params": ["0x..."], // Signed raw transaction hex
"id": 1
}
```
The method returns the transaction hash if at least one builder successfully accepts the transaction.