Skip to content

Conversation

@TheMrAI
Copy link
Contributor

@TheMrAI TheMrAI commented Sep 19, 2025

Description of change

Implement "Time locked account" example for abstract accounts.
This example explores the possibility of utilizing the authentication logic.

Each authenticator type can have a number of "reserved" dynamic fields and provide basic functions for attaching, detaching, rotating, checking and borrowing that type.
Properly using these functions is the responsibility of the implementer, but given the language restrictions this is a very flexible pattern.

Links to any relevant issues

fixes #8534

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

@vercel
Copy link

vercel bot commented Sep 19, 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 Oct 13, 2025 1:28pm
apps-ui-kit Ignored Ignored Preview Oct 13, 2025 1:28pm
iota-evm-bridge Ignored Ignored Preview Oct 13, 2025 1:28pm
iota-multisig-toolkit Ignored Ignored Preview Oct 13, 2025 1:28pm
rebased-explorer Ignored Ignored Preview Oct 13, 2025 1:28pm
wallet-dashboard Ignored Ignored Preview Oct 13, 2025 1:28pm

@iota-ci iota-ci added sc-platform Issues related to the Smart Contract Platform group. vm-language Issues related to the VM & Language Team labels Sep 19, 2025
@TheMrAI TheMrAI self-assigned this Sep 19, 2025
@TheMrAI TheMrAI force-pushed the vm-lang/aa-auth/8534-time-locked-account-example branch 4 times, most recently from 4675a96 to ca3aa5c Compare September 23, 2025 13:06
@TheMrAI TheMrAI marked this pull request as ready for review September 23, 2025 13:24
Copy link
Contributor

@valeriyr valeriyr left a comment

Choose a reason for hiding this comment

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

I personally would prefer to create a dedicated PR for account_template, because it is an independent feature from the time_locked example.

@valeriyr
Copy link
Contributor

@TheMrAI I see that the account_template file contains IOTAccount implementation. Are you going to refactor the original IOTAccount? I think it would be better to refactor it and not add a new file.

@TheMrAI TheMrAI marked this pull request as draft September 30, 2025 13:05
@miker83z miker83z linked an issue Oct 2, 2025 that may be closed by this pull request
@TheMrAI TheMrAI force-pushed the vm-lang/aa-auth/8534-time-locked-account-example branch from 73999ed to 7020334 Compare October 8, 2025 13:36
@TheMrAI TheMrAI force-pushed the vm-lang/aa-auth/8534-time-locked-account-example branch from 58d3a8a to d6190de Compare October 9, 2025 15:41
@TheMrAI TheMrAI requested review from Dkwcs and valeriyr October 9, 2025 15:46
@TheMrAI TheMrAI marked this pull request as ready for review October 9, 2025 15:48
@TheMrAI TheMrAI requested a review from a team as a code owner October 9, 2025 15:48
@TheMrAI TheMrAI removed the request for review from a team October 9, 2025 15:48
borrow_uid remains until restructuring
The utility functions for building an account fulfill a completely
different purpose from an actual account implementation.
For this reason it makes sense to separate them as it makes it very
clear what functionality may be problematic from a design perspective
as well.
It muddies the interface, especially in terms of access control.
Utility functions aren't concerned with access control, but all
account functions should ensure that all access is correct.
While in this case it doesn't change much, in more granular access
controls it might become important if a clean pattern is established.
We named the module according to the name of the dynamic field struct.
This is necessary to avoid name collisions within the testing framework
while trying to compose multiple packages.
package_A::name
package_B::name
package_C including both will collide, no matter if an alias or
fully qualified names are used. In package_C one cannot override
the address of pakcage_A or package_B either, so there is no
convenient way to resolve collision.
These tests as the module are partial code duplications, but we don't want to
refactor IOTAccount every time some new pattern should emerge.
With this following refactor only has to remove the relevant code and tests
from IOTAccount and transition to using these functions.
Copy link
Contributor

@valeriyr valeriyr left a comment

Choose a reason for hiding this comment

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

I left a few comments, but overall it looks good to me!

Copy link
Contributor

@miker83z miker83z left a comment

Choose a reason for hiding this comment

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

LGTM!

@TheMrAI TheMrAI merged commit 4c61aa5 into vm-lang/aa-auth/8116-feature-branch Oct 14, 2025
33 of 35 checks passed
@TheMrAI TheMrAI deleted the vm-lang/aa-auth/8534-time-locked-account-example branch October 14, 2025 07:26
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.

Implement "Time locked account" using account abstraction

6 participants