Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Circuit constructor #347

Open
krnak opened this issue Aug 11, 2022 · 1 comment
Open

Add a Circuit constructor #347

krnak opened this issue Aug 11, 2022 · 1 comment

Comments

@krnak
Copy link
Contributor

krnak commented Aug 11, 2022

According to the #287 I need some Circuit constructor.

I prefer this API:

    /// Constructs a `Circuit` from the following components:
    /// - `merkle_path`: a merkle path witness of the `input_note`
    /// - `input_note`: a note spent in scope of of the action
    /// - `output_note`: a note created in scope of the action
    /// - `fvk`: full viewing key owning the `input_note`
    /// - `alpha`: a scalar used for randomization of the action spend validating key
    /// - `rcv`: trapdoor of the action value commitment
    ///
    /// Returns `None` if the `input_note` is not owned by the `fvk`.
    pub fn from_action_context(
        merkle_path: tree::MerklePath,
        input_note: Note,
        output_note: Note,
        fvk: FullViewingKey,
        alpha: pallas::Scalar,
        rcv: ValueCommitTrapdoor,
    ) -> Option<Circuit>;

Also some ValueCommitTrapdoor and Note constructors will be necessary.

I will add ValueCommitTrapdoor::from_bytes([u8; 32]) -> CtOption<Self>.

Note constructor can be resolved via #344

@krnak
Copy link
Contributor Author

krnak commented Aug 11, 2022

Please also consider

I didn't modify changelog in these PRs, so there will not be conflicts after merges. I will update the changelog afterwards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant