-
Notifications
You must be signed in to change notification settings - Fork 920
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
Conversation
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.
Text moved away from `1_shard-data-chains.md` (see #812 rewrite).
There was a problem hiding this 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
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: |
There was a problem hiding this comment.
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?
Replace the existing proof of custody game with a new game ("Justin's Awesome Bit Sum" or JABS) that works as follows:
D
is split up into 512-byte chunksD[0] .... D[n-1]
, and use a mix functionmix(subkey, data) -> {0,1}
(currently the first bit of the hash ofsubkey+data
). We calculateM[i] = (mix(D[0]) + ... + mix(D[i-1])) % 2
, and set the custody bit toM[n-1]
M
whereM[n-1]
is not equal to the custody bitM
along with a branch of the data whereM[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 is2**17
bits or2**14
bytes. The average mix size is2**8
bytes.