Issue Type: Documentation Gap / Potential Security Gap
Component: UTXO Layer (node/utxo_db.py)
Severity: Low (documentation) to Medium (if exploited)
Description:
The spending_proof field in transactions is accepted by the UTXO layer without any validation or parsing. While this is clearly intentional (signature verification happens at the endpoint layer), there's no documentation or code comments explaining this architectural decision.
In PR #2073, the test test_spending_proof_not_verified_in_utxo_layer explicitly documents this behavior with the comment: "The UTXO layer does NOT verify spending proofs — by design. Signature verification is the endpoint layer's responsibility."
Problem:
This architectural boundary is implied but not explicitly specified in the codebase. A future developer might:
- Assume the UTXO layer validates proofs and introduce redundant validation
- Rely on the UTXO layer for security properties it doesn't provide
- Misunderstand where in the stack verification actually happens
Suggested Fix:
- Add a comment in
UTXODatabase.apply_transaction() at the spending_proof handling line
- Consider adding a docstring to the class that explicitly notes: "This module handles UTXO state transitions only. Signature verification is the caller's responsibility."
Impact:
Better developer experience, reduced risk of security assumptions being violated.
References:
Issue Type: Documentation Gap / Potential Security Gap
Component: UTXO Layer (
node/utxo_db.py)Severity: Low (documentation) to Medium (if exploited)
Description:
The
spending_prooffield in transactions is accepted by the UTXO layer without any validation or parsing. While this is clearly intentional (signature verification happens at the endpoint layer), there's no documentation or code comments explaining this architectural decision.In PR #2073, the test
test_spending_proof_not_verified_in_utxo_layerexplicitly documents this behavior with the comment: "The UTXO layer does NOT verify spending proofs — by design. Signature verification is the endpoint layer's responsibility."Problem:
This architectural boundary is implied but not explicitly specified in the codebase. A future developer might:
Suggested Fix:
UTXODatabase.apply_transaction()at the spending_proof handling lineImpact:
Better developer experience, reduced risk of security assumptions being violated.
References:
node/test_utxo_db.pytest added in PR [UTXO-BUG] LOW: Duplicate input dedup, missing validations, and test coverage gaps #2073node/utxo_db.pyaround line 320 (post-PR merge)