publicKey method

SchnorrkelPublicKey publicKey()

The publicKey method derives the corresponding public key from the Schnorrkel secret key.

Implementation

SchnorrkelPublicKey publicKey() {
  final pubkey = Ed25519Utils.scalarMultBase(key());

  /// Convert the result to a RistrettoPoint format.
  final pubPoint = RistrettoPoint.fromEdwardBytes(pubkey);

  /// Convert the RistrettoPoint point to bytes and create a Schnorrkel public key.
  final pubBytes = pubPoint.toBytes();
  return SchnorrkelPublicKey(pubBytes);
}