8000 Idea: Install Hook on a new account with the SetHook transaction · Issue #425 · Xahau/xahaud · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
< 8000 div class="position-relative header-wrapper js-header-wrapper "> Skip to content
Idea: Install Hook on a new account with the SetHook transaction #425
Open
@tequdev

Description

@tequdev

Summary

Instead of installing a Hook on the sender's account with a SetHook transaction, create a new account within the transaction and install a Hook on that account.

Motivation

When creating a so-called smart contract-type hook at present, we need to generate a key pair in an off-ledger, and activate the account and then send a SetHook transaction from that account.

By doing all of this in an on-ledger, it is possible to eliminate those off-ledger tasks.

Solution

If the corresponding flag is On, the SetHook transaction will create a new account within the process and install the Hook specified in sfHooks.

In addition, within SetHook, transaction sender must send account reserve and object reserve.

Sign-able account

To ensure access to the new account, set the regular key or signer list under the following conditions.

The account to be created will have the master key disabled.

  • If the transaction is signed with the master key, the account will be set as a regular key
  • If it is signed with a regular key, the account will be set as a regular key
  • If it is signed with a multi-sig, the signer list will be created with the same list.

Flags

  • Add two flags to the SetHook transaction.
    • A flag indicating that you have created a new account and installed Hook.
    • A flag indicating that the transaction is multisig-signed.
      • (Necessary to know that one object reserve is required for SignerList object when calculating the BaseFee in advance.)

Notes

Because created accounts only have reserves amount of XAH, we cannot create a new HookState in Hooks until we have made a separate deposit.

Paths Not Taken

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureFeature Request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0