XRPLF / rippled

Decentralized cryptocurrency blockchain daemon implementing the XRP Ledger protocol in C++
https://xrpl.org
ISC License
4.51k stars 1.46k forks source link

Add on-ledger token/issued currency definition objects (controlled by issuers) #2609

Open MarkusTeufelberger opened 6 years ago

MarkusTeufelberger commented 6 years ago

Currently, most of the bits in currency codes are unused, which both makes them easier and harder to use. There was an early attempt to use some of these bits for encoding interest/demurrage (that never made it into rippled, only into upper layer software).

I'd like to propose that it should be possible for an issuing account to generate a currency object (owned by that account) on the ledger that has the specific flags/settings. This would allow the following scenarios:

The traditional advice is to create one issuing account per currency if these scenarios should be covered (https://developers.ripple.com/issuing-and-operational-addresses.html#multiple-issuing-addresses). This has not been followed in practice so far and has its challenges like user confusion and frustration - even just with 2 addresses owned by the same entity you can check out how many people put trust lines towards hot wallets instead of issuing accounts. There is also no real way to say that one account will ONLY issue a certain currency. This leads to ledger spam and wasted time, money and nerves (user support...).

Instead imagine that it would be possible to do a create_currency transaction that tells everyone that my account now also wants to issue some IOU. This transaction would create a dedicated object on the ledger (with its hash being a https://developers.ripple.com/currency-formats.html#nonstandard-currency-codes) and in there could be a (longer!) human readable name of that asset, global freeze flags, transfer fee settings...

The exact details (how high should the owner reserve be, what flags need to be in there etc.) are to be discussed, I'd just like to know if this is in general something that could be implemented on XRPL in the medium term (say until 2019/2020)?

mDuo13 commented 4 years ago

In the future, these Currency Definition objects could also define additional properties about how the issued currency works, which might be quite useful! For example, a couple options that would be quite appealing:

Note, I am not suggesting these features as requirements for the first pass of the "currency definition" object, but simply as extensions that would be easier to implement that way than they would to the existing AccountRoot-only model.

MarkusTeufelberger commented 4 years ago

David's idea of using price feeds as "stablecoins" (https://www.xrpchat.com/topic/33079-suggestion-xrp-collateralized-stablecoins/) would also be easier with this model I think, since issuer fee settings on these would/should likely be different than actual IOUs.

whotooktwarden commented 3 years ago

I would like to be able to issue an IOU with the granularity of the IOU set so that you may only purchase whole units of the IOU, no decimal amounts.

mDuo13 commented 3 years ago

There are also several account-level settings that would make sense to be available as per-token settings that a currency definition (token definition?) object could override:

Maybe even the Default Ripple setting could be per-token?

MarkusTeufelberger commented 3 years ago

Yes, there's about half a dozen settings that make more sense to be modifiable individually for each token/IOU/issuance/currency/...

I'm of course not married to the name, but the lack of this concept itself is something that's already caused issues and confusion in the past years.

intelliot commented 2 years ago

Someone in the community mentioned that this issue is a good candidate to be extended into an actual standard proposal. It could be a solution to standardizing asset icons and descriptions, similar to memos, instead of just an overloaded 160-bit currency code. Just food for thought

mDuo13 commented 2 years ago

Another often requested feature for tokens that could be part of a token definition object is to have the transfer fees paid out to a specific address (similar to how that works for XLS-20 NFT transfer fees) rather than having transfer fees simply "canceled out" and erased from the ledger.

intelliot commented 1 year ago

@kennyzlei and team - when you have time, could you triage this?

MarkusTeufelberger commented 1 year ago

Also feel free to get in touch, in general I'd be willing to write or review a standard proposal, but I can't currently implement this in the code here.

kennyzlei commented 1 year ago

Hey @MarkusTeufelberger, appreciate the feature request you shared awhile back. I think there is value in having more token-level information and settings. While there may be various ways to solve for this capability, one potential solution is XLS-33d https://github.com/XRPLF/XRPL-Standards/pull/109 that @ledhed2222 @sappenin @nbougalis are proposing. That proposal is a bit larger but would be curious to hear your thoughts on that approach and if it would be a good solution to the problem you're trying to solve

MarkusTeufelberger commented 1 year ago

Tl;dr: I don't view adding another alternative to the current objects as a solution to this issue.

Long version: XLS-33 might be a nice redesign for XRPL 2.0 with lessons learned from the last 10 years. As long as the current system still exists however, offering a simplified solution for very similar use cases is a nice (and confusing) thing to have, but doesn't solve the issue with the fully featured system in place currently. There is also functionality missing (probably because it could be added via amendments later - but then, why not amend the current system?) such as changing the currency code or description and some omitted by design (such as rippling, issuing a larger amount of curencies than 32 per account, explicit opt-in to receiving something other than XRP).

Most of the changes in XLS-33 might even be possible to implement gradually through flags in currency objects (e.g. integer/decimal math instead of floating point per currency) instead of having to invent a completely new system. Already the difference between "Offers" and "NFTokenOffers" feels a bit... weird. In the future there might also be a different token type for these proposed "stablecoins" that are only defined by price tickers as fungible currencies. Or would they be implemented in the somewhat rippling-floatingpoint-acount-centric-but-fully-featured current system or as CFTs? Both? Issuer chooses? How to trade these then? XLS-33 feels more like yet another system and abandoning the existing one instead of fixing it to me and also the proposal doesn't touch on any other features than issuing, simple payment transactions, preauth and freezing. The real headaches start with escrow, checks, trades and payment channels (and in the future: AMM and stablecoins).

kennyzlei commented 1 year ago

@MarkusTeufelberger Gotcha, yeah I think your rationale seems reasonable. I currently am not aware of anyone else that is putting together a standards proposal around this, but I would definitely encourage you to put together your thoughts in a spec discussion here: https://github.com/XRPLF/XRPL-Standards/discussions. If you feel like you would want some guidance to support you in this process, I can potentially find some folks to help with that as well

intelliot commented 1 year ago

Most of the changes in XLS-33 might even be possible to implement gradually through flags in currency objects (e.g. integer/decimal math instead of floating point per currency) instead of having to invent a completely new system.

I like that idea. @MarkusTeufelberger , could you propose that in a discussion here?