Open containerman17 opened 1 year ago
EIP-712 would help in ApproveAmendment
method
A few questions and comments:
Under VM lifecycle :
Funds equivalent to 7 days of booking price are locked in the user's account
You mean that the funds are locked into the broker contract, correct?
Hosting providers can claim earned funds at any time or choose not to claim
This should be claimable in 24hr increments to prevent clients from being rugged. For instance, when a client books a VM from a new provider on the marketplace and that provider shuts off its cluster and run it under a different address.
Both users and hosting providers can withdraw their respective balances in full
Is this the excess balance after its been locked in or the locked-in balance in the broker contract?
Breaking the Provider Agreement:
- Event of breaking the contract influences rating of the party breaking the contract
What if both parties agree on breaking the contract? Is it possible for no penalty to mark on both parties report card?
Money claim:
- At any point of time, the hosting provider might claim money due for the whole subcontract in one transaction
Can you clarify the subcontract and it's function?
You mean that the funds are locked into the broker contract, correct?
Yes.
This should be claimable in 24-hour increments to prevent clients from being rugged. For instance, when a client books a VM from a new provider on the marketplace and that provider shuts off its cluster and runs it under a different address.
A new hosting provider has to pay a fee and would probably keep prices way below market. I assume this scenario doesn't make any economical sense. I might be wrong; it needs testing IRL.
Is this the excess balance after it's been locked in or the locked-in balance in the broker contract?
The locked balance is also used for payments. The whole point of the locked balance is to prevent a client from booking many VMs that they cannot afford.
What if both parties agree on breaking the contract? Is it possible for no penalty to be marked on both parties' report cards?
Good point! Users can choose a reason for breaking the contract: not needed anymore
or quality issues
.
Can you clarify the subcontract and its function?
A client and a hosting provider agree on the scope and price - I would call it a "contract." But it is all happening on a smart contract. We can call it an "agreement" or "subcontract" to avoid confusion with the smart contract.
This proposal is unnecesarry comlicated. It will push us back in development for 3-4 weeks.
- Inflexibility leading to underutilization: Traditional cloud platforms can offer various VM combinations (e.g., 32x[1C+2GB] VMs or 16x[2C+4GB] VMs), while the current protocol requires predetermined compute power. Disk size and dedicated IP availability present similar challenges.
Ideas:
Offer
entity and storing IPFS hash of the agreement in the booking. Offer
). That will save a ton of gas.
- High gas fees for providers:
- Payment claims for each VM must be made separately
- Forced terminations require individual processing for each VM
- Currently, every price update is recorded on the blockchain, which is unnecessary. Updates should be made on-chain, but only finalized after the contract has been established.
Ideas:
Offers
(of course)
- Lack of encrypted deals between hosting providers and clients, potentially unacceptable for real-world businesses
Ideas:
- Absence of Know Your Customer (KYC) processes: P2PCloud sits between centralized cloud services (e.g., AWS) and fully decentralized projects (e.g., Golem) in terms of decentralization. Therefore, an optional, provider-enforced decentralization solution is necessary.
Ideas:
signed offer
level. Here is a process proposal: request offers from anybody
, request signed offer from selected provider
, book the VM
. The idea is - provider will reject offer signing for a client who doesn't comply with KYC policy (if present).P.S. Also keeping the VM list will allow software authors to check for licensing fees payments for every VM.
This is an updated version of Protocol V2 proposal. It requires much less changes in the blockchain-integrated hypervisor.
In v2 we are moving offers off-chain, replacing per-VM with a user-provider balance payment system, and require the provider's agreement for new VM bookings.
@solohin, what are your thought on creating a factory smart contract for individual bookings?
This will allow us to reduce having a single point of failure in the broker.sol contract since it will hold most of the funds being deposited. Having a factory contract can break up that single point of failure by making it a case-by-case, but we do hit a few issues with it as well:
This is something that came up when I was reviewing the smart contracts
@jeremybeal11
This document outlines the development of a new booking protocol for P2PCloud, designed to enable flexible virtual machine (VM) booking and significantly improve utilization rates.
Booking protocol V1
Entities
Workflow
Problems to be solved
Solution:
V2 Protocol proposal
In v2 we are getting rid of "offer" and "booking" entities and intoducing a Provider Agreement - agreement between a user and a hosting provider on Broker smart contract.
Broker Smart Contract V2 Proposal
Deposit
,Withdraw
methods - deposit and withdraw a stablecoin.GetProviderURL
/SetProviderURL
- set a clearnet address of the hosting provider used for off-chain communications.SubmitAmendment
- amend or create a new Provider Agreement.uint16 amendmentNonce
- ensures signatures are not reused, incremented by one for each amendment.int256 priceChange
- a difference in price (can be negative).bytes32 agreementCid
- a link to the amended IPFS hash of the agreement. The hash can contain plaintext or encrypted agreement, depending on the signing parties.address provider
- address of a hosting provider involved in the agreement/amendment.bytes signature
- a signature from the hosting provider verifying their agreement to the proposed changes. Raw data for the signature is composed of (amendmentNonce
||priceChange
||agreementCid
||provider
||client
).BreakContract
- immediately destroys the contract. Can be called by either the user or the hosting provider, leaving an event on the chain.ClaimPayment
- transfers due fees from clients to the provider's address within the Broker contract.SubmitAmendment
andBreakContract
calls.RegisterProvider
/IsRegisteredProvider
- pay a fixed spam-prevention fee to become a provider. The fee is $100, sufficient to protect against spam but not a barrier for legitimate hosters.AddNonWithdrawableBalance
- transfer funds to another client without the option to withdraw. Required for free trials and money laundering prevention.GetBalance
- return free, locked, and non-withdrawable balances.Hosting Provider's HTTP API
This document covers only new v2 methods. Attestation logic remains the same.
GetQuotes
Public method for retrieving filtered quotes.
MinCPUCores
MinRam
MinDiskGB
DesiredDiskType
- Disk type:localSSD
ornetworkSSD
ApproveAmendment
Authorized method to form amendment messages for users.