How can I check if the private key of Ethereum is valid in C#?

Viewed 398

I searched about Wallet.fromPrrivateKey in ethereumjs-wallet, and privateKeyVerify in secp256k1. But I'm using Unity & Nethereum, so I can't use that. Is there any way to validate the private key in C#?

1 Answers

The private key is just a random 256-bit integer number.

You just need to check it is > 0 and < max private key value that can be found here.

Private keys do not have checksums or anything like that.

Related