Skip to content

Commit c5e5a55

Browse files
committed
NIP-66: add Wallet Backup Events
to prevent loss of funds if Wallet Event is overwritten with a new `privkey`
1 parent 078ffd8 commit c5e5a55

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

60.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,22 @@ Tags:
4040
* `mint` - Mint(s) this wallet uses -- there MUST be one or more mint tags.
4141
* `privkey` - Private key used to unlock P2PK ecash. MUST be stored encrypted in the `.content` field. **This is a different private key exclusively used for the wallet, not associated in any way to the user's Nostr private key** -- This is only used for receiving [NIP-61](61.md) nutzaps.
4242

43+
## Wallet Backup Events
44+
45+
A Wallet Backup Event SHOULD be created at the same time as a new Wallet Event so that future inadvertent overwrites of the `privkey` do not lead to loss of funds.
46+
47+
```jsonc
48+
{
49+
"kind": 375,
50+
"content": nip44_encrypt([
51+
[ "privkey", "hexkey" ],
52+
[ "mint", "https://mint1" ],
53+
[ "mint", "https://mint2" ]
54+
]),
55+
"tags": []
56+
}
57+
```
58+
4359
## Token Event
4460
Token events are used to record unspent proofs.
4561

0 commit comments

Comments
 (0)