Skip to content

Bitkeeper incentives

Gene Vayngrib edited this page Feb 11, 2015 · 5 revisions

Bitkeeper network is a decentralized transaction store. Each participant, a keeper, is run by an independent party which can freely join the network without screening or permission, and is designed to work even in presence of bad actors.

Distance lottery algorithm

Keeper nodes compete to win a lottery in return for keeping files. Winner must prove they have the file closest to the requested file. This creates an incentive for keepers to keep as many files at they can (and stay online) to increase their chance of winning the lottery. Payment is made over a payment channel to avoid micro-transactions on the blockchain.


##Implementation Algorithm uses a notion of the distance between any two hashes. The client issues a PUT request to N keepers, closest to a new file. Each new node generates a public key and hashes it, which becomes its nodeid (we should use the same hash function for nodeid and for the file hash). This ensures even distribution of files across nodes. Retrieval:

  • The client issues a GET request to N keepers, closest to a file.
  • Each keeper replies with a hash of a closest file it has and a hash of two files concatenated together. - The client waits 1 second (or similar timeout) till responses are collected from all keepers and then decides on a winner.
  • The client GETs both files directly from that keeper and verifies their hashes.
  • The client creates a bitcoin payment channel transaction and after M transactions publishes a transaction to the bitcoin blockchain. Delayed payment provides another incentive for keeper to stick around.

##Fairness towards the keeper nodes

  • Files are distributed across the whole keeper network according to a Poisson distribution (I am not a cryptographer, please tell me if I am wrong). This ensures that centralization of the keeper network does not increase the chances of winning the lottery unfairly.
  • If two keepers get the same result - the first one wins (this way keepers will have an incentive to provide low latency service)
  • PUT is not paid, to avoid keepers collecting a fee and then never keeping the file.
  • distance between files is an incentive to keep as many files as you can on a node. Distance between nodes would incentivize a keeper to create many nodes.
  • leechers could accept PUT request but throw away the file. When receiving GET they can issue GET themselves and return it to requester. But this way they will lose the race. They will also tarnish their reputation as they will not pay for GETs from other nodes.

##Todo

  • prove that the second (closest) file is legit (was one of the files requested at some point for safekeeping)
  • Will keepers be paid enough even when files are requested rarely? This is especially true if businesses will keep their own transactions fairly well and only use keepers as a back that is restored only in case of emergencies.
  • payment channel could be open for a long time, how to make sure data is not lost? Today it is the responsibility of the client and the keeper node itself.

Attack vectors

  • the client decides which keeper wins. What is the client is not honest? It could choose a keeper with a larger distance or increase/decrease the timeout. One might think it could run a keeper node and make it win all the time. But this is fine as the client is paying keepers from its own funds and it would just be moving money from one pocket to another. In fact it will likely run its own keeper node, to avoid extra fees for retrieving files from the network and to preserve micro-services architecture.
  • Sybil attack. S/Kademlia protocol addresses this attack by asking each node to gen a public key and use its hash as a nodeid. In addition it asks each node to sign their messages. Then S/Kademlia implements neighbors list algo which we need to review and implement. Reputation mechanism can also be used. Node can register its identity on the blockchain, and other nodes could submit complaint requests for it with a proof of bad behavior. Unresolved complaints could be used by the client to avoid bad nodes. Node identity could be tied to long standing social profiles to increase trust.

##Other notable algorithms on this subject

  • Filecoin is designed for large files, creates its own blockchain and is using both proof of work and a clever proof of retrievability, recording both gets and puts on a chain.
  • Maidsafe review and an alternative incentives scheme.
  • Permacoin is designed for large archives and is a blockchain that aims to replace bitcoin's proof of work with proof of retrievability. Not really aligned with our goals but still an important source of ideas, like the outsourceability.
  • Byzantine storage - can someone help review ideas in this article?

The hash distance lottery algo does not need its own blockchain. It uses bitcoin blockchain to pay keepers. So it does not need a sidechain either. It does not waste energy on creating PoW and does not need the complexity of breaking files into pieces and reassembling them, as files are really small, like order, invoice, etc. and not a media file.

Clone this wiki locally