Documentation
¶
Index ¶
- func CreateBaseCaseProof(fullTxBytes []byte, innerCcs constraint.ConstraintSystem, ...) (witness.Witness, native_plonk.Proof, error)
- func CreateBaseCaseWitness(rawTx []byte, currTxId [32]byte) (witness.Witness, error)
- func SetupBaseCase(txSize int, innerField *big.Int) (constraint.ConstraintSystem, native_plonk.ProvingKey, ...)
- func SetupNormalCase(outerField *big.Int, parentCcs constraint.ConstraintSystem, ...) (constraint.ConstraintSystem, native_plonk.ProvingKey, ...)
- type Sha256Circuit
- type Sha256CircuitBaseCase
- type Sha256InnerCircuit
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateBaseCaseProof ¶
func CreateBaseCaseProof(fullTxBytes []byte, innerCcs constraint.ConstraintSystem, provingKey native_plonk.ProvingKey) ( witness.Witness, native_plonk.Proof, error, )
func CreateBaseCaseWitness ¶
func SetupBaseCase ¶
func SetupBaseCase(txSize int, innerField *big.Int) (constraint.ConstraintSystem, native_plonk.ProvingKey, native_plonk.VerifyingKey, error)
func SetupNormalCase ¶
func SetupNormalCase(outerField *big.Int, parentCcs constraint.ConstraintSystem, parentVk plonk.VerifyingKey[sw_bls12377.ScalarField, sw_bls12377.G1Affine, sw_bls12377.G2Affine]) (constraint.ConstraintSystem, native_plonk.ProvingKey, native_plonk.VerifyingKey, error)
Types ¶
type Sha256Circuit ¶
type Sha256Circuit[FR emulated.FieldParams, G1El algebra.G1ElementT, G2El algebra.G2ElementT, GtEl algebra.GtElementT] struct { PreviousProof stdplonk.Proof[FR, G1El, G2El] PreviousVk stdplonk.VerifyingKey[FR, G1El, G2El] `gnark:"-"` // constant verification key PreviousWitness stdplonk.Witness[FR] CurrTxPrefix [5]uints.U8 //5 PrevTxId [32]uints.U8 CurrTxPost [188]uints.U8 //81 //double-sha256 hash of the concatenation of above fields. Not reversed, so not quite a TxId //TokenId [32]uints.U8 `gnark:",public"` //probably needs to provide the reversed version to save circuit space CurrTxId [32]uints.U8 `gnark:",public"` //probably needs to provide the reversed version to save circuit space }
* General case to continue with proofs
func CreateOuterAssignment ¶
func CreateOuterAssignment( circuitWitness plonk.Witness[sw_bls12377.ScalarField], circuitProof plonk.Proof[sw_bls12377.ScalarField, sw_bls12377.G1Affine, sw_bls12377.G2Affine], verifyingKey plonk.VerifyingKey[sw_bls12377.ScalarField, sw_bls12377.G1Affine, sw_bls12377.G2Affine], prefixBytes []byte, prevTxnIdBytes []byte, postFixBytes []byte, fullTxBytes []byte) Sha256Circuit[sw_bls12377.ScalarField, sw_bls12377.G1Affine, sw_bls12377.G2Affine, sw_bls12377.GT]
type Sha256CircuitBaseCase ¶
type Sha256CircuitBaseCase[FR emulated.FieldParams, G1El algebra.G1ElementT, G2El algebra.G2ElementT, GtEl algebra.GtElementT] struct { //CurrTxPrefix [5]uints.U8 //5 //PrevTxId [32]uints.U8 //CurrTxPost [154]uints.U8 //81 RawTx []uints.U8 `gnark:",public"` //double-sha256 hash of the concatenation of above fields. Not reversed, so not quite a TxId CurrTxId [32]uints.U8 `gnark:",public"` //probably needs to provide the reversed version to save circuit space }
* Base case to generate initial proof to get things started
type Sha256InnerCircuit ¶
type Sha256InnerCircuit struct { CurrTxPrefix [5]uints.U8 //5 PrevTxId [32]uints.U8 CurrTxPost [154]uints.U8 //81 //double-sha256 hash of the concatenation of above fields. Not reversed, so not quite a TxId CurrTxId [32]uints.U8 `gnark:",public"` //probably needs to provide the reversed version to save circuit space }
circuit that proves in zero knowledge that there exists a Transaction with Id == CurrTxId which is composed of sha256(sha256(CurrTxPrefix || PrevTxId || CurrTxPost))
Click to show internal directories.
Click to hide internal directories.