bulletproofs-1.0.1

Bulletproofs.ArithmeticCircuit

Synopsis

# Documentation

generateProof :: forall p m. (MonadRandom m, KnownNat p) => ArithCircuit (PrimeField p) -> ArithWitness (PrimeField p) -> m (ArithCircuitProof (PrimeField p)) Source #

Generate a zero-knowledge proof of computation for an arithmetic circuit with a valid witness

verifyProof :: KnownNat p => [Point] -> ArithCircuitProof (PrimeField p) -> ArithCircuit (PrimeField p) -> Bool Source #

Verify that a zero-knowledge proof holds for an arithmetic circuit given committed input values

Constructors

 ArithCircuitProof FieldstBlinding :: fBlinding factor of the T1 and T2 commitments, combined into the form required to make the committed version of the x-polynomial add upmu :: fBlinding factor required for the Verifier to verify commitments A, St :: fDot product of vectors l and r that prove knowledge of the value in range t = t(x) = l(x) · r(x)aiCommit :: PointCommitment to vectors aL and aRaoCommit :: PointCommitment to vectors aOsCommit :: PointCommitment to new vectors sL, sR, created at random by the ProvertCommits :: [Point]Commitments to t1, t3, t4, t5, t6productProof :: InnerProductProof f
Instances
 Eq f => Eq (ArithCircuitProof f) Source # Instance detailsDefined in Bulletproofs.ArithmeticCircuit.Internal Methods Show f => Show (ArithCircuitProof f) Source # Instance detailsDefined in Bulletproofs.ArithmeticCircuit.Internal MethodsshowList :: [ArithCircuitProof f] -> ShowS # Source # Instance detailsDefined in Bulletproofs.ArithmeticCircuit.Internal Associated Typestype Rep (ArithCircuitProof f) :: Type -> Type # Methodsfrom :: ArithCircuitProof f -> Rep (ArithCircuitProof f) x #to :: Rep (ArithCircuitProof f) x -> ArithCircuitProof f # Source # Instance detailsDefined in Bulletproofs.ArithmeticCircuit.Internal Methodsrnf :: ArithCircuitProof f -> () # type Rep (ArithCircuitProof f) Source # Instance detailsDefined in Bulletproofs.ArithmeticCircuit.Internal type Rep (ArithCircuitProof f) = D1 (MetaData "ArithCircuitProof" "Bulletproofs.ArithmeticCircuit.Internal" "bulletproofs-1.0.1-19OL1KfDIOwGdlR0HXS25a" False) (C1 (MetaCons "ArithCircuitProof" PrefixI True) (((S1 (MetaSel (Just "tBlinding") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 f) :*: S1 (MetaSel (Just "mu") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 f)) :*: (S1 (MetaSel (Just "t") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 f) :*: S1 (MetaSel (Just "aiCommit") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Point))) :*: ((S1 (MetaSel (Just "aoCommit") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Point) :*: S1 (MetaSel (Just "sCommit") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Point)) :*: (S1 (MetaSel (Just "tCommits") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Point]) :*: S1 (MetaSel (Just "productProof") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (InnerProductProof f))))))

data ArithCircuit f Source #

Constructors

 ArithCircuit Fieldsweights :: GateWeights fWeights for vectors of left and right inputs and for vector of outputscommitmentWeights :: [[f]]Weigths for a commitments V of rank mcs :: [f]Vector of constants of size Q
Instances
 Eq f => Eq (ArithCircuit f) Source # Instance detailsDefined in Bulletproofs.ArithmeticCircuit.Internal Methods(==) :: ArithCircuit f -> ArithCircuit f -> Bool #(/=) :: ArithCircuit f -> ArithCircuit f -> Bool # Show f => Show (ArithCircuit f) Source # Instance detailsDefined in Bulletproofs.ArithmeticCircuit.Internal MethodsshowsPrec :: Int -> ArithCircuit f -> ShowS #show :: ArithCircuit f -> String #showList :: [ArithCircuit f] -> ShowS # Source # Instance detailsDefined in Bulletproofs.ArithmeticCircuit.Internal Associated Typestype Rep (ArithCircuit f) :: Type -> Type # Methodsfrom :: ArithCircuit f -> Rep (ArithCircuit f) x #to :: Rep (ArithCircuit f) x -> ArithCircuit f # Source # Instance detailsDefined in Bulletproofs.ArithmeticCircuit.Internal Methodsshrink :: ArithCircuit (PrimeField p) -> [ArithCircuit (PrimeField p)] # NFData f => NFData (ArithCircuit f) Source # Instance detailsDefined in Bulletproofs.ArithmeticCircuit.Internal Methodsrnf :: ArithCircuit f -> () # type Rep (ArithCircuit f) Source # Instance detailsDefined in Bulletproofs.ArithmeticCircuit.Internal type Rep (ArithCircuit f) = D1 (MetaData "ArithCircuit" "Bulletproofs.ArithmeticCircuit.Internal" "bulletproofs-1.0.1-19OL1KfDIOwGdlR0HXS25a" False) (C1 (MetaCons "ArithCircuit" PrefixI True) (S1 (MetaSel (Just "weights") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (GateWeights f)) :*: (S1 (MetaSel (Just "commitmentWeights") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [[f]]) :*: S1 (MetaSel (Just "cs") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [f]))))

data ArithWitness f Source #

Constructors

 ArithWitness Fieldsassignment :: Assignment fVectors of left and right inputs and vector of outputscommitments :: [Point]Vector of commited input values ∈ F^mcommitBlinders :: [f]Vector of blinding factors for input values ∈ F^m
Instances
 Eq f => Eq (ArithWitness f) Source # Instance detailsDefined in Bulletproofs.ArithmeticCircuit.Internal Methods(==) :: ArithWitness f -> ArithWitness f -> Bool #(/=) :: ArithWitness f -> ArithWitness f -> Bool # Show f => Show (ArithWitness f) Source # Instance detailsDefined in Bulletproofs.ArithmeticCircuit.Internal MethodsshowsPrec :: Int -> ArithWitness f -> ShowS #show :: ArithWitness f -> String #showList :: [ArithWitness f] -> ShowS # Source # Instance detailsDefined in Bulletproofs.ArithmeticCircuit.Internal Associated Typestype Rep (ArithWitness f) :: Type -> Type # Methodsfrom :: ArithWitness f -> Rep (ArithWitness f) x #to :: Rep (ArithWitness f) x -> ArithWitness f # Source # Instance detailsDefined in Bulletproofs.ArithmeticCircuit.Internal Methodsshrink :: ArithWitness (PrimeField p) -> [ArithWitness (PrimeField p)] # NFData f => NFData (ArithWitness f) Source # Instance detailsDefined in Bulletproofs.ArithmeticCircuit.Internal Methodsrnf :: ArithWitness f -> () # type Rep (ArithWitness f) Source # Instance detailsDefined in Bulletproofs.ArithmeticCircuit.Internal type Rep (ArithWitness f) = D1 (MetaData "ArithWitness" "Bulletproofs.ArithmeticCircuit.Internal" "bulletproofs-1.0.1-19OL1KfDIOwGdlR0HXS25a" False) (C1 (MetaCons "ArithWitness" PrefixI True) (S1 (MetaSel (Just "assignment") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Assignment f)) :*: (S1 (MetaSel (Just "commitments") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Point]) :*: S1 (MetaSel (Just "commitBlinders") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [f]))))

data GateWeights f Source #

Constructors

 GateWeights FieldswL :: [[f]]WL ∈ F^(Q x n)wR :: [[f]]WR ∈ F^(Q x n)wO :: [[f]]WO ∈ F^(Q x n)
Instances
 Eq f => Eq (GateWeights f) Source # Instance detailsDefined in Bulletproofs.ArithmeticCircuit.Internal Methods(==) :: GateWeights f -> GateWeights f -> Bool #(/=) :: GateWeights f -> GateWeights f -> Bool # Show f => Show (GateWeights f) Source # Instance detailsDefined in Bulletproofs.ArithmeticCircuit.Internal MethodsshowsPrec :: Int -> GateWeights f -> ShowS #show :: GateWeights f -> String #showList :: [GateWeights f] -> ShowS # Source # Instance detailsDefined in Bulletproofs.ArithmeticCircuit.Internal Associated Typestype Rep (GateWeights f) :: Type -> Type # Methodsfrom :: GateWeights f -> Rep (GateWeights f) x #to :: Rep (GateWeights f) x -> GateWeights f # NFData f => NFData (GateWeights f) Source # Instance detailsDefined in Bulletproofs.ArithmeticCircuit.Internal Methodsrnf :: GateWeights f -> () # type Rep (GateWeights f) Source # Instance detailsDefined in Bulletproofs.ArithmeticCircuit.Internal type Rep (GateWeights f) = D1 (MetaData "GateWeights" "Bulletproofs.ArithmeticCircuit.Internal" "bulletproofs-1.0.1-19OL1KfDIOwGdlR0HXS25a" False) (C1 (MetaCons "GateWeights" PrefixI True) (S1 (MetaSel (Just "wL") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [[f]]) :*: (S1 (MetaSel (Just "wR") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [[f]]) :*: S1 (MetaSel (Just "wO") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [[f]]))))

data Assignment f Source #

Constructors

 Assignment FieldsaL :: [f]aL ∈ F^n. Vector of left inputs of each multiplication gateaR :: [f]aR ∈ F^n. Vector of right inputs of each multiplication gateaO :: [f]aO ∈ F^n. Vector of outputs of each multiplication gate
Instances
 Eq f => Eq (Assignment f) Source # Instance detailsDefined in Bulletproofs.ArithmeticCircuit.Internal Methods(==) :: Assignment f -> Assignment f -> Bool #(/=) :: Assignment f -> Assignment f -> Bool # Show f => Show (Assignment f) Source # Instance detailsDefined in Bulletproofs.ArithmeticCircuit.Internal MethodsshowsPrec :: Int -> Assignment f -> ShowS #show :: Assignment f -> String #showList :: [Assignment f] -> ShowS # Source # Instance detailsDefined in Bulletproofs.ArithmeticCircuit.Internal Associated Typestype Rep (Assignment f) :: Type -> Type # Methodsfrom :: Assignment f -> Rep (Assignment f) x #to :: Rep (Assignment f) x -> Assignment f # Source # Instance detailsDefined in Bulletproofs.ArithmeticCircuit.Internal Methodsshrink :: Assignment (PrimeField p) -> [Assignment (PrimeField p)] # NFData f => NFData (Assignment f) Source # Instance detailsDefined in Bulletproofs.ArithmeticCircuit.Internal Methodsrnf :: Assignment f -> () # type Rep (Assignment f) Source # Instance detailsDefined in Bulletproofs.ArithmeticCircuit.Internal type Rep (Assignment f) = D1 (MetaData "Assignment" "Bulletproofs.ArithmeticCircuit.Internal" "bulletproofs-1.0.1-19OL1KfDIOwGdlR0HXS25a" False) (C1 (MetaCons "Assignment" PrefixI True) (S1 (MetaSel (Just "aL") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [f]) :*: (S1 (MetaSel (Just "aR") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [f]) :*: S1 (MetaSel (Just "aO") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [f]))))