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

meltTokens signs P2PK proofs #165

Merged
merged 2 commits into from
Sep 8, 2024
Merged

Conversation

lollerfirst
Copy link
Contributor

@lollerfirst lollerfirst commented Aug 5, 2024

Fixes: #164

Description

added option to sign P2PK proofs if a private key is provided

PR Tasks

  • Open PR
  • run npm run test --> no failing unit tests
  • run npm run format

@lollerfirst
Copy link
Contributor Author

@gudnuf Let me know if this helps...

Copy link
Collaborator

@gudnuf gudnuf left a 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!

@lollerfirst
Copy link
Contributor Author

@Egge21M can you bring this in?

@callebtc callebtc requested review from Egge21M and callebtc September 4, 2024 17:17
Copy link
Contributor

@callebtc callebtc left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +447 to +445
proofsToSend.map((p) => {
return {
amount: p.amount,
C: pointFromHex(p.C),
id: p.id,
secret: new TextEncoder().encode(p.secret)
};
Copy link
Contributor

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?

Copy link
Contributor

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;
};

☠️

Copy link
Collaborator

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

@Egge21M
Copy link
Collaborator

Egge21M commented Sep 4, 2024

@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?

@lollerfirst
Copy link
Contributor Author

@Egge21M Is this good?

@Egge21M Egge21M merged commit d61ad07 into cashubtc:development Sep 8, 2024
1 check passed
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.

4 participants