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

Add signatures to transaction builder #109

Closed
bartekn opened this issue Jul 12, 2017 · 4 comments · Fixed by #161
Closed

Add signatures to transaction builder #109

bartekn opened this issue Jul 12, 2017 · 4 comments · Fixed by #161
Assignees

Comments

@bartekn
Copy link
Contributor

bartekn commented Jul 12, 2017

Add a method to TransactionBuilder that will add existing signatures to the transaction. This will be helpful for multi-signature transactions, so one of the parties can provide a signature to be injected in a different session. Thanks @brahman81 for suggesting it.

@morleyzhi
Copy link
Contributor

@bartekn @brahman81 Is there a reason people can't just call TransactionObject.sign()? I could be wrong but from looking at the code, the signatures have to include a hashed version of the transaction, which includes the min/max times. It seems unlikely that a dev would have access to that beforehand. And in that case, it seems easier for a person to use TransactionObject.sign() than to try to recreate all the signing logic themselves.

@morleyzhi
Copy link
Contributor

I just can't see how pre-formed signatures will work with the new system of transaction timebounds, so I'm going to close this issue until a solution presents itself. Feel free to re-open!

@bartekn
Copy link
Contributor Author

bartekn commented Feb 11, 2019

This is for multisignature accounts specifically. Imagine that there is a second signer that generated a signature for a single transaction. Then the signer sends it to you. You should be able to append a new signature to the transaction.

You can't use sign() in this case because a second signer would need to send you their secret key.

@bartekn bartekn reopened this Feb 11, 2019
@morleyzhi
Copy link
Contributor

Cool, that makes sense!

@morleyzhi morleyzhi self-assigned this Feb 11, 2019
morleyzhi added a commit that referenced this issue Feb 21, 2019
- Add `Transaction.prototype.addSignature(publicKey: string, signature: string)` and `Transaction.prototype.getKeypairSIgnature(keypair: Keypair)` to allow, for example, parties to pre-sign their part of multi-signature transactions (fixes #109)
- Fix syntax errors in the TransactionBuilder example code (fixes stellar/js-stellar-sdk#115)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants