From b2b2213bd6d09a782b77f4e74ddff67ef4900ac3 Mon Sep 17 00:00:00 2001 From: David Rusu Date: Fri, 31 May 2024 12:55:08 +0400 Subject: [PATCH] cl: remove unused classes --- coordination-layer/note.py | 14 -------------- coordination-layer/notes.org | 16 ++++++++++++---- coordination-layer/partial_transaction.py | 10 ---------- coordination-layer/state.py | 6 +++--- 4 files changed, 15 insertions(+), 31 deletions(-) diff --git a/coordination-layer/note.py b/coordination-layer/note.py index 571297a..f148657 100644 --- a/coordination-layer/note.py +++ b/coordination-layer/note.py @@ -13,20 +13,6 @@ from crypto import ( from constraints import Constraint, Proof -# TODO: is this used? -@dataclass -class NoteCommitment: - cm: Field - blinding: Field - zero: Field - - -# TODO: is this used? -@dataclass -class Nullifier: - nf: bytes - - def nf_pk(nf_sk) -> Field: return prf("CL_NOTE_NF", nf_sk) diff --git a/coordination-layer/notes.org b/coordination-layer/notes.org index 4302f56..c463464 100644 --- a/coordination-layer/notes.org +++ b/coordination-layer/notes.org @@ -1,13 +1,16 @@ * Open Issues -** Note.verify() should take a proof - -We should have two variants, verifyDeath(deathProof) verifyBirth(birthProof) - ** provided commitment to zero may removing the blinding of the pederson commitment Since you can subtract the randomness from the commitment to get just the binding part. +Ok, lets deal with these zero commitments. + +In place of zero commitments, we can have the solver prove that the value part of a pederson +commitment is zero. + + + ** Rename transaction randonmness to tx_rand and commitment randomness to cm_rand Currently they are both called "rand" and it's confusing. @@ -77,6 +80,11 @@ I've gone and denoted it as bytes. * Solved +** Note.verify() should take a proof + +We should have two variants, verifyDeath(deathProof) verifyBirth(birthProof) + + ** Do we need note.randomness? It's currently used in the note commitment. But perhaps it's not really necessary? diff --git a/coordination-layer/partial_transaction.py b/coordination-layer/partial_transaction.py index d70603f..20dd49b 100644 --- a/coordination-layer/partial_transaction.py +++ b/coordination-layer/partial_transaction.py @@ -27,16 +27,6 @@ class OutputNote: return self.note.note.verify_birth(self.birth_proof) -# TODO: is this used? -@dataclass -class Output: - note: PublicNote - - # pre-computed balance and zero commitment "SecretNote" here. - balance: Field - zero: Field - - @dataclass(unsafe_hash=True) class PartialTransaction: inputs: list[InputNote] diff --git a/coordination-layer/state.py b/coordination-layer/state.py index 358377c..c1e0cd1 100644 --- a/coordination-layer/state.py +++ b/coordination-layer/state.py @@ -15,9 +15,9 @@ import constraint @dataclass class State: - commitments: set[note.Commitment] - nullifiers: set[note.Nullifier] - constraints: dict[bytes, constraint.Constraint] + # 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