Trait ergotree_interpreter::sigma_protocol::prover::Prover[][src]

pub trait Prover: Evaluator {
    fn secrets(&self) -> &[PrivateInput];

    fn prove(
        &self,
        tree: &ErgoTree,
        env: &Env,
        ctx: Rc<Context>,
        message: &[u8]
    ) -> Result<ProverResult, ProverError> { ... }
fn prove_to_unchecked(
        &self,
        unproven_tree: UnprovenTree,
        message: &[u8]
    ) -> Result<UncheckedSigmaTree, ProverError> { ... }
fn mark_real(&self, unproven_tree: UnprovenTree) -> UnprovenTree { ... }
fn polish_simulated(&self, _unproven_tree: UnprovenTree) -> UnprovenTree { ... }
fn simulate_and_commit(
        &self,
        tree: UnprovenTree
    ) -> Result<ProofTree, ProverError> { ... }
fn proving(&self, tree: ProofTree) -> Result<ProofTree, ProverError> { ... } }

Prover

Required methods

fn secrets(&self) -> &[PrivateInput][src]

Secrets of the prover

Loading content...

Provided methods

fn prove(
    &self,
    tree: &ErgoTree,
    env: &Env,
    ctx: Rc<Context>,
    message: &[u8]
) -> Result<ProverResult, ProverError>
[src]

The comments in this section are taken from the algorithm for the Sigma-protocol prover as described in the ErgoScript white-paper https://ergoplatform.org/docs/ErgoScript.pdf , Appendix A

Generate proofs for the given message for ErgoTree reduced to Sigma boolean expression

fn prove_to_unchecked(
    &self,
    unproven_tree: UnprovenTree,
    message: &[u8]
) -> Result<UncheckedSigmaTree, ProverError>
[src]

The comments in this section are taken from the algorithm for the Sigma-protocol prover as described in the white paper https://ergoplatform.org/docs/ErgoScript.pdf (Appendix A)

fn mark_real(&self, unproven_tree: UnprovenTree) -> UnprovenTree[src]

Prover Step 1: This step will mark as “real” every node for which the prover can produce a real proof. This step may mark as “real” more nodes than necessary if the prover has more than the minimal necessary number of witnesses (for example, more than one child of an OR). This will be corrected in the next step. In a bottom-up traversal of the tree, do the following for each node:

fn polish_simulated(&self, _unproven_tree: UnprovenTree) -> UnprovenTree[src]

Prover Step 3: This step will change some “real” nodes to “simulated” to make sure each node has the right number of simulated children. In a top-down traversal of the tree, do the following for each node:

fn simulate_and_commit(
    &self,
    tree: UnprovenTree
) -> Result<ProofTree, ProverError>
[src]

Prover Step 4: In a top-down traversal of the tree, compute the challenges e for simulated children of every node Prover Step 5: For every leaf marked “simulated”, use the simulator of the Sigma-protocol for that leaf to compute the commitment $a$ and the response z, given the challenge e that is already stored in the leaf. Prover Step 6: For every leaf marked “real”, use the first prover step of the Sigma-protocol for that leaf to compute the commitment a.

fn proving(&self, tree: ProofTree) -> Result<ProofTree, ProverError>[src]

Prover Step 9: Perform a top-down traversal of only the portion of the tree marked “real” in order to compute the challenge e for every node marked “real” below the root and, additionally, the response z for every leaf marked “real”

Loading content...

Implementors

Loading content...