namecoin / namecoin-legacy

Legacy client. New version here: https://github.com/namecoin/namecoin-core Note the release branch! - Official website:
https://namecoin.org
MIT License
448 stars 177 forks source link

Implement "sendtoname" in Qt UI #123

Closed domob1812 closed 10 years ago

domob1812 commented 10 years ago

This patch implements an equivalent of the "sendtoname" functionality in the Qt UI. You can now enter a name in the "Pay To" field, and have the coins sent to the address holding the name. This only works if the name is not expired and 1-25 characters long. The latter constraint is to prevent "typo squatting" on Namecoin addresses.

This may make live easier for "ordinary users" who don't like the cryptic addresses - and it can be used to tip websites or identities.

phelixbtc commented 10 years ago

I get a "transaction creation failed" error. But I manually merged with the Qt5 patch, maybe I got something wrong. Will give it another look.

phelixnmc commented 10 years ago

[regarding the namespace behaviour]

Another alternative might be to red out names without a namespace prepended.

I agree that it sendtoname should behave the same.

Options: 1.) Accept names without namespace: id/name d/name name

  • easy use without namespace
  • transparent to the user

2.) Translate names without namespace to id/: id/name d/name name-->id/name

  • easy use without namespace
  • intransparent to the user? Query box will display it correctly. Maybe query box could say: NAME HAS BEEN TRANSLATED TO id/ namespace id/name: (address)

3.) Do not accept names without namespace: id/name d/name name-->(bail)

  • must always prepend namespace
  • transparent to the user

One more thing: Only characters a-b0-9 should be allowed. With everything else it is too easy to trick the user. E.g. large characters or spaces at the end.

domob1812 commented 10 years ago

Updated. Now only names with a namespace are accepted, and only with characters a-z, 0-9, dash and space (not as first or last character and not double). This is inspired by a combination of the rules for d/ and id/ names. The rule with 25 characters is gone, since addresses can't be valid names in any way due to these new rules. Ok?

phelixbtc commented 10 years ago

Hmm the single space in the middle still seems odd to me. But might be nice to allow "firstname lastname"...
For the record: I can create an all lower case Bitcoin address in a minute. Namecoin needs a capital M or N as first character and there still is the namespace check, though. It works now for me, too - seems my testing wallet is broken as I can not send to addresses, either. ACK

phelixbtc commented 10 years ago

One more thing: What about adding " or id/namecoin" to the sendcoinsentry example text?

domob1812 commented 10 years ago

Good idea, done!

domob1812 commented 10 years ago

Regarding single space in the middle: This is allowed according to the wiki page. (Which I created myself, but the rules for valid names were copied from the old Wiki in turn.) We could actually also allow upper-case characters for real names (like "id/Satoshi Nakamoto" similar to the previously proposed p/ namespace), but I don't think this is important for now.

phelixbtc commented 10 years ago

Created a forum post to get some more input on this: https://forum.namecoin.info/viewtopic.php?f=5&t=1893