To enable the token searchable and matchable by other parties..is is essential to differentiate header and body just like html did, include metadata in header, attribute and action in body ?
This bit of code in the example section of TokenScript demonstrates it:
The part to look starts at line 110, which explains how token data is extracted. For example, for the token that is a FIFA ticket, the "locality" value of that token, which translates to City (at line 112), is originated from the token-id, which has value 1 representing Mosco and value 2 representing San Petersburgo.
The example demonstrated how to get attributes from token-id, but there are other ways to get attributes. Look at this example:
Observe line 81:
<ts:attribute-type id="locality" syntax="18.104.22.168.4.1.1422.214.171.124.15">`
Its also a locality attribute, but this time its origin is a pure smart contract function call, at line 83. Meaning the function provides the value, not the token-id.
A list of possible token data origins:
- Pure Smart Contract call
- Oracles (including web-oracles)
- User input
An engine that searches and matches token might want to look at all data origins except the last, which is the only data origin used solely for user interface generation.
More on that in the document written by Boon:
What project are you doing? I'm eager to learn about it and provide relevant information.