Wednesday, June 27, 2018

We resume our discussion on Storj network.
We were looking  at contracts and negotiations. Contracts is between the data owner and the farmer. The latter is a term used to describe the one who houses the data.  The term farmer or banker is interchangeable because he provides a storage for one of the distributed ledgers and hopes to make money from mining it.  The banker or farmer does not need to know the contents of the data.  The data owner retains complete control over the encryption key which determines access to the data.  The data owner keeps a set of challenges, selects one of them and sends it to the farmer.  The farmer uses the challenge and the data to generate the Merkle pre-leaf and uses it with the other leaves to generate a Merkle proof. This proof is sent back to the data owner. The data owner uses the root and tree depth  to verify the proof.
The proofs may be compact but the tree may not be. Moreover the shard may be hashed many times to generate pre-leaves. Therefore an optimization is used to generate partial audits using subsets of data which reduces overhead in compute and storage. Unlike the full audits, the partial audits give only a probabilistic assurance that the farmer retains the entire file. This means there could be false positives since the probability is known, it gives a confidence level
The data owner must send a message to have the farmer issue the audit. This was done by extending the Kademlia message set with a new one.  The message contains a hash of the data and a challenge.  The farmer responds with a Merkle proof and the data owner issues payment to the farmer.  The contract helps determine the exchange. Since it is between the data owner and the farmer, it includes all the elements for the node to form a relationship, transfer the data, respond to audits and settle on payments. Parties interested in forming contract may use the publisher-subscriber model that is common in most messaging systems. Contracts are signed and stored by both parties.
#codingexercise
Connect  N ropes with minimum cost
          Make a heap of n ropes
          While the size of the heap is > 1
                       Extract minimum cost rope
                       Extract minimum cost rope
                       Insert the rope with combined cost
          The last rope is the union forming minimum cost
Find the minimum number of coins from an infinite supply of varying denominations to form a change V
          sort the coins from big to small denominations
          while V > smallest denomination :
                pick a coin from the largest denomination that is smaller than V and add it to the collection to be returned
                reduce V by the value of the coin and repeat
          return the collection

No comments:

Post a Comment