Skip to content

feat(execution): create a package metadata object at publish time#9461

Merged
miker83z merged 5 commits intovm-lang/aa-auth/8805-beta-feature-branchfrom
vm-lang/aa-auth/authenticator-and-package-metadata
Dec 4, 2025
Merged

feat(execution): create a package metadata object at publish time#9461
miker83z merged 5 commits intovm-lang/aa-auth/8805-beta-feature-branchfrom
vm-lang/aa-auth/authenticator-and-package-metadata

Conversation

@miker83z
Copy link
Contributor

@miker83z miker83z commented Nov 27, 2025

Description of change

This PR introduces the creation of a Package Metadata immutable object during a package publishing/upgrade. This allows to use such metadata to create AuthenticatorInfoV1 instances for accounts.

Internal AA architecture document.

Description:

  • every time a function uses the #[authenticator] annotation, the node’s publish/upgrade execution tries to create a PackageMetadata immutable object.
  • a new set of functions in the iota-verifier crate implement the checking of the requirements for a package metadata to be valid; the information for such validation is extracted from the package bytecode (see feat(move): Add custom attributes #9453)
  • iota-verifier::verify_authenticate_func_v1 checks the correctness of the declared authenticate() function (that was previously annotated with #[authenticator])
  • once the PackageMetadata immutable object is created, then the framework method create_auth_info_v1 can be used as the only way to create an AuthenticatorInfoV1 instance.
  • the AuthenticatorInfoV1 struct includes the fields to uniquely identify a function on-chain: package id, module name, function name.
  • An Account object is an object with a dynamic field being a AuthenticatorInfoV1.
  • Then, to any user-created object, an AuthenticatorInfoV1 can be “attached“. The only requirement is that the AuthenticatorInfoV1 is compatible with T, where T is exactly the type of the object set to become an Account.

How the change has been tested

  • Basic tests (linting, compilation, formatting, unit/integration tests)
  • Patch-specific tests (correctness, functionality coverage)
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that new and existing unit tests pass locally with my changes

Release Notes

  • Protocol: Add the publish_package_metadata. This enables the creation of an immutable object at publish/upgrade time when some known attributes (e.g., the authenticator function attribute) are found in the source code.
  • Nodes (Validators and Full nodes):
  • Indexer:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:
  • REST API:

@miker83z miker83z self-assigned this Nov 27, 2025
@miker83z miker83z added the vm-language Issues related to the VM & Language Team label Nov 27, 2025
@vercel
Copy link

vercel bot commented Nov 27, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

6 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
apps-backend Ignored Ignored Preview Dec 4, 2025 8:27am
apps-ui-kit Ignored Ignored Preview Dec 4, 2025 8:27am
iota-evm-bridge Ignored Ignored Preview Dec 4, 2025 8:27am
iota-multisig-toolkit Ignored Ignored Preview Dec 4, 2025 8:27am
rebased-explorer Ignored Ignored Preview Dec 4, 2025 8:27am
wallet-dashboard Ignored Ignored Preview Dec 4, 2025 8:27am

@iota-ci iota-ci added the sc-platform Issues related to the Smart Contract Platform group. label Nov 27, 2025
@miker83z miker83z mentioned this pull request Dec 1, 2025
8 tasks
@miker83z miker83z force-pushed the vm-lang/aa-auth/authenticator-and-package-metadata branch 2 times, most recently from 5288473 to 570d91a Compare December 1, 2025 15:51
@miker83z miker83z marked this pull request as ready for review December 1, 2025 15:51
@miker83z miker83z requested review from a team as code owners December 1, 2025 15:51
Copy link
Member

@thibault-martinez thibault-martinez left a comment

Choose a reason for hiding this comment

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

Approving crates/iota-open-rpc/spec/openrpc.json

Base automatically changed from vm-lang/cherry-pick-for-move-view to vm-lang/aa-auth/8805-beta-feature-branch December 2, 2025 12:59
Co-authored-by: Valerii Reutov <valeriy.reutov@gmail.com>
Co-authored-by: Pavlo Botnar <pavlo.botnar@gmail.com>
@miker83z miker83z force-pushed the vm-lang/aa-auth/authenticator-and-package-metadata branch from 9a4832e to 84c27eb Compare December 2, 2025 13:29

// === Constants ===

const EInvalidEnumVariant: u64 = 0;
Copy link
Member

Choose a reason for hiding this comment

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

Why not use the newer error syntax?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed in ac957d3. Now public functions return options.

MergeCoins(Argument, vector<Argument>),
Publish(vector<vector<u8>>, vector<ID>),
MakeMoveVec(Option<TypeName>, vector<Argument>),
Upgrade(vector<vector<u8>>, vector<ID>, ID, Argument),
Copy link
Member

Choose a reason for hiding this comment

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

Maybe add comments here to explain the fields

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In ac957d3 these now have dedicated structs.

}
}

// TODO: add a deserializer that can handle the Command::MoveCall and
Copy link
Member

Choose a reason for hiding this comment

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

what about this TODO?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently we have no need of a deserializer (we have no usage from Move->Rust but only from Rust->Move). In any case we plan dedicated structs for a new AuthContext version (see #9505) that will probably not need dedicated de/serializers.
Do you think I should I remove the todo?

Copy link
Member

@alexsporn alexsporn left a comment

Choose a reason for hiding this comment

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

lgtm 🚀

@miker83z miker83z linked an issue Dec 3, 2025 that may be closed by this pull request
@miker83z miker83z merged commit 35a7637 into vm-lang/aa-auth/8805-beta-feature-branch Dec 4, 2025
58 of 66 checks passed
@miker83z miker83z deleted the vm-lang/aa-auth/authenticator-and-package-metadata branch December 4, 2025 13:12
miker83z added a commit that referenced this pull request Dec 11, 2025
)

This PR introduces the creation of a Package Metadata immutable object
during a package publishing/upgrade. This allows to use such metadata to
create `AuthenticatorInfoV1` instances for accounts.

[Internal AA architecture
document](https://iotafoundation.atlassian.net/wiki/x/EoBOng).

Description:
- every time a function uses the `#[authenticator]` annotation, the
node’s publish/upgrade execution tries to create a `PackageMetadata`
immutable object.
- a new set of functions in the `iota-verifier` crate implement the
checking of the requirements for a package metadata to be valid; the
information for such validation is extracted from the package bytecode
(see #9453)
- `iota-verifier::verify_authenticate_func_v1` checks the correctness of
the declared authenticate() function (that was previously annotated with
- once the PackageMetadata immutable object is created, then the
framework method `create_auth_info_v1` can be used as the only way to
create an `AuthenticatorInfoV1` instance.
- the `AuthenticatorInfoV1` struct includes the fields to uniquely
identify a function on-chain: package id, module name, function name.
- An Account object is an object with a dynamic field being a
`AuthenticatorInfoV1`.
- Then, to any user-created object, an `AuthenticatorInfoV1` can be
“attached“. The only requirement is that the AuthenticatorInfoV1<T> is
compatible with T, where T is exactly the type of the object set to
become an Account.

- [x] Basic tests (linting, compilation, formatting, unit/integration
tests)
- [x] Patch-specific tests (correctness, functionality coverage)
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] I have checked that new and existing unit tests pass locally with
my changes

- [x] Protocol: Add the publish_package_metadata. This enables the
creation of an immutable object at publish/upgrade time when some known
attributes (e.g., the authenticator function attribute) are found in the
source code.
- [ ] Nodes (Validators and Full nodes):
- [ ] Indexer:
- [ ] JSON-RPC:
- [ ] GraphQL:
- [ ] CLI:
- [ ] Rust SDK:
- [ ] REST API:

---------

Co-authored-by: Valerii Reutov <valeriy.reutov@gmail.com>
Co-authored-by: Pavlo Botnar <pavlo.botnar@gmail.com>
miker83z added a commit that referenced this pull request Jan 19, 2026
)

This PR introduces the creation of a Package Metadata immutable object
during a package publishing/upgrade. This allows to use such metadata to
create `AuthenticatorInfoV1` instances for accounts.

[Internal AA architecture
document](https://iotafoundation.atlassian.net/wiki/x/EoBOng).

Description:
- every time a function uses the `#[authenticator]` annotation, the
node’s publish/upgrade execution tries to create a `PackageMetadata`
immutable object.
- a new set of functions in the `iota-verifier` crate implement the
checking of the requirements for a package metadata to be valid; the
information for such validation is extracted from the package bytecode
(see #9453)
- `iota-verifier::verify_authenticate_func_v1` checks the correctness of
the declared authenticate() function (that was previously annotated with
- once the PackageMetadata immutable object is created, then the
framework method `create_auth_info_v1` can be used as the only way to
create an `AuthenticatorInfoV1` instance.
- the `AuthenticatorInfoV1` struct includes the fields to uniquely
identify a function on-chain: package id, module name, function name.
- An Account object is an object with a dynamic field being a
`AuthenticatorInfoV1`.
- Then, to any user-created object, an `AuthenticatorInfoV1` can be
“attached“. The only requirement is that the AuthenticatorInfoV1<T> is
compatible with T, where T is exactly the type of the object set to
become an Account.

- [x] Basic tests (linting, compilation, formatting, unit/integration
tests)
- [x] Patch-specific tests (correctness, functionality coverage)
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] I have checked that new and existing unit tests pass locally with
my changes

- [x] Protocol: Add the publish_package_metadata. This enables the
creation of an immutable object at publish/upgrade time when some known
attributes (e.g., the authenticator function attribute) are found in the
source code.
- [ ] Nodes (Validators and Full nodes):
- [ ] Indexer:
- [ ] JSON-RPC:
- [ ] GraphQL:
- [ ] CLI:
- [ ] Rust SDK:
- [ ] REST API:

---------

Co-authored-by: Valerii Reutov <valeriy.reutov@gmail.com>
Co-authored-by: Pavlo Botnar <pavlo.botnar@gmail.com>
miker83z added a commit that referenced this pull request Jan 26, 2026
)

This PR introduces the creation of a Package Metadata immutable object
during a package publishing/upgrade. This allows to use such metadata to
create `AuthenticatorInfoV1` instances for accounts.

[Internal AA architecture
document](https://iotafoundation.atlassian.net/wiki/x/EoBOng).

Description:
- every time a function uses the `#[authenticator]` annotation, the
node’s publish/upgrade execution tries to create a `PackageMetadata`
immutable object.
- a new set of functions in the `iota-verifier` crate implement the
checking of the requirements for a package metadata to be valid; the
information for such validation is extracted from the package bytecode
(see #9453)
- `iota-verifier::verify_authenticate_func_v1` checks the correctness of
the declared authenticate() function (that was previously annotated with
- once the PackageMetadata immutable object is created, then the
framework method `create_auth_info_v1` can be used as the only way to
create an `AuthenticatorInfoV1` instance.
- the `AuthenticatorInfoV1` struct includes the fields to uniquely
identify a function on-chain: package id, module name, function name.
- An Account object is an object with a dynamic field being a
`AuthenticatorInfoV1`.
- Then, to any user-created object, an `AuthenticatorInfoV1` can be
“attached“. The only requirement is that the AuthenticatorInfoV1<T> is
compatible with T, where T is exactly the type of the object set to
become an Account.

- [x] Basic tests (linting, compilation, formatting, unit/integration
tests)
- [x] Patch-specific tests (correctness, functionality coverage)
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] I have checked that new and existing unit tests pass locally with
my changes

- [x] Protocol: Add the publish_package_metadata. This enables the
creation of an immutable object at publish/upgrade time when some known
attributes (e.g., the authenticator function attribute) are found in the
source code.
- [ ] Nodes (Validators and Full nodes):
- [ ] Indexer:
- [ ] JSON-RPC:
- [ ] GraphQL:
- [ ] CLI:
- [ ] Rust SDK:
- [ ] REST API:

---------

Co-authored-by: Valerii Reutov <valeriy.reutov@gmail.com>
Co-authored-by: Pavlo Botnar <pavlo.botnar@gmail.com>
miker83z added a commit that referenced this pull request Jan 27, 2026
# Description of change

Enables Account Abstraction core features at the protocol level.

[Internal AA architecture
document](https://iotafoundation.atlassian.net/wiki/x/EoBOng).

Main protocol changes:

- feat(move): Add custom attributes #9453
- added a generic FlavoredAttribute which can then allow us to define
new attributes within the iota_mode Move compiler part;
- allow the insertion of specific metadata in the serialized compiled
modules, i.e., bytecode (protocol feature flag
`metadata_in_module_bytes`).

- feat(execution): create a package metadata object at publish time
#9461
- every time a function uses the `#[authenticator]` annotation, the
node’s publish/upgrade execution tries to create a `PackageMetadata`
immutable object;
- a new set of functions in the `iota-verifier` crate implement the
checking of the requirements for a package metadata to be valid;
- once the PackageMetadata immutable object is created, then the
framework method `create_auth_function_ref_v1` can be used as the only
way to create an `AuthenticatorFunctionRefV1` instance.
- the `AuthenticatorFunctionRefV1` struct includes the fields to
uniquely identify a function on-chain: package id, module name, function
name.
- An Account object is an object with a dynamic field being a
`AuthenticatorFunctionRefV1`.

- feat: Add the MoveAuthenticator generic signature variant and enable
AA transactions #9492
- introduced a new iota type to represent a new `GenericSignature`
variant, that is the `MoveAuthenticator` type, and a execution path to
authenticate an Account being the sender of a TX.
- The `MoveAuthenticator` type has a unique field which is `call_args`;
this is a vector of `CallArg` working similarly to the
`ProgrammableTransactionBlock` inputs.
- The `MoveAuthenticator` is used to pass the inputs to the move call
indicated by the `AuthenticatorFunctionRefV1` found attached to the
Account object.
- This authentication job is performed by the Validator, which: (1)
loads `MoveAuthenticator` input objects at a specific version; (2) then,
executes the `authenticate()` function referenced by
`AuthenticatorFunctionRefV1`, having no effects to store to the ledger.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sc-platform Issues related to the Smart Contract Platform group. vm-language Issues related to the VM & Language Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Interface considerations for programmable_transaction.move

8 participants