nostr-protocol / nips

Nostr Implementation Possibilities
2.39k stars 582 forks source link

NIP-60: Provide an option to use ncryptsec #1566

Open water783 opened 2 weeks ago

water783 commented 2 weeks ago
{
    "kind": 37375,
    "content": nip44_encrypt([
        [ "balance", "100", "sat" ],
        [ "privkey", "hexkey" ], // explained in NIP-61
        [ "ncryptsec", "NIP-49 encrypted private key" ]
    ]),
    "tags": [
        [ "d", "my-wallet" ],
        [ "mint", "https://mint1" ],
        [ "mint", "https://mint2" ],
        [ "mint", "https://mint3" ],
        [ "name", "my shitposting wallet" ],
        [ "unit", "sat" ],
        [ "description", "a wallet for my day-to-day shitposting" ],
        [ "relay", "wss://relay1" ],
        [ "relay", "wss://relay2" ],
    ]
}

Provide an option to use either the privkey or ncryptsec. This approach can help prevent the user's wallet privkey from being exposed in case the main nsec is leaked.

pablof7z commented 1 week ago

good idea and I like the approach, this way a user can have a wallet that can hold funds, apps can see the balance, but they require explicit authorization from the user to spend from them. I.e. a user could have a user with 1k sats that all apps can spend from with no friction and a wallet with 100k sats that requires the user "unlocks" the wallet to spend from it.

water783 commented 1 week ago

good idea and I like the approach, this way a user can have a wallet that can hold funds, apps can see the balance, but they require explicit authorization from the user to spend from them. I.e. a user could have a user with 1k sats that all apps can spend from with no friction and a wallet with 100k sats that requires the user "unlocks" the wallet to spend from it.

Yes, this is really cool!