File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -777,15 +777,16 @@ function makeUnspendableInternalKey(provableNonce?: Buffer): Buffer {
777777 ) ;
778778
779779 if ( provableNonce ) {
780- // Using a shared random value, we create an unspendable internalKey
781- // P = H + int(hash_taptweak(provableNonce))*G
782- // Since we don't know H's private key (see explanation above), we can't know P's private key
783780 if ( provableNonce . length !== 32 ) {
784781 throw new Error (
785782 'provableNonce must be a 32 byte random value shared between script holders' ,
786783 ) ;
787784 }
788- const ret = ecc . xOnlyPointAddTweak ( Hx , provableNonce ) ;
785+ // Using a shared random value, we create an unspendable internalKey
786+ // P = H + int(hash_taptweak(provableNonce))*G
787+ // Since we don't know H's private key (see explanation above), we can't know P's private key
788+ const tapHash = bitcoin . crypto . taggedHash ( 'TapTweak' , provableNonce ) ;
789+ const ret = ecc . xOnlyPointAddTweak ( Hx , tapHash ) ;
789790 if ( ! ret ) {
790791 throw new Error (
791792 'provableNonce produced an invalid key when tweaking the G hash' ,
You can’t perform that action at this time.
0 commit comments