Skip to content

Improve BasicAuthenticator & TransactionAuthenticator for ECDSA Auth Component #2064

@onurinanc

Description

@onurinanc

The secp256k1::verify
function can be used by providing the signature as an advice input.
To obtain the signature as an advice input, we first need the message in the form of a TransactionSummary.
This can be achieved by executing a transaction context where the following call fails as expected:

let tx_summary = match tx_context_init.execute().await.unwrap_err() {
        TransactionExecutorError::Unauthorized(tx_effects) => tx_effects,
        error => panic!("expected abort with tx effects: {error:?}"),
    };

However, when using the BasicAuthenticator, which relies on public key commitments, this execution fails differently.
Instead of returning TransactionExecutorError::Unauthorized(tx_effects), it results in a TransactionProgramExecutionFailed with an ExecutionError, preventing the Box from being returned due to the invalid public key.

such as:
source: InvalidValue("Invalid public key")

Expected Behavior
tx_context_init.execute() should fail with TransactionExecutorError::Unauthorized(tx_effects) so that the resulting TransactionSummary can be obtained as advice input.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions