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

# removeEcdsaKey

> Remove a secp256k1 (ECDSA) key from a managed Solana account's Swig.

Builds the `authority` of a `{ destination: { chain, authority } }`
transaction. The role carrying the key is removed. The root role never
is, and neither is the last role able to manage authorities; the
orchestrator refuses both.

## Import

```ts theme={null}
import { removeEcdsaKey } from '@rhinestone/sdk/solana'
```

## Usage

```ts theme={null}
import { removeEcdsaKey, solanaDevnet } from '@rhinestone/sdk/solana'

const prepared = await account.prepareTransaction({
  destination: {
    chain: solanaDevnet,
    authority: removeEcdsaKey(recoveryPublicKey),
  },
})
```

## Parameters

<ParamField path="key" type="`0x${string}` | {}" required>
  The key to remove: a viem local account, or its secp256k1 public
  key as 33-byte compressed, 65-byte uncompressed or 64-byte x‖y hex.
</ParamField>

## Returns

A frozen `SolanaAuthorityChange` for `prepareTransaction`

<ResponseField name="action" type="'remove'" required />

<ResponseField name="key" type="SolanaAuthorityKey" required />

<ResponseField name="permission" type="undefined" />

## See also

* [addEcdsaKey](/wallets/custom-signer/sdk-reference/solana/add-ecdsa-key)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.