Open Crypto2 opened 4 years ago
The X-address codec is available in all of the supported client libraries:
xrpl.js: https://js.xrpl.org/functions/decodeXAddress.html
xrpl-py: https://xrpl-py.readthedocs.io/en/stable/source/xrpl.core.addresscodec.html
That said, I think it would be convenient to have this as part of rippled. Could you propose an API design for the feature?
Nothing fancy, just like RPC calls of:
encode_x_address(address, optional tag) returns the address in X-format. decode_x_address(address) returns the norrmal Ripple address and tag.
For safety return an error if you try to decode a testnet address and rippled isn't running on testnet (and vice versa.) When I posted that I don't think X-address format was in any official libraries, you had to go out and get/make external ones.
What prevents a malicious rippled from using an attacker's address in the response?
You'd only want to use that kind of API on a node you run not a public one.
I think it would be a good idea to aid adoption of X-address format by adding encoding/decoding RPCs to rippled. Currently sample code is only available for Java and a public API that could potentially be compromised.