decodeNpubKeyToPublicKey method
Decodes a Nostr npubKey
to a public key.
final publicKey = Nostr.instance.keysService.decodeNpubKeyToPublicKey(yourNpubKey);
print(publicKey); // ...
Implementation
@override
String decodeNpubKeyToPublicKey(String npubKey) {
assert(npubKey.startsWith(NostrConstants.npub));
final decodedKeyComponents =
Nostr.instance.utilsService.decodeBech32(npubKey);
return decodedKeyComponents.first;
}