> ## Documentation Index
> Fetch the complete documentation index at: https://docs.streambird.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Ethereum Sign EIP-7702 Authorization

> Sign an EIP-7702 authorization using a managed wallet. An EIP-7702 authorization allows an externally owned account (EOA) to authorize a delegation / contract address without signing or submitting a transaction.

The private key **never leaves the vault** and is never exposed to the client.

<Snippet file="authorization.mdx" />

## Path Parameters

<ParamField path="wallet_id" type="string" required>
  Unique ID of the wallet used to sign the authorization.
</ParamField>

## Request Body

The request uses an **Ethereum JSON-RPC–compatible payload**.

<ParamField body="method" type="string" required>
  Must be `eth_sign7702Authorization`.
</ParamField>

<ParamField body="params" type="object" required>
  Parameters used to construct the authorization.

  <Expandable title="params">
    <ParamField body="contractAddress" type="string" required>
      Delegated contract address being authorized (hex, `0x`-prefixed).
    </ParamField>

    <ParamField body="chainId" type="string | number" required>
      Chain ID the authorization is valid for.
    </ParamField>

    <ParamField body="nonce" type="string | number" required>
      Authorization nonce.
    </ParamField>
  </Expandable>
</ParamField>

<Note>
  All fields are signed exactly as provided after normalization. Changing any value invalidates the signature.
</Note>

## Response

<ResponseField name="method" type="string">
  RPC method that was executed (`eth_sign7702Authorization`).
</ResponseField>

<ResponseField name="data" type="object">
  Signed authorization payload.

  <Expandable title="data">
    <ResponseField name="authorization" type="object">
      The signed authorization object.

      <Expandable title="authorization">
        <ResponseField name="chainId" type="string">
          Chain ID the authorization is valid for, returned as a string representation of the number.
        </ResponseField>

        <ResponseField name="contractAddress" type="string">
          Authorized contract address.
        </ResponseField>

        <ResponseField name="nonce" type="string">
          Authorization nonce, returned as a string representation of the number.
        </ResponseField>

        <ResponseField name="v" type="string">
          ECDSA recovery identifier.
        </ResponseField>

        <ResponseField name="r" type="string">
          ECDSA signature `r` value (hex).
        </ResponseField>

        <ResponseField name="s" type="string">
          ECDSA signature `s` value (hex).
        </ResponseField>

        <ResponseField name="yParity" type="number">
          Signature y-parity (`0` or `1`).
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

## Using the Signed Authorization

The returned signature can be included in an EIP-7702 transaction as part of an `authorizationList`, sent to a relay or bundler, or stored and replayed until the nonce is consumed.

To submit on-chain, recombine the signature parts into a standard Ethereum signature:

```
signature = r || s || yParity
```

## Notes

<Note>
  * This method does not broadcast a transaction.
  * The authorization is off-chain until included in a transaction.
  * Private keys are never exposed.
  * The same authorization can be reused until its nonce is consumed.
  * Input values for `chainId` and `nonce` may be provided as hex strings or decimal strings/numbers.
  * Response values for `chainId` and `nonce` are **always returned as strings**.
  * This endpoint signs EIP-712 typed data under the EIP-7702 domain.
</Note>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.moonkey.fun/v1/wallets/wallet_36kLvUkIIvyQPbdVr7Ackvh726L/rpc \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "method": "eth_sign7702Authorization",
      "params": {
        "contractAddress": "0x1234567890abcdef1234567890abcdef12345678",
        "chainId": "1",
        "nonce": "0"
      }
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "method": "eth_sign7702Authorization",
    "data": {
      "authorization": {
        "chainId": "1",
        "contractAddress": "0x1234567890abcdef1234567890abcdef12345678",
        "nonce": "0",
        "v": "1",
        "r": "0x2183aed038b571552e7692ebcc2b27578354c95dc6ea7e2ed1cb0fc46e5f37f9",
        "s": "0x2b11a93b69e8abfd3db613ed617520ea6826806c856199bdd818563d4c01d202",
        "yParity": 1
      }
    }
  }
  ```
</ResponseExample>
