A method on a blockchain platform for separating roles of service providers in a distributed environment while performing a service according to a blockchain protocol, comprising:
- negotiating a smart contract between a client and one or more service providers to establish a payment in tokens with an agreed write price from the client to the service providers for executing a plurality of transactions to perform the service wherein the service providers are one or more blobbers;
- issuing a storage agreement transaction between the blobber and the client by the client to the blockchain platform;
- locking one or more client tokens by the client for a limited period of time as defined by the negotiated smart contract;
- receiving interest tokens by the client responsive to the locking of the client tokens using a multiplier, wherein the interest tokens are the blobber's pay based on the negotiated smart contract;
- creating a blobber reward pool and a challenge pool based on the received interest tokens wherein a portion from the blobber reward pool is allocated for one or more validators who are responsible for verifying a challenge and the one or more blobbers receive tokens from the challenge pool for satisfying a challenge out of the challenge pool;
- transferring data in a form of files and metadata, by the client, to the blobbers;
- responsive to the transferring data, based on an amount of the transferred data, transferring selected blobber token rewards from the blobber reward pool to the blobber challenge pool;
- issuing a signed write-marker, by the client, indicating a confirmation from the client as to the transferred data;
- receiving the files to write by the blobber;
- writing the files to a non-volatile storage medium by the blobbers;
- issuing a write completion transaction by the blobber;
- receiving by the blobber a random write verification challenge from the blockchain platform wherein the random write verification challenge includes a randomly selected blobber data allocation, a number of validators randomly selected, a random seed which determines indices of data blocks in the randomly selected blobber data allocation subsequent to the issuing of the write completion transaction;
- in response to receiving the random write verification challenge, broadcasting to the validators, by the blobber, data including a file system metadata, a latest write marker, challenge blocks chosen pseudorandomly using the random seed, and at least one out of two penultimate hashes of a Merkle tree;
- in response to receiving the broadcasted data by the validators, validating the received broadcasted data by initiating a validation proof process through which the validators verify the selected blobber data allocation that the blobber must supply, the latest write marker, the file system metadata is valid, a file system root hash matches the latest write marker, and the latest write marker matches a most recent commitment to the blockchain;
- utilizing the random seed, the validators verify the challenge blocks chosen pseudorandomly;
- verifying the Merkle tree matches up to the file metadata;
- storing two penultimate hashes comprising the blobber provided at least one out of the two penultimate hashes of the Merkle tree and a validator calculates a remaining penultimate hash value out of the at least one out of the two penultimate hashes of the Merkle tree using the file system metadata, wherein the two penultimate hashes of the Merkle tree are hashed together to give the Merkle root of the randomly selected blobber data allocation;
- broadcasting by the validators precommit signed hashes of the two penultimate hashes to the blockchain platform;
- receiving the broadcasted validators precommit signed hashes;
- determine a combined validation result wherein the combined validation result is based on a validated count, a not validated count, and a predetermined accepted validated count out of the number of validators;
- sending the combined validation result to the smart contract;
- accepting by the smart contract a first received validation result to categorize the challenge as one of approved and not approved;
- receiving by the blobber available tokens from the challenge pool when the finalised result is approved;
- receiving by the client the available tokens from the challenge pool when the finalized result is not approved;
- releasing the locked tokens by the client;
- returning the client tokens to the client after the releasing;
- and
- wherein locking, receiving, sending, and releasing of the locked tokens is automatically regulated using the blockchain protocol on the blockchain platform.