I want to create a paper wallet for solana addresses. But how do I generate the address and private key for Solana using javascript? Is there a simple library I can use without all the extra bells and whistles? I just want to generate an address and private key that's it.
- Did you try looking in the Solana cookbook?mikemaccana– mikemaccana ♦2022-08-08 15:47:35 +00:00Commented Aug 8, 2022 at 15:47
- solanacookbook.com/getting-started/…Patoshi パトシ– Patoshi パトシ2022-08-08 15:48:39 +00:00Commented Aug 8, 2022 at 15:48
- Yes that's it. Did you try solanacookbook.com/references/… ?mikemaccana– mikemaccana ♦2022-08-08 15:49:37 +00:00Commented Aug 8, 2022 at 15:49
Add a comment |
1 Answer
You can generate a keypair with the @solana/web3.js library. Per the Solana Cookbook:
import { Keypair } from "@solana/web3.js"; let keypair = Keypair.generate();