How to Create a Keypair

Any transaction on the Solana blockchain requires a keypair or wallet. If you are connecting to a wallet, you do not need to worry about the keypair. Otherwise a keypair must be generated for signing transactions.

import { generateKeyPairSigner } from "@solana/web3.js";
 
const signer = await generateKeyPairSigner();
console.log("address: ", signer.address);