Direct RC delegations vs RC pools and tentative direct rc delegations spec

in #rc3 years ago

image.png

Hello,

First let's settle on the terms, when I say "RC pools", it refers to the implementation where everyone can delegate to pools and then pools can delegate to users, with more notions like overdelegation (you can delegate more RC than there is available in the pool) etc, we'll get back to it later.
When I say "direct RC delegations", it's enabling users to delegate RC directly from one to another instead. Which would remove all the compexity of RC pools while retaining most of its features

tl;dr:
Direct RC delegations = user to user RC delegation
RC pool = more feature complete version

In the recent dev meeting we discussed RC delegations/pools a bit. Basically there is some concerns from @blocktrades's team regarding the complexity of RC pools, both in terms of complexity (risk of unforseen edge cases or bugs) and performance (could cost too much in processing power/memory to node operators). This also comes from the fact the RC system while functional still has some kinks to be worked out, it could be dangerous to build a complex system on something that is not rock solid.

This post aims to start a discussion and discuss around the fact that maybe we don't need RC pools as simple rc delegations cover most of the use cases.

Proposed direct RC delegations feature Set

some more terms:
max rc is the maximum amount of RC that the account can have
current RC is the amount of RC that the account currently have, current RC regenerates over time to match max RC if not used.

You can see the spec (and discussion from other core devs) here: https://gitlab.syncad.com/hive/hive/-/issues/152
I very much encourage you to read the link before continuing.

Direct RC delegations are super straightworward, just delegate 50 RC, your account now loses 50 max RC and the user you delegate to has an extra 50 max RC, I say max RC, because RC regenerates, so if the user you delegate to uses the 50 rc, it will come back eventually.

Advantages are:

  • Pretty easy to code (writting it from scratch and could be as fast or even faster as finishing RC pools)
  • Very simple so very small performance and memory footprint, less bug risks
  • Simple UX-wise and easy for front ends to implement

RC pools

if you want to know how RC pools work look here : https://peakd.com/test/@howo/wanna-help-test-rc-delegations-heres-all-you-need-to-know
tl;dr:
With the RC pool implementation, everyone can contribute to a pool, then a pool can delegate to multiple accoutns, there is a notion of "oversubscription" meaning that you delegate "drc" or delegated RC to an user not actual RC, drc basically allow you to spend the RC that is inside of the pool at a 1:1 ratio, but if the pool is empty and you got 50 drc, you can't get any RC. The main advantage of this approach is:

  • Multiple users can contribute to the same pool
  • You don't have to guess what the user will consume to distribute RC, you just allows people to use at most, x RC.
  • Already coded, lots of tests but need further reviewed and tested in a proper testnet

disadvantage is obviously added complexity both in the chain and UX-wise (with the slot system, read up on it int he post above) that may not be worth it.

comparaison of various use cases

Account creation

Probably the biggest use case for direct RC delegations/pools. We create an account and transfer RC to it so it can transact comfortably. Today this is done by delegating hive power, but HP has many problems namely abuse and limitations.

Direct RC delegations

Direct RC delegations cover this use case, it would be an almost drop-in replacement for hive power delegation, take how much hp you used to delegate to new users and replace this with RC.

Of course we run into issues when we want to do this more at scale where you have to give the maximum RC an account usually use so if everyone uses 30 RC, but bob uses 100 because he's so excited about the platform, bob would be stuck, although with RC being "free", bob could ask for a second delegation via an "RC faucet" or something.

The second problem is that this implies that the account creation account has a lot of RC, so if you want to onboard 10k users, you may run into problems, and it would be complicated to coordinate with other whales who might want to help (because direct RC delegations delegations would require active authority, whales probably won't give that auth to allow for automatic direct RC delegations). Delegating delegated RC (a whale could delegate to an account creation service who would redelegate RC) is a no go I think because it creates a ton of new edge cases.

But it wouldn't be too hard to create a system where you "trail" delegations, so if you're a whale and you see a service delegating 30 RC, you can delegate 10 RC too on top of it. It would be pretty easy. But once again not easily automatable since it touches the active authority.

Ultimately direct RC delegations would cover the use case as well as HP delegations, not the best but still a massive improvement IMHO.

While I'm at it, direct RC delegations could be done using posting auth to make it way easier to manage and automate everything, there is no technical limitations to this, interested to hear your thoughts. The only risk is that someone dapp could then empty the RC in your account and prevent you from transacting.

RC pools

RC pools cover this case as well, It doesn't run into the same issues as direct RC delegations you can delegate 100 RC to everyone and just let people use RC as they go, if everyone uses 30 out of their 100 that's fine, and bob won't be restricted. This would allow account creation services to be way less strict in the way they manage RC, they could delegate a lot of RC to make sure newcomers are never running out of RC when doing the first basic things (voting posts/posting etc) as long as the pools are flowing thanks to delegations to the pools themselves.

Delegate to a user who doesn't have RC left

This is IMHO, the second biggest use case for direct RC delegations, the user used up all of his RC and we want him to continue to use hive, he could request an RC deleations from any RC faucet (I expect those to pop up once direct RC delegations make it to the chain) or a friend to give him some RC. Right now this is covered by HP delegations but no such faucets really exist for obvious abuse reasons.

direct RC delegations

This is a case where direct RC delegations work great, pretty easy to send an extra 500 RC to a user if he asks for it, and then maybe remove it a month later. You still have the same pain points outlined in the account creation use case though:

  • you are bound to run out of RC if you delegate too much, so you're forced to be more conservative in your delegations
  • Others can't "fund" you with RC to help you

RC pools

While RC pools can do it and be great at it thank to the delegated RC system, there is an important caveat: with RC pools you cannot get RC from a pool unless you set a slot to point to it first, this means that you can end up in these awkward situations where you can't set a slot to get RC from a pool because you're out of RC and cannot get RC from a pool because you didn't set your slot to point to the pool.
Although this scenario is relatively unlikely because a set_slot operation is a custom_json which costs very little.

conclusion:

I think both approaches are valid but I think the extra weight and risk on the chain of RC pools make me lean towards implementing direct RC delegations with posting auth (even though I'll have to redo everything haha) along with a tool for people to "trail" other people's delegations. The UX benefits are also non negligible.

What are your thoughts ?

Sort:  

The obvious benefits of the pool was not having to have inneficiencies in calculating the RC you want to delegate to someone. Not everyone is active every day so less RC would be needed to support more users. The second benefit was it could end up being less blockchain transactions than the alternative which I'll describe below... but the point is it does seem like there are alternatives which is a good thing.

questions

  1. Is there a cool down for undelegating RC?
  2. How much is the relative RC cost of doing a direct RC delegation to a user? Like what kind of transaction do you envision it to be?
  3. If we take the old steemit example and delegated 15hp worth of RC what percentage comparison would delegating and undelegating take? Tiny fraction or something like 1-2%?
  4. Continuing that example if we can delegate to a new user the moment they login to our site then maybe we can undelegate after x amount of hours or days away to free up that RC for the next new user. This example is the alternative that keeps limited RC more efficiently distributed but as you see it is a lot more hive blockchain transactions in order to manage it.
  5. Trailing delegations is of course awesome together with posting authority to piggy back on those who want to help the cause. This does of course double the transaction overhead for each case.
    5b. So the sub question is do you see this being overwhelming at a certain point of daily users? At what point would it be problematic?

Cc @asgarth

Yes I agree with your points, I actually think it's possible to build a mix of both where you don't have pools but you still delegate "right to use rc" of the delegator similar to how pools work. Would be like a compromise between the simplest implementation and the most complex one.

  1. No
  2. It's a custom_json, so very small (although price could increase with usage)
  3. far less than 1%
  4. That's an interesting use case, not sure it's that interesting in practice though due to the inherent spam to the chain. Also most users will have enough rc to do things on their own, so you could just look if he has fewer than x RC and if so, delegate some to him. I like that you think proactively so that the user doesn't even have to worry about "I ran out what do I do" but maybe it could be done in ways so that you don't have to spam the chain something where if the user runs into an rc problem the error message say "you're out of rc, get some more by clicking here".
    5b. This is the whole thing we have to figure out in weighting rc pools vs direct rc delegations. The object of a delegation itself is relatively small , so we could have millions of delegations on chain without it impacting the memory usage that much. Then there's the performance impact which is something I'm not sure.

1-3. If there is no cooldown + it's a json with a very low RC cost... then i suppose it would be pretty easy for us to have an efficient allocation of our RC. Specially if people offer access to use some of their RC if we get low.
4-5. And yes you are correct we would look at the new users starting RC so it really would only apply to new users. And yes we would likely not have to undelegate RC quickly (thus creating another transaction) unless we ran into RC constraints. Also we can avoid the double transactions of 3rd party RC delegations through authority until there is a need... doing 2 each time such as a trailing seems like a spam ... better to just have one account handle it to be honest.

I think both approaches are valid but I think the extra weight and risk on the chain of RC pools make me lean towards implementing direct RC delegations with posting auth (even though I'll have to redo everything haha) along with a tool for people to "trail" other people's delegations. The UX benefits are also non negligible.

100% agree. Pools could be added later if we really want oversubscription.

About RC faucets, it would be really convenient if users could delegate their RC to one account, and then that account could become a faucet for all of hive. It could even charge a small fee for RC delegations, giving a return back to the RC delegators. But this requires the ability to delegate delegated RCs, which you said introduces too many edge cases.

Any other way to achieve that? Maybe create a special account on the chain acting as a fee based RC pool?

About RC faucets, it would be really convenient if users could delegate their RC to one account, and then that account could become a faucet for all of hive

This is RC pools in a nutshell haha, I don't think we should enable people to delegate delegated RC because it can create some performance hogs on some blocks.

Any other way to achieve that? Maybe create a special account on the chain acting as a fee based RC pool?

But then who would control that account ? I didn't give it a ton of thought but for now I think the best way to achieve "everyone can contribute to RC delegations" is RC delegations trail where you decide to trail an account creation system, and if you see it delegating 10 RC, you delegate 10 RC too, it's less efficient because it's hard to tell how much RC will be delegated when delegating but it works.

But then who would control that account ?

No one. We can just automate it to set a price for RC in hive according to supply/demand, a bit like eth gas. It requires a hardfork obviously, because that would have to be done using a smart contract.

This is RC pools in a nutshell

Yes, except pools can't charge a fee. I used the word faucet but I meant a pool that charges fees, not giving RCs for free.

I am sure some people would prefer paying one time fees over powering up hive when getting to know the blockchain. Right now, RCs are really cheap so people can buy small amount of hive without worry.

However, if RCs ever become scarce, then people will not want to stake hive for 13 weeks just to try out some things, a fee based approach will be cheaper if markets are efficient.

So long term, fees on hive will be necessary, whether it's done through a centralized app like dlease and direct RC delegations or through a pool like we're talking about.

I think the pool would be much better because otherwise investors who stake long term and loan RCs will have to keep updating their delegations, like on dlease right now.

Direct RC delegations are super straightworward, just delegate 50 RC, your account now loses 50 max RC and the user you delegate to has an extra 50 max RC, I say max RC, because RC regenerates, so if the user you delegate to uses the 50 rc, it will come back eventually.

I think you want to do something similar to HP delegations where the receiving account gets not only max RC but current RC, and the delegating account needs to have unused current RC (which is deducted) to make the delegation.

You seemed to imply this when talking about the (important IMO) use case of users needing delegation because they used up all of their RC. This use case wouldn't be handled well if current RC doesn't transfer with the delegation because the receiver would need to wait for RC to charge up.

Sorry I didn't explain myself correctly, I just wanted to make the distinction that the rc delegated did regenerate and it wasn't a one-off, it's better explained in the technical spec, when you delegate you increase the user max and current rc.

And when you undelegate "regenned" RC delegation, does it come as MAX (unregenerated) RC or does it come with the extra vested value along?

As MAX (unregenerated) RC

While I'm at it, direct RC delegations could be done using posting auth to make it way easier to manage and automate everything, there is no technical limitations to this, interested to hear your thoughts. The only risk is that someone dapp could then empty the RC in your account and prevent you from transacting.

Is there anyway of tracking all dapps to make sure that there not doing this? Like an auto-mated account type deal, I feel like anyone caught doing this would be immediately exiled by the community regardless - but by not using active permissions It would solve the trust factor a bit I guess.

If you gave them your posting key there is no way to know how they did that, using a posting auth you would know though.

But it's like all the dapps that could empty your voting power to self vote or something, it happened before and it wasn't too hard to figure out who did it and exile them.

Is there a way to set a floor? So when RCs get to a certain amount, the dApp is not able to use anymore RC until it regenerates some? That way a user could always guarantee they have say 10% of RC if they get drained.

Yes exactly, all things come with risk and in most cases the community should be able to mitigate it properly!

Couldn't a whale rc delegation be called like any other bot to automate it?

If someone needed help s/he would call for it with a !popcorn, or w/e?

Yes definitely some use things that could be developed on top of it :)

(although to nitpick, if you have no RC you can't make a post on the chain to ask for RC, but a discord bot or something works :p)

We could instruct the newbs to call the bot first thing after they discover that they are too poor to post.
Maybe add it to the error popup.

Imo, we should also instruct them that not powering everything up until they have 1mv is a faux pas, too.

I'd suspect that a sunset date on the delegation should be set right away, too, or do they already expire automatically?

https://giftgiver.site Already have something set up where users with no RC can get a free HP delegation(tho we've run out of HP to delegate frequently because of how much it gets used). With direct RC delegation, it should be a lot easier to both grow the account and help newbies.

Wow,what a nice write-up.

Well, even with the direct system, applications can do dynamic tracking of users. It should be fairly trivial to listen to blockchain tx of users of your application, track their RC and if people don't transact for a while you decrease the RC delegation and if they transact a lot and are getting close to using it all up, you can delegate a bit more. Unlike HP that has a 5 day cooldown with RC delegations this shouldn't be hard at all.

Honestly one of the biggest holds ups on new people coming in are RC and for there to be a clear understanding of what RC is and how much they have. Most people in crypto now understand RC because of systems like Tron, Wax etc that use this.

The big issue however is when someone joins Hive there's no easy way to get hive. There's no fiat to hive system and it's extremely limited on the exchanges that people can access. Fix that issue and you will start fixing the onboarding hurdle.

We need an easier system to onboard people it's confusing AF at the moment and most people hit the page try and do something and realize they can't and the error messaging is a little confusing. Instead of just a little prompt tell them exactly what's going on and how to buy hive. While there are still other things we can improve onboarding this would be one of the cores at the moment that prevents people from taking part and kills retention rates as well as bounce.

There really shouldn't be a reason to have to delegate to someone. If they can't buy $10 of hive with another crypto or Fiat well they most likely are just going to jump in here and keep selling their hive. A small commitment investment can go a long way.

Amazing contents thanks

 3 years ago  Reveal Comment

You are sending a Json text to the blockchain that indicates the last time you checked your notifications. Therefore all interfaces know that you have seen your notifications because the time is past the data provided by the json you submitted to the blockchain. Json operations are said to be one of the cheapest things on the blockchain

also of note this json in particular is not a very many characters.

It's I suppose the cost of having a decentralized system.

I was gonna say something along the lines of those guys, but...

untitled.gif

Client-side notifications instead is probably better and I know there are others who would share the same sentiment. It's just one of those things many of us don't think about since we already have more RC than we consume.

As Jarvie nicely explained correctly, because you're making an operation on the chain that is picked up by the API responsible for notifications within the HIVE node software.

When you hit that button, it sends an on chain signal that is picked up an processes by a witness node somewhere, you're causing computing to happen within a node on the network an in order to prevent functions from being abused to negatively effect network performance you need to make it have a cost, else there is not much in regards for protecting the network against bad actors making 1000 accounts all spamming free functions that need processed by whatever current node is processing blocks.

It's a security feature in a sense, and the actual cost of the call is miniscule provided you have more than like 10 HP.

This isn't a Web 3.0 implementation captain.. That refers to the Ethereum based technology, metamask and whatnot. HIVE is graphene based.

As someone who runs a node that HIVE runs on I'm glad it's not a free for all, because as important as user experience is.. If the network itself just was wide open to calls with no cost involved RC wise it would be trivial to DOS / DDOS attack nodes. RC exists simply to make it economically unfeasible to do this easily.. As you can't just spin up a bunch of new malicious accounts with no stake and cause havoc with them. Very thankful for this

If you're honestly in this ecosystem and enraged that your account that is effectively unfunded and free can't do a whole bunch of things due to lack of RC the ways around that are to stake HIVE in Hive Power to unlock a greater mana pool.. or ask someone nicely to delegate you some Hive Power / network bandwidth, which both myself and giftgiver have done at this point so you aren't hitting the limits.

New accounts with new delegation are set up with juuuust enough RC to do a few operations a day in order to not be a weakness or attack vector basically, or rather to make it not feasible time wise to do so.

I do getwhat you're saying though as a deterrent thing.. Because in a sense it is designed to be a deterrent 100%, so you are right. It just shouldn't be one that is felt by users not abusing the system, and that is where the social nature of this network kicks in that a post such as yours will get the community to throw more RC at you.

It ain't perfect, likely needs tweaking, but it serves it's purpose.

Also note, most things that have a client have a corresponding server that the client connects to, depending on what it is you are processing sometimes it's better to have it client or server side.. While doing it client side is totally possible, it might end up making a nightmare for low processing power devices.. Can you imagine an early iphone or ancient laptop trying to index through thousands of post entries and date checking every time you open a page or go to view trending? It would make it completely freeze. :P

I mean, if you view it as being taxed rather than an account mana bar.. Then I guess that's cool.. But RC is more like a mana bar, clearing the notifications is effectively casting a spell. RC like a mana bar fills up, so it doesn't actually "cost" you anything, but rather simply lowers your mana a bit because that is what happens when wizards do spells. :P