decodeNsecKeyToPrivateKey method
Decodes a Nostr nsecKey
to a private key.
final privateKey = Nostr.instance.keysService.decodeNsecKeyToPrivateKey(yourNsecKey);
print(privateKey); // ...
Implementation
@override
String decodeNsecKeyToPrivateKey(String nsecKey) {
assert(nsecKey.startsWith(NostrConstants.nsec));
final decodedKeyComponents =
Nostr.instance.utilsService.decodeBech32(nsecKey);
return decodedKeyComponents.first;
}