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

Transaction helper #1

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Transaction helper #1

wants to merge 4 commits into from

Conversation

str4d
Copy link
Collaborator

@str4d str4d commented Jun 9, 2017

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.

@str4d str4d force-pushed the transaction-helper branch from b028c93 to 7830263 Compare September 25, 2017 23:58
if (this._jsouts.length) {
return Math.ceil(this._jsouts.length / 2)
} else {
return Math.ceil(this.jss.length / 2)
Copy link
Collaborator Author

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)
Copy link
Collaborator Author

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))
Copy link
Collaborator Author

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.

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.

1 participant