You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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.
Flags
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
The text was updated successfully, but these errors were encountered: