---
title: How to Create a Keypair
description:
  "Every transaction requires a signature from a keypair on Solana. Learn how to
  create Keypairs on Solana."
---

To send a transaction on the Solana blockchain, you need a valid signature from
a keypair or wallet. If you are
[connecting to a wallet application](/developers/cookbook/wallets/connect-wallet-react)
(eg. Phantom or Solflare), the wallet manages the keypair for you, so you don’t
need to create one yourself. However, if you are not using a wallet, you will
need to generate a keypair to sign your transactions.

<Callout type="warn">
  A keypair created this way holds a raw private key. Never embed one in
  client-side code or commit it to source control. For backend services in
  production, use a key-management backend instead — see [Signing in
  Production](/docs/core/transactions/signing-in-production).
</Callout>

### Extractable keypair

<CodeTabs storage="cookbook" flags="r">

```ts !! title="Kit" file=packages/docs-examples/cookbook/wallets/create-keypair/kit.ts#region=create

```

```ts !! title="Legacy" file=packages/docs-examples/cookbook/wallets/create-keypair/legacy.ts#region=create

```

```rust !! title="Rust" file=packages/docs-examples/cookbook/wallets/create-keypair/rust/src/main.rs#region=create

```

```py !! title="Python"
from solders.keypair import Keypair

keypair = Keypair()
print(f"address: {keypair.pubkey()}")
print(f"secret: {keypair.secret()}")
```

</CodeTabs>
