Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

water783
Copy link

@water783 water783 commented Nov 6, 2024

{
    "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
Copy link
Member

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.

Copy link
Member

@pablof7z pablof7z left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

massaged the text a bit and added a p2pk to specify the pubkey encrypted in the ncryptsec

60.md Outdated Show resolved Hide resolved
60.md Outdated Show resolved Hide resolved
water783 and others added 2 commits November 14, 2024 11:42
Co-authored-by: Pablo Fernandez <[email protected]>
Co-authored-by: Pablo Fernandez <[email protected]>
@water783
Copy link
Author

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants