[SOLVED]400:{"reason":"Invalid hash: name"}


I used http://localhost:3113/v2/debug/names/claim in command line with curl to post my preclaimed name, the post data is:

{ “name”: “foobar.test”, “name_salt”: 123, “account_id”: “ak_24jcHLTZQfsou7NvomRJ1hKEnjyNqbYSq2Az7DmyrAyUHPq8uR”, “fee”: 30000, “ttl”: 40000, “nonce”: 18469}

but got the 400 return: {“reason”:“Invalid hash: name”}

The preclaim seems to be fine: https://www.aeknow.org/block/transaction/th_Nr93rpLpSRDdsUTqZz1ctSJwkQzSX5xZefbb3MegnsAKQA5j2

Anything wrong with my claim json post?

There is nothing wrong to claim aens name with js SDK or console.


It seems that the name field should be base58c encoded with the name prefix nm_ (i.e., API encode as a name, in our lingo).

I’m not sure that this was a good decision. It is confusing since it looks like a name hash rather than a plain text name, but at least this is confined to the API and not under consensus, so we could change this.

Anyway, for now you need to API encode the name in the call when you are not using the SDK (which apparently handles this).

For your example, the "foobar.test" would be "nm_3sDdKewfAc1ektVJpwuTD"


BTW, the instructions in protocol is wrong it seems, and I added a pivotal tracker ticket to update the instructions.


Thank you~I’ll try it later!


Thank you very much~DONE: