EcKeyPair Best Pratices

Recommendations

Always Specify the Network

Always specify the network parameter to avoid accidentally using mainnet keys on testnet or vice versa.

Use fromWIF() for Persistent Keys

Use fromWIF() for persistent keys and generateRandomKeyPair() only for ephemeral use cases such as testing or temporary sessions.

Use generateWallet() for New Wallets

Use generateWallet() for new wallets as it produces both classical and quantum keys together, ensuring proper key pairing.

Verify Public Keys Before Multi-Sig

Verify public keys before multi-sig construction using verifyPubKeys() to ensure all participants' keys are valid.

Prefer Taproot Addresses

Prefer Taproot addresses via getTaprootAddress() for new applications due to their superior privacy and efficiency.