How to get adress from privateKey

how to generate sui adress from a keyPair. have any rpc or sdk function about this ?


Here the code you might want.

const keyPair = new Ed25519KeyPair(); // or Secp256k1...
const address = keyPair.getPublicKey().toSuiAddress();

found it from docs - Sui Wallet Specifications - Keys and Addresses | Sui Docs

1 Like