0057 XLS-57d: Hook Identification with hooks.toml #163
Replies: 2 comments 1 reply
-
Wonderful idea. Love the Hook Hash » Creator account » Domain field » TOML location idea :) Some thoughts about fields to incorporate in the spec. right from the start (?) Per Hook:
|
Beta Was this translation helpful? Give feedback.
-
A link between a hook binary and its source code is very helpful for verification. Thank you for this idea! To verify whether a hook binary matches a specific source code, it's not mandatory to know the identity of the entity publishing a hook (rAddress). With privacy and minimizing public data footprint in mind, we should not link to a specific entity as default. I'd suggest to use specific release/version urls as examples for "source". A given hook binary is only binary equal with one specific state of a given source code. |
Beta Was this translation helpful? Give feedback.
-
Hook identification
Abstract
Identification of hooks, its origin, and author can be done using
hooks.toml
file.There is need for easy and standardized way for Hook Author to Identify their own hooks for numerous reasons such as public trust, source-to-hook verification, access for auditors, etc.
Hooks in compiled state can be looked up on the Ledger by its HASH. Its WASM, originating rAddress and usage can be extracted. Beyond that - original source code, hook motivation and any outside references are not obtainable.
If hook is open-sourced (advised) Hook's source code can be re-compiled and detected if the same hook HASH comes from that source. Hook source code is can be shared via GitHub project or Gist link, although can be other web URL.
TOML Web location
Hook TOML web URL will be composable by looking up Hook by its HASH on Ledger, then finding out hook creator rAddress. From that rAddress get Domain (acme.com) from account settings and compose hooks.toml path:
https://acme.com/.well-known/hooks.toml
Note on Hook’s author: As hook definition can be created then destroyed (when last account uninstalls it) then again created, that might result in different author of same hook at later point in time. TOML contains
account
field to verify this ownership relation.TOML hosting rules
Serving TOML file should follow standard practices as described here
See: Protocol, Content-Type, CORS…
hooks.toml sample
Fields description
[[HOOKS]]
block needs to have minimally following fieldshook
,account
,network_id
,title
,descr
, andsource
.Additional optional fields are:
related_hooks
,icon
hook
This is hook hash.
related_hooks (omittable)
Array. A list of hook hashes that are related to subject Hook. Good place to link other versions of same Hook. Hook processors[1] can read this field and render list of links to those related hooks.
network_id
This is network ID author of this hook claims it created and maintains hook on specified network.
List of networks is:
account
rAccount which created this a hook (first installed - this means HookDefinition was created) must match with state on ledger.
Paired with network_id this is second part of hook ownership verification. If rAddress on ledger which created HookDefinition matches one in TOML then this hook ownership is verified.
This is mandatory to prevent 'hijacking' ownership claim of the hook along with account field.
title
This is short title of a hook no more than 50 characters is recommended. (text only)
descr
Long description of a hook, leave empty (
""
) if not applicable.. (text only)source
Source link to hook source, leave empty (
""
) if you do not wan't to share source but it is ADVISED you to do so.abi
Location to the ABI Specification. (TBA)
icon (omittable)
This is URL to image, a valid square icon file, recommended 512x512px of size. WEBP recommended, accepted: PNG, GIF, JP(E)G,SVG. Developer needs to host this image for availability.
Additional notes
This setup allows differenting hooks by network, and creator account, in sample above first two HOOKS blocks reference to same hook, but indicates different networks (mainnet and testnet) which have two different rAccounts, "ACME Corp." maintains.
Annotations
[1] Hook processor - a website or app which displays hook information by consuming this TOML file (web explorers etc...)
Changes
Beta Was this translation helpful? Give feedback.
All reactions