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

[Feature] Authorized Proving for Public Transfers #775

Open
wants to merge 3 commits into
base: testnet3
Choose a base branch
from

Conversation

iamalwaysuncomfortable
Copy link
Contributor

Motivation

This PR adds the ability to authorize public transfers and delegate the proving to the Aleo Network. This extremely short client-side proving times by enabling delegation of compute-heavy proof computations to the Aleo Network. This is only enabled for public transfers as all information in public transfers is posted as public knowledge on the Aleo blockchain.

Note: This does not integrate this functionality into Aleo.tools. This requires a proper UI design and will be worked in later.

Test Plan

  • Prior to this PR being integrated, in-wasm tests & client-side integration tests will be enabled to ensure that the proving works.

@iamalwaysuncomfortable iamalwaysuncomfortable changed the title [Feature] Delegated Proving for Public Transfers [Feature] Authorized Proving for Public Transfers Oct 16, 2023
@iamalwaysuncomfortable iamalwaysuncomfortable force-pushed the feat/delegated-proving-for-public-transfers branch from 6b78875 to f5481a7 Compare October 16, 2023 19:32
Copy link
Collaborator

@Pauan Pauan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, except for a minor nitpick about serde.

}
}

impl Serialize for Authorized {
Copy link
Collaborator

@Pauan Pauan Oct 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of manually implementing Serialize/Deserialize, it would be better to use attributes to control the serialization:

#[derive(Serialize, Deserialize)]
pub(crate) struct Authorized {
    /// The authorization for the main function execution.
    function: AuthorizationNative,

    /// The authorization for the fee execution.
    #[serde(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    fee: Option<AuthorizationNative>,

    /// Whether to broadcast the transaction.
    broadcast: bool,
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep you're %100 right

Copy link
Contributor

@collinc97 collinc97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace "delegate" -> "authorize"

sdk/src/program-manager.ts Outdated Show resolved Hide resolved
sdk/src/program-manager.ts Outdated Show resolved Hide resolved
sdk/src/program-manager.ts Outdated Show resolved Hide resolved
wasm/src/programs/manager/transfer.rs Outdated Show resolved Hide resolved
wasm/src/programs/manager/transfer.rs Outdated Show resolved Hide resolved
wasm/src/programs/manager/transfer.rs Outdated Show resolved Hide resolved
website/src/tabs/develop/Transfer.jsx Outdated Show resolved Hide resolved
website/src/workers/worker.js Outdated Show resolved Hide resolved
website/src/workers/worker.js Outdated Show resolved Hide resolved
Co-authored-by: Collin Chin <16715212+collinc97@users.noreply.github.com>
Signed-off-by: Mike Turner <mturner@aleo.org>
Co-authored-by: Collin Chin <16715212+collinc97@users.noreply.github.com>
Signed-off-by: Mike Turner <mturner@aleo.org>
@shresthagrawal
Copy link

Is it possible to extend this PR to support proof delegation for arbitrary function calls with public inputs?

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

Successfully merging this pull request may close these issues.

None yet

5 participants