ergoplatform/ergo

Add proof that interlink vector corresponds to its header

オープン

#1,384 opened on 2021/06/04

 (3 件のコメント) (0 件のリアクション) (1 人の担当者)Scala (201 件のフォーク)github user discovery
B-1000 SigUSDbountyhelp wanted

Repository metrics

Stars
 (519 個のスター)
PR merge metrics
 (平均マージ 12d 5h) (30d で 13 merged PRs)

説明

Implement batch Merkle proof for multiple keys (in scrypto), and use it to prove that interlink vector is indeed corresponding to its header (add it to json/binary representation of PoPoW header, add checks to the verifier).

Interlink vector (links to super-blocks of different levels in the past) is stored in extension section of a block in packed form,

So the proof generation and verification would be as following:

  • add batchProofFor(keys: Array[Byte])* to ExtensionCandidate to get batch proof for possibly many keys

  • in NipopowAlgos, instead of proofForInterlink (which can be removed), make proofForInterlinkVector(ext: ExtensionCandidate) to get batch Merkle proof for all the interlinks in the extension (so keys starting with InterlinksVectorPrefix)

  • add batch proof to PoPowHeader, and make there method to check it (note: pack the vector before the check), fix serialization accordingly

  • implement hasValidProofs which is checking proofs for all the PoPoWHeader instances

  • do tests on the way :)

コントリビューターガイド