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

Add nostr-keyring #392

Open
yukibtc opened this issue Apr 4, 2024 · 6 comments
Open

Add nostr-keyring #392

yukibtc opened this issue Apr 4, 2024 · 6 comments
Assignees
Milestone

Comments

@yukibtc
Copy link
Member

yukibtc commented Apr 4, 2024

No description provided.

@yukibtc yukibtc added this to the Release v0.30 milestone Apr 4, 2024
@yukibtc yukibtc self-assigned this Apr 4, 2024
yukibtc added a commit that referenced this issue Apr 9, 2024
Closes #392

Signed-off-by: Yuki Kishimoto <[email protected]>
@yukibtc yukibtc modified the milestones: Release v0.30, Release v0.31 Apr 11, 2024
@yukibtc yukibtc modified the milestones: Release v0.31, Release v0.32 May 13, 2024
yukibtc added a commit that referenced this issue May 27, 2024
Closes #392

Signed-off-by: Yuki Kishimoto <[email protected]>
yukibtc added a commit that referenced this issue May 29, 2024
Closes #392

Signed-off-by: Yuki Kishimoto <[email protected]>
@yukibtc yukibtc modified the milestones: Release v0.32, Release v0.33 Jun 5, 2024
yukibtc added a commit that referenced this issue Jun 5, 2024
Closes #392

Signed-off-by: Yuki Kishimoto <[email protected]>
yukibtc added a commit that referenced this issue Jun 10, 2024
Closes #392

Signed-off-by: Yuki Kishimoto <[email protected]>
yukibtc added a commit that referenced this issue Jul 3, 2024
Closes #392

Signed-off-by: Yuki Kishimoto <[email protected]>
yukibtc added a commit that referenced this issue Jul 4, 2024
Closes #392

Signed-off-by: Yuki Kishimoto <[email protected]>
@yukibtc yukibtc modified the milestones: Release v0.33, Release v0.34 Jul 11, 2024
yukibtc added a commit that referenced this issue Jul 12, 2024
Closes #392

Signed-off-by: Yuki Kishimoto <[email protected]>
@yukibtc yukibtc removed this from the Release v0.34 milestone Aug 7, 2024
@xeruf
Copy link
Contributor

xeruf commented Nov 13, 2024

would love to learn more about what this is about :) just integrated keyring.rs in my project: https://forge.ftt.gmbh/janek/mostr/commit/b9f1d461fb2e113ae50b9afbfa6c972c69812ccc

@yukibtc
Copy link
Member Author

yukibtc commented Nov 13, 2024

would love to learn more about what this is about :) just integrated keyring.rs in my project: https://forge.ftt.gmbh/janek/mostr/commit/b9f1d461fb2e113ae50b9afbfa6c972c69812ccc

The idea is to provide an easy way to save the secret key on any platform (including mobile), using the OS keyring when available otherwise a custom .dat file for other platforms (storing the key as ncryptsec).

Later could be implemented the NostrSigner trait on the NostrKeyring and use it directly to sign events or so, without have to get the secret key from keyring, parse it and construct the keys.

It may be something like:

NostrKeyring::create(<keys>);

let list = NostrKeyring::list();

let keyring = NostrKeyring::open(<public-key>);

let client = Client::new(keyring);

It's just an idea :)

@reyamir
Copy link
Contributor

reyamir commented Nov 19, 2024

I see you have some works at https://github.com/rust-nostr/nostr/tree/keyring-v2, what more needs to be done? I can help you on it, this feature quite useful for desktop app.

reyamir pushed a commit to reyamir/nostr that referenced this issue Nov 19, 2024
Closes rust-nostr#392

Signed-off-by: Yuki Kishimoto <[email protected]>
@yukibtc
Copy link
Member Author

yukibtc commented Nov 19, 2024

I see you have some works at https://github.com/rust-nostr/nostr/tree/keyring-v2, what more needs to be done? I can help you on it, this feature quite useful for desktop app.

That version was more focused on the custom .dat file instead of the OS keyring.

I think could be good to just implement a NostrKeyring with the OS keyring for now. The only platform not supported at the moment by keyring-rs is android and I think is not a problem for now.


I thought to another solution, that will involve the persistent database instead of a .dat file, and optionally the OS keyring.

  • Store the encrypted secret key (ncryptsec) into a database (could be LMDB, Indexedb or so, the same of the events or another one)
  • The secret key can be encrypted with a random key stored later into the OS keyring or with a custom one that could be also stored into the OS keyring or inserted manually every time (this will allow the usage of the NostrKeyring also on android).

What do you think? @reyamir @xeruf

@reyamir
Copy link
Contributor

reyamir commented Nov 19, 2024

I think the the persistent database solution a bit complex, since OS keyring is almost ready and fully tested. Or I wonder can we have something like KeyringStorage which user can choose where to store their key?, like we can have OS keyring first, then we can add other storage like custom .dat later.

@xeruf
Copy link
Contributor

xeruf commented Dec 23, 2024

I think going with keyring.rs directly is perfectly fine, because it allows providing custom storage backends: https://docs.rs/keyring/latest/keyring/#client-provided-credential-stores

So an Android implementation could be made directly for the library for the benefit of everyone.
It is actually in progress: hwchen/keyring-rs#127

@yukibtc yukibtc modified the milestones: Release v0.38, Release v0.39 Dec 23, 2024
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

No branches or pull requests

3 participants