nip04.decrypt
Method
async function nip04.decrypt(pubkey, message): string Params
pubkey— requiredstringthe publick keymessage— requiredstringa string to sign
Response
returns ciphertext and iv as specified in nip-04
Example
const provider = (window.$onekey && window.$onekey.nostr) || window.nostr;
const message = "Data to be encrypted";
const encrypted = await provider.nip04.encrypt(pubkey, message);
const decrypted = await provider.nip04.decrypt(pubkey, encrypted); // Data to be encryptedDemo
Last updated
Was this helpful?