Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Matthews Lab
Search
Search
Appearance
Log in
Personal tools
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Permissioned resource coins
(section)
Page
Discussion
British English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Paying for storage space === In our sample coin pseudo-code I introduced an algorithm for allocating storage space, but what is missing from this is a protocol for the clients to use for making payments. In practice, all existing storage-based resource coins start by proving custody of a large amount of data. The way they do this is to generate a large random number to use as a challenge and then prepend it to a piece of content to hash for an answer. To prove that a host still has the content they must be able to reproduce the same answer hash after given the random number. While this challenge-response game works well for large amounts of content, for smaller pieces of content it is over-kill. What would be interesting is a storage system for smaller pieces of information such as those produced by sensors and other IoT devices. Because the data is small, my protocol for this is to randomly sample data and check what farmers still have. The client would sign data under the same pub key and record an ID to identify it. That way they only have to maintain an index of metadata to verify bulk data sent over a unique period. If you wanted to, you could also set a percentage ratio here to adjust how vital the data is to make it more like UDP. It might be okay if you lose one or two sensor readings along the way but not if you lose all of them! <pre>audits = [] priv_key = "private" pub_key = "pub" swarm = coin.allocate_storage(20, pub_key) def random_audit(swarm, pub_key): # An hour ago. start_time = time() - (60 * 60) end_time = start_time + ((60 + 60) * 2) # Get a list of data signatures for all data sent over the last # hour or so. Yes, I'm getting lazy here. offset = audits.get_offset_closet_to_start_time(start_time) challenges = [] while 1: audit = audits[offset] if audit["timestamp"] > end_time: break challenges.append(audit) # Audit swarm nodes for data pieces. for farmer in swarm: responses = farmer.retrieve(start_time, end_time) if len(responses) < len(challenges) * 0.8: farmer.micro_payment = "break" else: total_correct = 0 for response in responses: if response not in challenges: continue if not valid_sig(response, pub_key): continue if total_correct <= len(challenges) * 0.8: farmer.micro_payment = "break" def store_content(content, priv_key, swarm): for farmer in swarm: # Skip this farmer. if farmer.micro_payment == "broken": continue # Sign the data chunk nonce = random() sig = sign(chunk, nonce, priv_key) # Pay the farmer for this farmer.store(chunk, sig) # Record meta data timestamp = time() audits.append({"timestamp": timestamp, "nonce": nonce, "sig": sig})</pre> The payment protocol then follows a basic micropayment channel: if a farmer fails an audit, the client closes their channel. Likewise, if a client fails to make payment, the farmer drops storing data for that client. Either side can close the channel at any time to unlock their pending balances (storage space or reserved payment in micropayment channels.) <span id="optimising-data-usage"></span>
Summary:
Please note that all contributions to Matthews Lab may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Matthews Lab:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)