Discussions

Ask a Question
Back to All

Hook Chaining

Me and Denis Angell are particularly confused about the Hooks Chaining feature, maybe Richard could elaborate this feature to us?

I'm wondering what the documentation means by 'remote account', is this related to the positioning of attached Hooks on the Sending and Receiving account? I'm not confident about the Sending/Receiving account being related to this feature, since on the #0 Chain position, it describes to us that the Hook on the host account is executed and no particular Receiving account is mentioned as well.

[Most Likely Answer Below]
Or is the Hook Chaining feature allowing us to position Hooks on our account by priority?
Let's say I have 2 Hooks on my account, a Carbon Hook (sends a sum to a specified account) & a Firewall Hook (checks a list...), I want the Firewall Hook to be executed first before the Carbon Hook. So I specify the Firewall Hook @ Chain Position #-3 and the Carbon Hook @ Chain Position #-2 in this particular scenario.

If my guess is right, then Hooks Chaining is really valuable to the amendment :) .

Mindless recommendation: Rather then only allowing users to input a Hook's position by priority(#), what about XRP / IOUs amount?
E.g:
If payment >= 1,000,000 XRP: #1: Carbon -> #2: Firewall
If payment >= 1,000 XRP: #1: Firewall -> #2: Carbon
^ Ignore the logic for now, I'm guessing it'll fail if the account is listed on a blacklist as it'll just rollback.

Related doc: https://xrpl-hooks.readme.io/docs/execution-order#hook-chaining-future-feature