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

set output value using config.uint in cli #289

Closed
wants to merge 2 commits into from

Conversation

bucko13
Copy link
Contributor

@bucko13 bucko13 commented Aug 22, 2017

Send tx behavior in CLI was inconsistent with other clients which enforce satoshis as value unit. CLI expected value in bitcoin.

@bucko13 bucko13 requested a review from chjj August 22, 2017 01:04
@bucko13 bucko13 added the quick Can be fixed quickly, code change less than 10 lines label Oct 12, 2017
@bucko13 bucko13 requested review from BluSyn and nodech October 16, 2017 18:59
@nodech
Copy link
Member

nodech commented Oct 16, 2017

There might be 2 reasons I see why old way is better:

  1. easier to use from terminal (in BTC)
  2. rpc method createrawtransaction also accepts BTCs as value.

@bucko13
Copy link
Contributor Author

bucko13 commented Oct 16, 2017

beta-13 moved over to use satoshi values in most places in the client so this is largely to keep it consistent with that. We probably don't want to go back again since that was a breaking change to begin with (https://github.com/bcoin-org/bcoin/blob/master/CHANGELOG.md)

With regards to using Satoshi values vs. Bitcoin, I have also used other clients that operate using satoshis as the default value (21.co comes to mind but I think there are others). Generally I think it makes most sense to use satoshis too because fees are typically denominated in satoshis/kb and, in terms of human error, though you should try and mitigate against this anyway, if an error were to be made, it would be way better to accidentally put 1 in when they meant 100000000 then the other way around. And in terms of it being easier to write in BTC from the terminal, given the valuation of Bitcoin lately, outside of a testing environment, most will usually be writing numbers with many digits anyway.

Anyway, my feeling is that having consistency around the API should be the priority and then leave it up to devs to change the formatting depending on their use case.

@chjj
Copy link
Member

chjj commented Oct 18, 2017

I think we should keep it denominated in bitcoin. Writing satoshis on the command line can be painful.

@chjj chjj closed this Oct 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
quick Can be fixed quickly, code change less than 10 lines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants