From ca87c0e820f2ff335f8162312fb8c61c73b502ce Mon Sep 17 00:00:00 2001 From: Ryan Schneider Date: Thu, 12 Sep 2024 17:28:29 -0700 Subject: [PATCH] fixup: import Tab code --- docs/flashbots-protect/nonce-management.mdx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/flashbots-protect/nonce-management.mdx b/docs/flashbots-protect/nonce-management.mdx index f94f3641..f4b3fc0c 100644 --- a/docs/flashbots-protect/nonce-management.mdx +++ b/docs/flashbots-protect/nonce-management.mdx @@ -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. @@ -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: :" --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: