Conversation
| address: string, | ||
| value: number, | ||
| ): Promise<void> { | ||
| await regtestUtils.broadcast(tx.toBuffer().toString('hex')); |
| senderKeyPair.privateKey!, | ||
| ); | ||
|
|
||
| const receiverSharedSecred = ecc.pointMultiply( |
There was a problem hiding this comment.
nit: receiverSharedSecret (t at the end)
| }); | ||
|
|
||
| // destination | ||
| const { address } = bitcoin.payments.p2tr({ |
There was a problem hiding this comment.
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.
A little more explanation would be nice here.
|
|
||
| const ECPair = ECPairFactory(ecc); | ||
|
|
||
| // This logic will be extracted to ecpair |
junderw
left a comment
There was a problem hiding this comment.
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)
|
There is ongoing discussion on how to add this to psbts here. |
Silent Payments
More on
Silent Payments:silent-payments.speccontains a simple test for Silent Payments.The purpose of this PR is:
p2tr-v1branch gets merged)Silent Paymentsshould be constructed and check that this implementation is correctThis PR is not concerned on the scanning/detecting silent payments.