ChainSafe / chainbridge-celo

GNU Lesser General Public License v3.0
3 stars 2 forks source link

Add commitedSeal related params to SignatureVerification #119

Closed P1sar closed 3 years ago

P1sar commented 3 years ago

commitedSeal params are the additional params that is required to validate BLS signature of block CommitedSealSuffix - is a byte array consists from IstanbulAggregatedSeal.Round + istanbul.MsgCommit CommitedSealPrefix - is byte(0-255) that is tried so that blake2s(<prefix 1 byte>blockHash<round ? byte><0x02>) produces a valid coordinate on the curve CommitedSealHints - are the square roots that would satisfy the curve equation. A lot of technical background could be found in next article https://medium.com/cryptoadvance/bls-signatures-better-than-schnorr-5a7fe30ea716

Implementation details

CommitedSealSuffix - is bytes concatenation of IstanbulAggregatedSeal.Round + istanbul.MsgCommit (constant) https://github.com/celo-org/celo-blockchain/blob/master/consensus/istanbul/types.go#L337 CommitedSealPrefix - the implementation are details provided to us by celo https://github.com/celo-org/celo-bls-go/pull/23/files prepare_for_contract.go line 47 CommitedSealHints - the implementation details provided to us by celo https://github.com/celo-org/celo-bls-go/pull/23/files prepare_for_contract.go line 52 Where args are blockHash + CommitedSealSuffix

Testing details

the unit tests are passing

Acceptance Criteria

the unit tests are passing CommitedSealSuffix []byte param exists in SignatureVerification CommitedSealPrefix []byte param exists in SignatureVerification CommitedSealHints []byte param exists in SignatureVerification