Skip to content

Commit

Permalink
Replace custody challenge game with JABS (#812)
Browse files Browse the repository at this point in the history
See also #818.

===

* Replace custody challenge game with JABS

Replace the existing proof of custody game with a new game ("Justin's Awesome Bit Sum" or JABS) that works as follows:

* The data `D` is split up into 512-byte chunks `D[0] .... D[n-1]`, and use a mix function `mix(subkey, data) -> {0,1}` (currently the first bit of the hash of `subkey+data`). We calculate `M[i] = (mix(D[0]) + ... + mix(D[i-1])) % 2`, and set the custody bit to `M[n-1]`
* Anyone can challenge by providing the full `M` where `M[n-1]` is not equal to the custody bit
* Anyone can respond to a challenge by providing a specific position in `M` along with a branch of the data where `M[i-1] ^ mix(D[i]) != M[i]`

The maximum size of data is now `2**6` epochs *  `2**6` blocks * `2**14` bytes = `2**26` bytes, so assuming 512-byte mix chunks the maximum mix size is `2**17` bits or `2**14` bytes. The average mix size is `2**8` bytes.
  • Loading branch information
vbuterin authored and JustinDrake committed Mar 28, 2019
1 parent 1082c68 commit f5c5c16
Showing 1 changed file with 282 additions and 791 deletions.
Loading

0 comments on commit f5c5c16

Please sign in to comment.