We plan to use the BN254 curve that supports a max integer of 2**254, which is less than a typical 256-bit word in EVM.
To work with EVM values in the circuit, we need to encode a 256-bit value into 8 bits chunks. Take word256 = 1 example, the corresponding 8 bit words is word8s = [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].
What's wrong
We plan to use the BN254 curve that supports a max integer of 2**254, which is less than a typical 256-bit word in EVM.
To work with EVM values in the circuit, we need to encode a 256-bit value into 8 bits chunks. Take
word256 = 1
example, the corresponding 8 bit words isword8s = [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
.Other details are specified here https://hackmd.io/@liangcc/zkvmbook/https%3A%2F%2Fhackmd.io%2FQUiYS3MnTu29s62yg9EtLQ
How are we fixing this
hash(ALL8BITS)
for the time being.