-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Account has issued a currency with non standard currency code "XRP". #5298
Comments
The check for a standard currency code of "XRP" is satisfied, but a check for a non-standard currency code of "XRP" is not. The suffix of |
I could make an argument that this is a display issue on the part of the explorers and/or wallets. This is a non-standard currency, which you pointed out.
Any modification after that is out of our hands. As far as I know there is no XLS or other spec describing the "correct" way to parse these kinds of codes - everybody has converged on interpreting the non-zero pairs as ASCII codes. Strictly speaking, this is a bug in every wallet or explorer that does that. That said, there is a high potential that this could lead to people getting scammed, so I think it's worth changing. It will require an amendment. |
Outline of a solution:
Taken together, these should allow anybody holding these coins to get rid of them and delete their trust lines while preventing anybody from creating new trustlines (or MPTs) or sending them to anybody other than the issuer. |
Regarding 4. @ximinez, are you suggesting forbidding the creation (or setting) of MPTs might be trickier. A recent proposal (XRPLF/XRPL-Standards#264) provides a standard structure for MPT metadata. In such structured metadata, someone may still XRP as the |
Yes, but only if that's the entire metadata.
Something structured should be clear that it's not trying to impersonate XRP. More specific checks might need to be addressed in the proposal. |
There isn't exactly an XLS for this, but it's not a completely new problem. One of the recommended Code Samples on XRPL is "Normalize Currency Codes", which correctly handles this scenario—it specifically checks that non-standard codes cannot be deserialized to "xrp", case-insensitive. So I agree, this is a bug in the display function. Unfortunately not only does XRPScan get it wrong, but the Livenet explorer gets it extra wrong, incorrectly showing the XRP symbol in the "other balances" dropdown in addition to showing "XRP" in the TrustSet summary. XLS-21d also mentioned ASCII codes, and explicitly discouraged other asset codes that start with bytes that could indicate common ASCII characters ( I have also in the past suggested an "extended" currency code spec with the following properties:
I chose the allowed characters based on non-standard codes currently in use. Also, the 4 character minimum is necessary to avoid overlap with ISO-like currency codes including but not limited to "XRP" which are (currently) returned as three letters instead of hex by the We should avoid this confusion by implementing conversions for "extended" codes such as the above into |
Another thought is to extend the
I'm a little leery of adding more conversions to |
It has to be exactly 3 letters, not including fewer - standard currency codes are exactly 3 letters.
Personally I would be open to adding this update to the RPCs but not to transaction processing. Though I agree, that's a larger-scale change. |
Copying what I said here:
|
Having rippled parse or interpret MPT metadata (at all) feels "off" to me. But to this specific idea, firstly (Caveat: If some metadata spec does get codified around how to use metadata, I might change my opinion here). In general, if UIs aren't properly communicating the |
Issue Description
Account has issued a currency with non standard currency code "XRP".
Steps to Reproduce
https://xrpscan.com/account/rPogU2XdDeiycaos1toSLFgoscca2qG2H
Expected Result
temBAD_CURRENCY would be the expected result for a TrustSet with "XRP" as currency
rippled/src/xrpld/app/tx/detail/SetTrust.cpp
Lines 106 to 110 in 01fc8f2
rippled/src/libxrpl/protocol/UintTypes.cpp
Lines 128 to 133 in 01fc8f2
Actual Result
Accounts on the live network have trustlines for XRP/rPogU2XdDeiycaos1toSLFgoscca2qG2H
Environment
Live network as of 19th Feb 2025
Supporting Files
The text was updated successfully, but these errors were encountered: