---
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" runner="cookbook/wallets/create-keypair">

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

```

```ts !! title="Web3.js v3" file=packages/docs-examples/cookbook/wallets/create-keypair/web3v3.ts#region=create

```

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

```

```py !! title="Python" file=packages/docs-examples/cookbook/wallets/create-keypair/python.py#region=create

```

```go !! title="Go" file=packages/docs-examples/cookbook/wallets/create-keypair/go/main.go#region=create

```

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

```

</CodeTabs>
