Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace custody challenge game with JABS #812

Merged
merged 35 commits into from
Mar 28, 2019
Merged

Replace custody challenge game with JABS #812

merged 35 commits into from
Mar 28, 2019

Conversation

vbuterin
Copy link
Contributor

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.

vbuterin and others added 10 commits March 19, 2019 15:28
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.
@hwwhww hwwhww added the phase1 label Mar 20, 2019
JustinDrake added a commit that referenced this pull request Mar 20, 2019
Text moved away from `1_shard-data-chains.md` (see #812 rewrite).
Copy link
Contributor

@hwwhww hwwhww left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JABS!!!

specs/core/1_shard-data-chains.md Outdated Show resolved Hide resolved
specs/core/1_shard-data-chains.md Outdated Show resolved Hide resolved
specs/core/1_shard-data-chains.md Outdated Show resolved Hide resolved
specs/core/1_shard-data-chains.md Outdated Show resolved Hide resolved
specs/core/1_shard-data-chains.md Outdated Show resolved Hide resolved
specs/core/1_shard-data-chains.md Outdated Show resolved Hide resolved
specs/core/1_shard-data-chains.md Outdated Show resolved Hide resolved
assert state.validator_registry[reveal.validator_index].slashed_epoch > get_current_epoch(state)
slash_validator(state, reveal.validator_index, reveal.revealer_index)
state.validator_balances[reveal.revealer_index] += base_reward(state, index) // MINOR_REWARD_QUOTIENT
elif reveal.period == state.validator_registry[reveal.validator_index].next_subkey_to_reveal and reveal.mask == ZERO_HASH:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the variable names, it seems "Subkey reveals" section only processes early_subkey_reveals; are they all in is_early_reveal cases? Or it's better to adjust the variable naming?

specs/core/1_shard-data-chains.md Outdated Show resolved Hide resolved
specs/core/1_shard-data-chains.md Outdated Show resolved Hide resolved
@JustinDrake JustinDrake merged commit f5c5c16 into dev Mar 28, 2019
@hwwhww hwwhww deleted the vbuterin-patch-19 branch March 29, 2019 05:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants