Skip to content

SDK is not abstract enough which degrades Aztec design #18791

@shiqicao

Description

@shiqicao

Aztec's design is very generalized and abstract, however the SDK doesn't keep the abstraction and often offer very specialized API. This hides the true value of Aztec.

Example 1,

It always assumes auth witness is a hash. What if I want to design an account contract which only allows even function selector?

Example 2,

It always assumes the signature of entrypoint of account contract, actually Aztec allows it to be anything. It always assumes that the entrypoint is called "entrypoing" and it takes AppPayload, etc. See the code from DeployMethod

  private getSelfFeePaymentMethod(originalPaymentMethod?: FeePaymentMethod) {
    if (!this.address) {
      throw new Error('Instance is not yet constructed. This is a bug!');
    }
    return new AccountEntrypointMetaPaymentMethod(
      this.wallet,
      this.artifact,
      'entrypoint',
      this.address,
      originalPaymentMethod,
    );
  }

Solution

To avoid this, one method is to create sample account contract which fully exercise account contract features and freedom. For example, 1, what if an app wants user to sign actual function calls(name, parameters, etc) instead of just hash. 2, support multiple entrypoints. 3, support different entrypoint parameters than AppPayload.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions