-
Notifications
You must be signed in to change notification settings - Fork 36
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
meltTokens
signs P2PK proofs
#165
Conversation
@gudnuf Let me know if this helps... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ack! exactly what I need, thanks!
@Egge21M can you bring this in? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
proofsToSend.map((p) => { | ||
return { | ||
amount: p.amount, | ||
C: pointFromHex(p.C), | ||
id: p.id, | ||
secret: new TextEncoder().encode(p.secret) | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we refactor this into getSignedProofs
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just saw it's in cashu/crypto and the Proof
type has a different definition:
@cashu/cashu-ts
*/
export type Proof = {
id: string;
amount: number;
secret: string;
C: string;
};
vs @cashu/crypto
:
export type Proof = {
C: ProjPointType<bigint>;
secret: Uint8Array;
amount: number;
id: string;
witness?: Witness;
};
☠️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, thats not great. Unrelated to this PR, but we should add a utility that hides this back-and-forth between the two formats in the near future
@lollerfirst Thank you so much for taking this on. This does look good to me, but this branch diverges from the current development branch and a merge would add some duplicate commits under old hashes. Could you please reset this branch to 4ae5562 and rebase it? |
… privkey (lost in the rebase somehow?)
d5ec286
to
f31f0ca
Compare
@Egge21M Is this good? |
Fixes: #164
Description
added option to sign P2PK proofs if a private key is provided
PR Tasks
npm run test
--> no failing unit testsnpm run format