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

identify trigger as an account? #4670

Open
s8sato opened this issue May 30, 2024 · 1 comment
Open

identify trigger as an account? #4670

s8sato opened this issue May 30, 2024 · 1 comment
Labels
question Further information is requested

Comments

@s8sato
Copy link
Contributor

s8sato commented May 30, 2024

I guess trigger will be able to be identified as an account.

I don't think it has been broken down into issues yet.
If we want to support use cases where a trigger needs different permission than the registrant account (e.g. swap between two accounts, #1212), the trigger should reference its own account (or should be identified as an account).
The ideas of system level triggers and technical accounts were suggested in as early as Triggers ADR.
Similar concepts include Contract Address and Program Derived Addresses

Originally posted by @s8sato in #4668 (comment)

In this way, trigger has authority different from the registrant and can manage transactions involving multiple authorities. Use cases such as locking assets could also be implemented by the trigger taking the assets

@s8sato
Copy link
Contributor Author

s8sato commented May 30, 2024

One of the possible paths is as follows:

  1. as of f12077d

    struct AccountId {
        domain_id: DomainId,
        signatory: PublicKey,
    }
  2. shallow objects [refactor]: Shallow objects in data_model #3921 should allow AccountId to be independent of DomainId

    struct AccountId(PublicKey);
  3. multisig accounts Reimplement multi-signature #4373 should require AccountId to be like enum

    enum AccountId {
        Personal(PublicKey),
        Shared(RawId),
    }
    
    type RawId = Box<[u8; 32]>;
  4. add a variant for triggers

    enum AccountId {
        Personal(PublicKey),
        Shared(RawId),
        Trigger(RawId),
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants