> ## 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

**key** \`\`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.

## Returns

A frozen `SolanaAuthorityChange` for `prepareTransaction`

**action** `'remove'` *required*

**key** `SolanaAuthorityKey` *required*

**permission** `undefined`

## See also

* [addEcdsaKey](https://docs.rhinestone.dev/wallets/custom-signer/sdk-reference/solana/add-ecdsa-key.md)


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