Alternative Marketplace proposal #101
Bulat-Ziganshin
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
TLDR: Two-step contracts with pre-contract stage and punishments for all sides if full contract wasn't signed at the end.
We have:
N=M+K
slots. Note that slots are equal-sized, thus interchangeableO
pre-contracts for each slot to maximize chances that full contract will be signedOnce contract proposal was published, CN starts to get quotes from interested nodes. Once CN gets enough quotes, it choses
O*N
of them and signs pre-contracts with these nodes. These nodes, called PHN, stakes their collateral for full contract at this point. Slot number is assigned to each PHN at this point rather than selected by PHN itself.Once pre-contract is signed (simultaneously with all PHN, just like the full contract), each PHNs downloads data from the assigned slot and publish PoR.
Once PoR for each slot is published, the full contract may be signed automatically. It includes for each slot the first node that published PoR for this slot, this node promoted from PHN to HN. Other PHN get their collateral back and got out of contract.
If final contract is successfully signed, CN pays each HN f.e.
3*O*D
coins, where D should be just enough to cover real download expenses of average network node. Since each node has1/O
chances to get into contract, its average income from successful contracts will be3*D
.If after the amount of time specified in published contract, not all slots are filled by publishing PoRs - contract is automatically dropped. In this case, each involved node is penalized, f.e.
O*N*D
coinsD
coins, i.e.O*N*D
totalSince PHN gets on average
3*D
coins for each successful contract and penalized byD
coins on unsuccessful ones plus it spends equivalent ofD
coins downloading each dataset, it will not lose money if at least 50% of contracts are successful.This scheme repels the following attacks:
In other words, every node that impacts chances of contract being signed, in the case it's not signed, pays proportional to the impact they had.
Also, once a PHN downloaded slot data and published PoR, other nodes in this slot no more have incentive to continue download data and thus waste the network bandwidth.
The contract is 2-staged:
If it (POR publishing) doesn't happen, the contract is cancelled, and each PHN as well as CN lose specified amount of money, automatically too. These means that at pre-contract stage all these nodes should reserve at least amount of money enough for this punishment, in the form of collateral
Only host that first filled the slot and thus included in full contract, gets reward. But reward is
3*O*D
, so on average each host gets reward of3*D
, covering its expenses for all successful and failed contracts he was involved (as far as at least 50% contracts succeed).This ensures that at average, host will be paid enough to cover its download costs, but at the same time, lazy hosts that don't download data or download only 99% of data and stopped, have no chances to be rewarded. That's important part of protection against scammers and attacks.
The real drawback of this scheme is that my computations assume that all hosts have equal chances in the race to fill slot. Actually, hosts with better network connection will win more, thus demotivating other hosts.
The problem of hosts with better network network connection winning more might be alleviated by the expanding window proposal (from the "Dispersal" part of the proposal: https://github.com/status-im/codex-research/pull/83/files?short_path=f30397b#diff-f30397b16d98efe2ed923f207136d3d653d8ba36bb8515ac2be43bbdf1c6981a)
Beta Was this translation helpful? Give feedback.
All reactions