-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Motivation
MEV-Share's eth_sendPrivateTransaction is distinct from a bundle — it submits a single private transaction with configurable hints about what information to share with searchers. It is the primary method users and protocols use to get MEV protection while still allowing searchers to backrun.
The existing flashbots.zig covers eth_sendBundle and mev_sendBundle but not eth_sendPrivateTransaction.
API
Addition to flashbots.zig:
/// Options for eth_sendPrivateTransaction (MEV-Share).
pub const SendPrivateTxOpts = struct {
/// Raw signed transaction bytes.
tx: []const u8,
/// Maximum block number for inclusion. Null = current + 25.
max_block_number: ?u64 = null,
/// MEV-Share hint preferences — what to reveal to searchers.
preferences: ?TxPreferences = null,
pub const TxPreferences = struct {
/// Reveal calldata to searchers.
calldata: bool = false,
/// Reveal contract address to searchers.
contract_address: bool = false,
/// Reveal event logs to searchers.
logs: bool = false,
/// Reveal 4-byte function selector to searchers.
function_selector: bool = false,
/// Which builders to share with. Null = all Flashbots builders.
builders: ?[]const []const u8 = null,
};
};
pub const SendPrivateTxResult = struct {
tx_hash: [32]u8,
};
// New method on FlashbotsClient:
pub fn sendPrivateTransaction(
self: *FlashbotsClient,
allocator: std.mem.Allocator,
opts: SendPrivateTxOpts,
) !SendPrivateTxResultWire format
{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_sendPrivateTransaction",
"params": [{
"tx": "0x...",
"maxBlockNumber": "0x...",
"preferences": {
"fast": false,
"privacy": {
"hints": ["calldata", "logs", "function_selector"],
"builders": ["default"]
}
}
}]
}Auth via X-Flashbots-Signature (same as eth_sendBundle).
Relationship
- Complement to
mev_sendBundleinflashbots.zig - Used by
MevShareClient.sendTransactionin MEV-Share client module (mev_share.zig) #34
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request