P2pk receive wallet#1466
Conversation
|
This replaces this right? #1053 |
yes |
|
@thesimplekid @crodas I think this is know in a decent state. I know I'm lacking tests. I want to get your opinion on the implementation before I do that. |
0f325d8 to
f1f93f3
Compare
thesimplekid
left a comment
There was a problem hiding this comment.
Thanks just a few comments.
cd73868 to
ccaf38a
Compare
af76597 to
e4044ee
Compare
|
@thesimplekid rebased |
b64cc5d to
4093b6c
Compare
|
ACK 4093b6c |
3fccf57 to
251b0f1
Compare
e23f32f to
2f3829b
Compare
52c77b3 to
30beade
Compare
30beade to
8dfa437
Compare
|
|
||
| pub use cdk_common::wallet::{WalletSaga, WalletSagaState}; |
There was a problem hiding this comment.
Not sure why these are here?
There was a problem hiding this comment.
don't know either. I remove them
|
|
||
| use crate::error::Error; | ||
|
|
||
| const CASHU_PURPOSE: u32 = 129373; |
There was a problem hiding this comment.
This is not the cashu purpose
There was a problem hiding this comment.
Im going to change the name.
There was a problem hiding this comment.
changed the name to make it clearer
| const CASHU_PURPOSE: u32 = 129373; | ||
| const P2PK_PURPOSE: u32 = 10; |
There was a problem hiding this comment.
Maybe should link to coco/spec of why we use these.
There was a problem hiding this comment.
added some comments on why we use this. plus the PR link
thesimplekid
left a comment
There was a problem hiding this comment.
Didn't mean to approve. Sorry :(
| // P2PK proofs | ||
| /// generates and stores public key in database | ||
| async fn generate_public_key(&self) -> Result<PublicKey, Self::Error>; | ||
|
|
||
| /// gets public key by it's hex value | ||
| async fn get_public_key( | ||
| &self, | ||
| pubkey: &PublicKey, | ||
| ) -> Result<Option<P2PKSigningKey>, Self::Error>; | ||
|
|
||
| /// gets list of stored public keys in database | ||
| async fn get_public_keys(&self) -> Result<Vec<P2PKSigningKey>, Self::Error>; | ||
|
|
||
| /// Gets the latest generated P2PK signing key (most recently created) | ||
| async fn get_latest_public_key(&self) -> Result<Option<P2PKSigningKey>, Self::Error>; | ||
|
|
||
| /// try to get secret key from p2pk signing key in localstore | ||
| async fn get_signing_key(&self, pubkey: &PublicKey) -> Result<Option<SecretKey>, Self::Error>; |
There was a problem hiding this comment.
On second thought. And thinking about how we want to reduce our public api surface, maybe only generate and get latest should be in the public api and the other fns should be on the wallet as pub(crate) this way they can be removed from the trait and ffi?
There was a problem hiding this comment.
I think the 2 that we could remove from the public are get_signing_key and get_public_keys. the others do need to there
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1466 +/- ##
=======================================
Coverage ? 61.91%
=======================================
Files ? 331
Lines ? 56176
Branches ? 0
=======================================
Hits ? 34784
Misses ? 21392
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Description
Add public key generation with counter for wallet.
Notes to the reviewers
Suggested CHANGELOG Updates
CHANGED
ADDED
REMOVED
FIXED
Checklist
just final-checkbefore committing