Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: Luke-Jr on April 21, 2011, 01:26:02 AM



Title: [POLL 1/3] Bitcoin: URI refactor? Low-level vs high-level
Post by: Luke-Jr on April 21, 2011, 01:26:02 AM
Should Bitcoin: URIs use low-level or high-level units?

If you want to request/bill for 1 BTC, you (or your shopping cart) would write:
  • Low-level: bitcoin:youraddress?amount=100000000
  • High-level: bitcoin:youraddress?amount=1

If you want to request/bill for 1 mBTC (milli-BTC), you (or your shopping cart) would write:
  • Low-level: bitcoin:youraddress?amount=100000
  • High-level: bitcoin:youraddress?amount=0.001

If you want to request/bill for 1 TBC (TonalBitcoin), you (or your shopping cart) would write:
  • Low-level: bitcoin:youraddress?amount=65536
  • High-level (without hexadecimal support): bitcoin:youraddress?amount=0.00065536
  • High-level (with hexadecimal support): bitcoin:youraddress?amount=x1

If you want to request/bill for 1 ᵐTBC (mill-TonalBitcoin), you (or your shopping cart) would write:
  • Low-level: bitcoin:youraddress?amount=268435456
  • High-level (without hexadecimal support): bitcoin:youraddress?amount=2.68435456
  • High-level (with hexadecimal support): bitcoin:youraddress?amount=x1000


Title: Re: [POLL 1/3] Bitcoin: URI refactor? Low-level vs high-level
Post by: Garrett Burgwardt on April 21, 2011, 03:13:50 AM
Now you see, this is an unbiased poll ;)

Low level, because then any interface made by community members can convert to whatever other unit rather easily.

As a side note, decimal over tonal, because most people know decimal and likely it will be around longer than this tonal business (yes yes, I know you hope that changes). If by some miracle tonal becomes prominent, the code can always be changed later, but in 20 years people aren't going to want to lookup tonal to decimal conversions and deal with odd characters (your post displays several square "missing character" symbols for me in Opera 11.10 (which is odd, this only recently started happening).


Title: Re: [POLL 1/3] Bitcoin: URI refactor? Low-level vs high-level
Post by: [Tycho] on April 21, 2011, 03:20:32 AM
I see squares too.


Title: Re: [POLL 1/3] Bitcoin: URI refactor? Low-level vs high-level
Post by: Garrett Burgwardt on April 21, 2011, 03:24:29 AM
In fact, I just went through every possible encoding scheme for this page - none of them show actual characters in place of the squares.


Title: Re: [POLL 1/3] Bitcoin: URI refactor? Low-level vs high-level
Post by: Luke-Jr on April 21, 2011, 03:28:54 AM
In fact, I just went through every possible encoding scheme for this page - none of them show actual characters in place of the squares.
More likely a font problem than encoding.


Title: Re: [POLL 1/3] Bitcoin: URI refactor? Low-level vs high-level
Post by: Insti on April 21, 2011, 06:33:07 AM
Should Bitcoin: URIs use low-level or high-level units?

Low-level unit examples (favours software):
  • 100000000 = 1 BTC = 55.1 TBC
  • 268435456 = 2.68435456 BTC = 1 ᵐTBC
  • 100000 = 1 mBTC = 1.869 TBC
  • 65536 = 0.00065536 BTC = 1 TBC

High-level unit examples (favours humans):
  • 1 = 1 BTC = 55.1 TBC
  • x1000 = 2.68435456 BTC = 1 ᵐTBC
  • 0.001 = 1 mBTC = 1.869 TBC
  • x1 = 0.00065536 BTC = 1 TBC


I don't understand the poll question.
Particularly the high level unit examples.

is the '=' sign being used inappropriately?


Title: Re: [POLL 1/3] Bitcoin: URI refactor? Low-level vs high-level
Post by: Matt Corallo on April 21, 2011, 09:53:53 AM
I don't understand the poll question.
Particularly the high level unit examples.

is the '=' sign being used inappropriately?
The question is how should things be represented in bitcoin: URIs.  Should people have to write
bitcoin:address?amount=100000000 for 1 BTC (Low-level) or
bitcoin:address?amount=1 for 1 BTC (High-Level)


Title: Re: [POLL 1/3] Bitcoin: URI refactor? Low-level vs high-level
Post by: Insti on April 21, 2011, 03:56:47 PM
Why does anyone think low level is a good idea? you're going to spend  all your time having to add 'redundant' zeros. I guess this is discussed at length elsewhere...


Title: Re: [POLL 1/3] Bitcoin: URI refactor? Low-level vs high-level
Post by: xf2_org on April 21, 2011, 04:41:54 PM
Why does anyone think low level is a good idea? you're going to spend  all your time having to add 'redundant' zeros. I guess this is discussed at length elsewhere...

Computer geeks think like computer geeks, I suppose :)

I strongly urge the adoption of human-friendly conventions of which everyone is already familiar:  50.00 BTC, 0.01 BTC, etc.  These are already in wide use on websites and in software, both bitcoin and non-bitcoin (such as paypal's API).



Title: Re: [POLL 1/3] Bitcoin: URI refactor? Low-level vs high-level
Post by: Matt Corallo on April 21, 2011, 04:42:28 PM
Why does anyone think low level is a good idea? you're going to spend  all your time having to add 'redundant' zeros. I guess this is discussed at length elsewhere...
Not sure, every discussion I've ever seen on the topic came to the conclusion that high-level is better.


Title: Re: [POLL 1/3] Bitcoin: URI refactor? Low-level vs high-level
Post by: BitterTea on April 21, 2011, 05:47:37 PM
Why does anyone think low level is a good idea? you're going to spend  all your time having to add 'redundant' zeros. I guess this is discussed at length elsewhere...
Not sure, every discussion I've ever seen on the topic came to the conclusion that high-level is better.

For small amounts (like will most likely be used in the future if Bitcoin becomes widely adopted), it's perhaps easier to use the low level format. What's easier to write and think about, 0.000001 Bitcoins or 1000 Satoshis/base units?

In general, high level is better for numbers intended for human use, whereas I think low level is better for numbers intended for computer use. A URI is kind of a mix between the two, as a human creates the link, a human clicks on it, but a computer parses the data.


Title: Re: [POLL 1/3] Bitcoin: URI refactor? Low-level vs high-level
Post by: HostFat on April 21, 2011, 05:56:10 PM
What do you think about these example? :D

bitcoin:address?type=low&amount=1
bitcoin:address?type=high&amount=x1

Simple: it's possible to put the type of URI.
It can also be chose to use "low" by "default".
If nothing is specified, then it's low :)

So everyone is happy.
This will help also to understand which one will be used more on next months/years.


Title: Re: [POLL 1/3] Bitcoin: URI refactor? Low-level vs high-level
Post by: Matt Corallo on April 21, 2011, 05:59:19 PM
What do you think about these example? :D

bitcoin:address?type=low&amount=1
bitcoin:address?type=high&amount=x1

Simple: it's possible to put the type of URI.
It can also be chose to use "low" by "default".
If nothing is specified, then it's low :)

So everyone is happy.
This will help also to understand which one will be used more on next months/years.
I think that far overcomplicates it.

In general, high level is better for numbers intended for human use, whereas I think low level is better for numbers intended for computer use. A URI is kind of a mix between the two, as a human creates the link, a human clicks on it, but a computer parses the data.
So true.  However, I think we should fall back on human.  Its just as easy for the computer to do either (even if one is ideal), but its not as easy for a human to convert to base units. 


Title: Re: [POLL 1/3] Bitcoin: URI refactor? Low-level vs high-level
Post by: BitterTea on April 21, 2011, 06:08:22 PM
Well, if we're defaulting to decimal, will this be a problem?

User in Europe creates a bitcoin: link for two and a half BTC. They may enter this as "bitcoin:...?amount=2,5".

User in USA clicks this link. Depending on their regional settings and the programming language of the parsing application, "2,5" may not be the same as "two and a half".


Title: Re: [POLL 1/3] Bitcoin: URI refactor? Low-level vs high-level
Post by: Matt Corallo on April 21, 2011, 06:15:00 PM
Well, if we're defaulting to decimal, will this be a problem?

User in Europe creates a bitcoin: link for two and a half BTC. They may enter this as "bitcoin:...?amount=2,5".

User in USA clicks this link. Depending on their regional settings and the programming language of the parsing application, "2,5" may not be the same as "two and a half".
That has been handled by so many programs fairly well over the years, I don't think that is a problem any more.


Title: Re: [POLL 1/3] Bitcoin: URI refactor? Low-level vs high-level
Post by: BitterTea on April 21, 2011, 06:24:02 PM
That has been handled by so many programs fairly well over the years, I don't think that is a problem any more.

C#, en-US localization...

decimal.Parse("1,2")
-> 12


Title: Re: [POLL 1/3] Bitcoin: URI refactor? Low-level vs high-level
Post by: Matt Corallo on April 21, 2011, 06:26:22 PM
That has been handled by so many programs fairly well over the years, I don't think that is a problem any more.

C#, en-US localization...

decimal.Parse("1,2")
-> 12
So don't use C# decimal.Parse?


Title: Re: [POLL 1/3] Bitcoin: URI refactor? Low-level vs high-level
Post by: Matt Corallo on April 21, 2011, 07:04:49 PM
I'm with Jgarzik on this one. Make it human readable. Not computer readable, not tonal geek readable, human readable and even human writeable. Take a hint from ed2k URI's.

And one question... why would you want variable names in URI when there are like two variables?

http://subdomain=www&domain=example&tld=com/   this is what you are proposing.

bitcoin://0.01/1zdsffssdfsfsdfsfdsdf - that's how should it look like
The problem with that is you can specify any of the variables but don't have to specify and standard set.  I might not want to specify amount, but want to specify my name, or maybe the other way around.  Plus it makes them more human readable.


Title: Re: [POLL 1/3] Bitcoin: URI refactor? Low-level vs high-level
Post by: BitterTea on April 21, 2011, 07:07:52 PM
I'm with Jgarzik on this one. Make it human readable. Not computer readable, not tonal geek readable, human readable

When did Jgarzik say this? It seems to me that he just does not like Luke pushing tonal.

You're not understanding that the URI being human readable has little purpose, but it definitely has to be computer readable. How else do you propose that Bitcoin (or whatever software) parse it?


Title: Re: [POLL 1/3] Bitcoin: URI refactor? Low-level vs high-level
Post by: Matt Corallo on April 21, 2011, 07:20:18 PM
When did Jgarzik say this? It seems to me that he just does not like Luke pushing tonal.
On IRC, plus here:
I strongly urge the adoption of human-friendly conventions of which everyone is already familiar:  50.00 BTC, 0.01 BTC, etc.  These are already in wide use on websites and in software, both bitcoin and non-bitcoin (such as paypal's API).

You're not understanding that the URI being human readable has little purpose, but it definitely has to be computer readable. How else do you propose that Bitcoin (or whatever software) parse it?
Completely disagree.  It is easy for a program to read a human readable number (there is already a function in util.cpp).  But its a URL, many, many people will be writing them in Forum sigs, websites, etc. 


Title: Re: [POLL 1/3] Bitcoin: URI refactor? Low-level vs high-level
Post by: BitterTea on April 21, 2011, 07:38:47 PM
xf2_org == jgarzik?

Completely disagree.  It is easy for a program to read a human readable number (there is already a function in util.cpp).  But its a URL, many, many people will be writing them in Forum sigs, websites, etc. 

Why does this need to be human readable?

Click this link in my sig to donate! (http://bitcoin:1J86yuX5qTZwAzx7EC5ik7bYYDEtyrCenM?label=BitterTea&message=test_do_not_use&amount=5,005)

Code:
<a href=http://bitcoin:1J86yuX5qTZwAzx7EC5ik7bYYDEtyrCenM?label=BitterTea&message=test_do_not_use&amount=5,005>Click this link in my sig to donate!</a>

Now, how would you interpret 5,005? Is that five thousand and five bitcoins, or five and one two hundreths of a bitcoin? It depends on the locality of the user who created the link.


Title: Re: [POLL 1/3] Bitcoin: URI refactor? Low-level vs high-level
Post by: Matt Corallo on April 21, 2011, 07:47:19 PM
xf2_org == jgarzik?
Yes, its his new site, so he's pimping it.

Why does this need to be human readable?
People need to be able to create them very easily and preferably read them as well.  Though reading isnt strictly necessary.  I like to be able to hover over my links and see what they are before clicking them.

Now, how would you interpret 5,005? Is that five thousand and five bitcoins, or five and one two hundreths of a bitcoin? It depends on the locality of the user who created the link.
5 BTC + 0.005 BTC.  You should not have and ,s or .s in a number that is not the decimal point.  Not just in this case, in all cases where you care at all about internationalization (ie anywhere on the internet).


Title: Re: [POLL 1/3] Bitcoin: URI refactor? Low-level vs high-level
Post by: weavejester on April 21, 2011, 10:33:47 PM
After some thought, I'm going for low-level, because I don't think "high-level" is possible without the potential for major user mistakes.

The problem with a "high-level" human readable is that you'd either have to localize it (e.g. 10,00 vs 10.00), or agree on a single format.

If you're going to localize it, you need to embed the user's locale in the URI scheme, otherwise "10.000" could either mean "10" or "10000". Adding a locale in seems over complex and prone to mistakes. And it's ugly.

If we decide to agree on a single format, such as using a period to denote the decimal place, then it ceases to become "human readable", and instead becomes "readable for people who live in these countries". This is also bad, because it means that anyone from countries with a different number system might send the wrong amount by mistake.

So in my view you cannot have a human-readable "high-level" syntax, because different countries have different ideas of what that means. One of the options of this poll simply isn't possible to have unless we want people to accidentally send 10,000 bitcoins to a person who only wanted 10.000.

Therefore the only option is to use the "low-level" approach of using nano-bitcoins.


Title: Re: [POLL 1/3] Bitcoin: URI refactor? Low-level vs high-level
Post by: marcus_of_augustus on April 21, 2011, 11:17:50 PM

I love it ... nothing better than a good stoush over units .... carry on.

My money is on satoshi.


Title: Re: [POLL 1/3] Bitcoin: URI refactor? Low-level vs high-level
Post by: xf2_org on April 22, 2011, 12:15:26 AM
The problem with a "high-level" human readable is that you'd either have to localize it (e.g. 10,00 vs 10.00), or agree on a single format.

This hasn't been a problem for paypal or other payment APIs already deployed in the field.

Anything else violates the Principle of Least Surprise.



Title: Re: [POLL 1/3] Bitcoin: URI refactor? Low-level vs high-level
Post by: Gavin Andresen on April 22, 2011, 12:37:45 AM
This hasn't been a problem for paypal or other payment APIs already deployed in the field.

Anything else violates the Principle of Least Surprise.

+1

Y'all have heard of the KISS principle, right?


Title: Re: [POLL 1/3] Bitcoin: URI refactor? Low-level vs high-level
Post by: Stephen Gornick on April 22, 2011, 12:49:59 AM
Wouldn't a decent way to handle this be to add an optional units parameter?

Especially if the need for mBTC could be not too far off?

e.g., instead of
  bitcoin:address?amount=0.010

a
  bitcoin:address?amount=10&units=mbtc

If units= is not specified, then the default of units=btc would be assumed.


Title: Re: [POLL 1/3] Bitcoin: URI refactor? Low-level vs high-level
Post by: Luke-Jr on April 22, 2011, 12:59:28 AM
Wouldn't a decent way to handle this be to add an optional units parameter?
Not really, that assumes we know all possible units in advance, as it can't easily be added onto later. It also means software would need to hard-code every possible unit.


Title: Re: [POLL 1/3] Bitcoin: URI refactor? Low-level vs high-level
Post by: marcus_of_augustus on April 22, 2011, 01:08:02 AM
Wouldn't a decent way to handle this be to add an optional units parameter?

Especially if the need for mBTC could be not too far off?

e.g., instead of
  bitcoin:address?amount=0.010

a
  bitcoin:address?amount=10&units=mbtc

If units= is not specified, then the default of units=btc would be assumed.


.... it is how science got around the mess it found itself in in the early 1800's before Faraday sorted it out, implied/inferred unit conventions are a recipe for disaster, regardless of the context.

Specify the units and be done with it.

Edit: actually there is another incentive to explicitly specify units, a future use for the protocol maybe to send currencies other than BTC to a bitcoin account, e.g. dollars, euros, Goldau, could be possible future unit options ... (would have to be a nifty app. to do the conversion, interface with intermediary, etc, but you never know).


Title: Re: [POLL 1/3] Bitcoin: URI refactor? Low-level vs high-level
Post by: weavejester on April 22, 2011, 02:01:55 AM
This hasn't been a problem for paypal or other payment APIs already deployed in the field.

Anything else violates the Principle of Least Surprise.

Hmm. You have a point...

Perhaps I should just shut up until I'm sure which side of the fence I'm on. I have a feeling I'm falling for Parkinson's Law of Triviality (http://en.wikipedia.org/wiki/Parkinson's_Law_of_Triviality); I should care this much about URI syntax.


Title: Re: [POLL 1/3] Bitcoin: URI refactor? Low-level vs high-level
Post by: Ian Maxwell on April 23, 2011, 12:41:51 AM
High-level, definitely (though I'm also partial to the idea that 0.00000001 BTC should have been 1 BTC in the first place, it's too late for that now). People will accidentally enter transactions for 1/100,000,000 of their intended amount otherwise.