Skip to content

Commit

Permalink
fixup: import Tab code
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanschneider committed Sep 13, 2024
1 parent c939467 commit ca87c0e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions docs/flashbots-protect/nonce-management.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
title: Nonce Management
---

Normally, a wallet can call `eth_getTransactionCount` to get the next nonce to use for a transaction.
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

Normally, a wallet can call `eth_getTransactionCount` to get the next nonce to use for a transaction.
However, since transactions sent to Flashbots Protect are potentially sensitive, even exposing the incremented nonce can leak information about the user's activity.

As such, Flashbots Protect requires that all requests to `eth_getTransactionCount` be signed by the user when querying the `"pending"` nonce.
Expand Down Expand Up @@ -31,7 +34,7 @@ To authenticate your request, Flashbots endpoints require you to sign the payloa
curl -X POST -H "Content-Type: application/json" -H "X-Flashbots-Signature: <public key address>:<signature>" --data '{"jsonrpc":"2.0","method":"eth_getTransactionCount","params":["0xYOUR_ADDRESS","pending"],"id":1}' https://rpc.flashbots.net
```

The private key of the address your want to query must be used to sign the payload.
The private key of the address your want to query must be used to sign the payload.

The signature is calculated by taking the [EIP-191](https://eips.ethereum.org/EIPS/eip-191) hash of the json body encoded as UTF-8 bytes. Here's an example using ethers.js:

Expand Down

0 comments on commit ca87c0e

Please sign in to comment.