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

Allow optional signing in createTX http endpoint #444

Merged
merged 1 commit into from
Oct 19, 2018

Conversation

nodech
Copy link
Member

@nodech nodech commented Apr 7, 2018

HTTP Endpoint for creating transaction is also signing the transaction.
We have another endpoint /sign which can be used for signing.

  • Makes tx sign optional /wallet/:id/create (true by default for backwards compatibility)

@christsim
Copy link

This will also allow for creating unsigned transactions from watchOnly wallets.

@tuxcanfly
Copy link
Member

Instead of this breaking change, why not add another end point?

@christsim
Copy link

Another endpoint is fine by me, although another solution would be to not attempt to sign the transaction if it is a watchOnly wallet - instead just return the unsigned transaction.

@nodech
Copy link
Member Author

nodech commented Jun 23, 2018

We could also add sign parameter. We can set it true by default and it won't be breaking change.

@tuxcanfly
Copy link
Member

Yup, that sounds good.

@tuxcanfly
Copy link
Member

While we're here, we should accomodate the offline signing use case, for which we need derivation paths for inputs: see #485

We can add support for this by simply returning wallet.toDetails(tx) instead of just tx.

@tuxcanfly
Copy link
Member

      const details = await req.wallet.toDetails(tx);

      res.json(200, details.toJSON(this.network, this.wdb.height));

@tuxcanfly
Copy link
Member

Since most of the time when we create a raw transaction, we also need the input paths for offline signing, I propose we leave this call as it is and create a new endpoint (maybe /raw?) and use it to create raw transactions, with the output consisting of wallet.toDetails(tx). Thoughts?

@joemphilips
Copy link

What about /txtemplate ? sounds more verbose.

@nodech nodech force-pushed the wallet-api/create-tx branch from c2c107d to eb6dd4e Compare July 20, 2018 13:48
@nodech nodech force-pushed the wallet-api/create-tx branch from eb6dd4e to 1b92e7b Compare July 20, 2018 13:52
@nodech
Copy link
Member Author

nodech commented Jul 20, 2018

@tuxcanfly That would make sense, but that belongs to new Pull request that can update all the API methods with necessary changes. Probably create an issue and move discussion there.

I will keep this simple and just update sign to be true by default and avoid making it breaking change (Can be released as minor update, even without changelog mention).

@codecov-io

This comment has been minimized.

@BluSyn
Copy link
Collaborator

BluSyn commented Oct 18, 2018

Can we get this merged? Feature is highly desired.

@tuxcanfly tuxcanfly requested review from chjj and tuxcanfly October 19, 2018 17:50
Copy link
Member

@tuxcanfly tuxcanfly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Let's create a new issue to follow up on offline signing.

@tuxcanfly tuxcanfly changed the title Remove signing from createTX http endpoint Allow optional signing in createTX http endpoint Oct 19, 2018
@nodech nodech changed the title Allow optional signing in createTX http endpoint Allow optional signing in createTX Oct 19, 2018
@tuxcanfly tuxcanfly merged commit fe34026 into bcoin-org:master Oct 19, 2018
@nodech nodech changed the title Allow optional signing in createTX Allow optional signing in createTX http endpoint Oct 19, 2018
@nodech nodech deleted the wallet-api/create-tx branch June 28, 2019 08:26
@braydonf braydonf added this to the 2.0.0 milestone Jan 6, 2020
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.

7 participants