2024-05-20 20:00:03 +05:30

24 lines
493 B
Python

"""
This module maintains the state of the CL.
Namely we are interested in:
- the set of note commitments
- the set of note nullifiers (spent notes)
- the set of constraints
"""
from dataclasses import dataclass
import note
import constraint
@dataclass
class State:
commitments: set[note.Commitment]
nullifiers: set[note.Nullifier]
constraints: dict[bytes, constraint.Constraint]
def add_constraint(self, c: constraint.Constraint):
self.constraints[c.hash()] = c