-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Silent payments v1 #1848
base: master
Are you sure you want to change the base?
Silent payments v1 #1848
Conversation
address: string, | ||
value: number, | ||
): Promise<void> { | ||
await regtestUtils.broadcast(tx.toBuffer().toString('hex')); |
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.
nit: we have toHex()
senderKeyPair.privateKey!, | ||
); | ||
|
||
const receiverSharedSecred = ecc.pointMultiply( |
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.
nit: receiverSharedSecret (t at the end)
}); | ||
|
||
// destination | ||
const { address } = bitcoin.payments.p2tr({ |
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.
A little more explanation would be nice here.
sharedSecret: Buffer, | ||
): { psbt: bitcoin.Psbt; address: string } { | ||
const psbt = new bitcoin.Psbt({ network: regtest }); | ||
psbt.addInput({ |
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.
A little more explanation would be nice here.
|
||
const ECPair = ECPairFactory(ecc); | ||
|
||
// This logic will be extracted to ecpair |
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.
Old comment?
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.
Needs a little more explanation for people who haven't read the gist and just happen to read this file.
Maybe make some diagrams or something in a large block comment.
As long as someone can read it and understand what a silent payment is, why its useful, and in which parts of the code are we doing something special to allow it to happen.
(also pointing out how taproot support helps us to perform this would be helpful for those learning)
Silent Payments
More on
Silent Payments
:silent-payments.spec
contains a simple test for Silent Payments.The purpose of this PR is:
p2tr-v1
branch gets merged)Silent Payments
should be constructed and check that this implementation is correctThis PR is not concerned on the scanning/detecting silent payments.