-
Notifications
You must be signed in to change notification settings - Fork 3
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
Transaction helper #1
base: master
Are you sure you want to change the base?
Conversation
b028c93
to
7830263
Compare
if (this._jsouts.length) { | ||
return Math.ceil(this._jsouts.length / 2) | ||
} else { | ||
return Math.ceil(this.jss.length / 2) |
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.
Remove / 2
), arguments) | ||
|
||
// Add the JSOutput and return the JSOutput's index | ||
return (this._jsouts.push(new JSOutput(addr, value, memo)) - 1) |
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.
Error if getProofs()
has been called.
var dataToBeSigned = signatureHashFn(NOT_AN_INPUT, scriptCode, SIGHASH_ALL) | ||
|
||
// Add the signature | ||
this.joinSplitSig = Buffer.from(sodium.crypto_sign_detached(dataToBeSigned, this._joinSplitPrivKey)) |
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.
Error if getProofs()
has not been called.
This implements a helper for library users to implement the Zcash modifications to the Bitcoin transaction format. It also implements the client-side of the payment offloading protocol discussed in zcash/zcash#1113 to support proof generation.