Closed loredanacirstea closed 5 years ago
User Deposit Contract
pros:
cons:
this will mark the MSC, PFSC, RSBC as trusted contracts
pros:
UDC
, allowing them to cooperate and make sure the funds are available (fixing the availability problem describe above)cons:
global deposit in RDN for 3rd party services (MS, PFS, Matrix HS)
just to clarify, my understanding is: this deposit is done by the third party itself in the smart contract, not from a user to pay for a third party (this would be the UDC
)
this deposit is done by the third party itself in the smart contract, not from a user to pay for a third party (this would be the
UDC
)
Correct. By the 3rd party itself. Clarified the issue description.
I think we can close this issue after we turn this overview into the master branch.
the contract will make sure the 3rd parties withdrawing from it are registered in RSBC
I would have expected the following:
If we want prevent unregistered services from using the MSC, we need to do that check anyway and can avoid the redundant check in the UDC. Do we want to block unregistered services as far as possible, or do we just want to deprive them from getting paid?
Each user can withdraw from his own balance (after the time out)
Correct. It is mentioned: if the user wants to withdraw part/all of his deposit...
Trusted contracts can transfer tokens between users
First time I hear about this. I assume this was discussed/decided in the last meetings, where I was not present.
The trusted contracts must verify registration in the RSBC themselves
Yes, this seems like a better approach.
Do we want to block unregistered services as far as possible, or do we just want to deprive them from getting paid?
I cannot answer this myself. I see it as: unregistered services should be allowed to function, but they will not use the official setup that we have here (RSBC, UDC etc.). They can deploy their own.
Trusted contracts can transfer tokens between users
First time I hear about this. I assume this was discussed/decided in the last meetings, where I was not present.
We can either immediately withdraw tokens whenever a service claims a reward, or we can update balances. If we use https://github.com/raiden-network/raiden-services/issues/38 for PFS payments, the latter looks like a better fit, since to my understanding transferring the tokens incurs additional gas cost. Please correct me if I'm wrong!
Trusted contracts can transfer tokens between users
So when you say users
, you mean transferring tokens between a user
and a service
(e.g. a PFS), through the OTNC
. So a service
can be a user
in the UDC
contract?
Terminology might need clarification.
If a service
can be a user
in the UDC
contract, then other rules might apply to it, as it would not have a deposit requirement. This may lead to some (code) confusion, but I'm not sure I understood it correctly.
So when you say users, you mean transferring tokens between a user and a service (e.g. a PFS), through the OTNC. So a service can be a user in the UDC contract?
Yes, I don't see a necessity to explicitly split end users from services. What would be a better term? "(balance) owner", "address", "participant", "party"? I'm not sure any of them is much clearer. If we don't find a good term, I'll at least add a clarification.
If a
service
can be auser
in theUDC
contract, then other rules might apply to it, as it would not have a deposit requirement. This may lead to some (code) confusion, but I'm not sure I understood it correctly.
Your plan was to do a token.transfer
on both MSC.claimReward
and when PFS payments are claimed and not keep any balance for services? The MSC currently keeps balances for both end users and services, so I expected that was the plan for the UDC. Has there been any discussion on these two approaches or have they been assumed the way to go by different people without each other noticing?
Yes, I don't see a necessity to explicitly split end users from services
This is fine. We have UserDepositContract
and RaidenServiceBundle
, so I was expecting to only see end users in UDC
. Not saying it is wrong, but maybe worth a clarification in the UDC
description.
Your plan was to do a token_network.transfer on both MSC.claimReward and when PFS payments are claimed
Not sure what the token_network
would transfer here. You probably meant token.transfer
.
I imagined something like:
UDC
as a last stepBut again, we never specced this out in detail and it is also a matter of preference.
Not sure what the token_network would transfer here. You probably meant token.transfer.
Yes, I did. Fixed.
Overview of non-core contracts is available at https://raiden-network-specification.readthedocs.io/en/latest/service_contracts.html
Notes from the 24 August planning meeting regarding this:
MSC
- Monitoring Service Contract - https://github.com/raiden-network/spec/issues/46UDC
- User Deposit ContractPFSC
- PathFinding Service ContractRSBC
- RaidenServiceBundle ContractHC
- Hub ContractUser Deposit Contract
MSC
will transfer the user’s tokens from here, when it has to pay a reward for the MSMSC
,PFSC
,RSBC
as trusted contractsPFS
will specifically be targeted here, if we implement off-chain payments.RSBC
RaidenServiceBundle Contract
PFSC
UDC
Hub Contract
Ideally, the user must have enough RDN to use the system. The onboarding process must use this RDN to set the user up.
The onboarding transactions are:
UDC
This is why we introduce a
Hub Contract
, that will implement 1 onboarding transaction in the Raiden Network between User -> HC. This transaction will:TokenNetwork
; token will be whatever the user chooses, as long as the Hub also supports itTokenNetwork
) (! Hub currently needs an Ethereum address with which to sign messages)TokenNetwork
)TokenNetwork
)Note: the
HC
can be the one that sends the tokens for both his & the user's deposit. He can takeRDN
out from theUDC
for the user deposit + some fee that he requests. So, he also does some exchange calculations (RDN
- token_of_choice).