Assessment reports>Nocturne>Threat Model>applySubtreeUpdate

Function: applySubtreeUpdate(uint256 newRoot, uint256[8] proof)

This updates the root of the offline Merkle tree given a valid proof that the new tree is the old tree with the expected notes inserted.

Inputs

  • newRoot

    • Control: Arbitrary.

    • Constraints: Must pass subtreeupdate circuit. Must not be past root hash.

    • Impact: New root.

  • proof

    • Control: Arbitrary.

    • Constraints: Must pass subtreeupdate circuit.

    • Impact: None.

Branches and code coverage

Intended branches

  • Subtree update succeeds.

Negative behavior

  • Subtree update fails due newRoot being a past root.

  • Subtree update fails due to circuit-verification failure.

Zellic © 2024Back to top ↑