stacks-archive / blockstack-browser

The Blockstack Browser
Mozilla Public License 2.0
1.12k stars 199 forks source link

Register price estimation must be performed client-side #1285

Open kantai opened 6 years ago

kantai commented 6 years ago

Currently, the browser communicates with blockstack-core to determine an estimate for the cost of registrations. This leads to inaccurate estimates -- the remote core node doesn't know what signing scheme the browser is going to use (single-sig, multi-sig, segwit...) or how many utxos are likely to be consumed.

There's already functions in blockstack.js to estimate the price of operations:

blockstack.transactions.estimatePreorder
blockstack.transactions.estimateRegister
wbobeirne commented 6 years ago

This seems like it would require some serious changes in the flow, since it would require us to ask the user for this information since we don't currently fill out the transaction via the browser. Should this maybe be reconsidered as an enhancement, rather than a bug? I think it would need some design love, especially for people who aren't that Bitcoin-savvy.

kantai commented 6 years ago

The registration process already uses blockstack.js for transaction generation (more or less automatically):

Roughly around here:

https://github.com/blockstack/blockstack-browser/blob/3aaf437e6b4155d76dd46597b40d71d44ffc3724/app/js/profiles/store/registration/actions.js#L112

So it shouldn't be too hard to do the estimation kind of similarly.

markmhendrickson commented 5 years ago

This seems like a bug to me, if estimates are known to be materially wrong, but perhaps a low-priority one since ID purchases are currently a low-volume activity?