Interoperability
Last updated
Was this helpful?
Last updated
Was this helpful?
In Yours Protocol tokens are interoperable because there is an agreed upon schema of how metadata looks like for a token, see for reference.
The receiving blockchain will receive the metadata for the imported token and can choose to react on it or not by extending the function yours.after_apply_transfer
in its modules.
This means that you can add additional logic and utility to a token by creating a new module and attaching it to the token, see for reference.
Modules are also designed to be shared and re-usable. If Blockchain A creates a module called equippables
. Then Blockchain B can import that module and re-use the exact same utility on its blockchain.
The way it works is that the equippables module would extend yours.after_apply_transfer
and populate its own entities if the token supports its module. For examples, see:
Yours Protocol will always persist the metadata, so that metadata that was incoming can be transmitted to other blockchains as outgoing, even if the dapp persisted the metadata on its side or not.
For example, Blockchain A might have attached an additional module to the token that Blockchain B doesn't care about. The metadata associated with that additional module would then be persisted by Yours Protocol behind the scenes on Blockchain B.
MegaYours will provide a TypeScript client which helps you do the above in a simple function call.