A smart asset is an entity which models a digital or real world item and is embedded into the blockchain. If we take the example of a game asset such as a sword we can model its attributes and behaviour in code which when invoked will execute the code and apply the logic.
Smart assets are defined in code and expose a set of external API's that can be invoked by the caller. Both the data that is created by the smart asset and the companion code is stored immutably in the blockchain within versioned transactions. When the code for the smart asset needs to mutate any of the associated data it creates transactions with the updated data and the latest version number. The fast transaction system is essential to make this possible.
Smart assets can do these things:
- mutate data associated with the asset
- invoke other assets
- call out externally via HTTP
Smart assets are limited to interacting with their own associated data but can also invoke other smart assets. They can define any properties they require and optionally expose these properties for a caller to consume. They can also create any functions required to mutate or apply logic to the associated data and can expose a set of functions that a caller can invoke.
Continuing with our example of the sword - imagine it has 3 properties:
- health
- attack power
- defence
We could expose a function that decreases the health of the sword based on specific circumstances and we can also apply validation rules to this logic. The requirements could be described as follows:
Given my sword is at full health When I strike my opponents shield causing damage And my sword receives damage from the shield Then my swords health should be reduced
In addition the following validations:
- If the sword health drops below 0 then it is destroyed
- The sword health should never increase above 10
These rules and behaviours can be defined within the smart asset and the interaction between sword and shield can be modelled and autonomously executed. In this case the sword's health will be reduced when it interacts with the shield in this way. In addition the shield asset can be coded to respond to the interaction with the sword.
This is just a very simple example. But imagine a whole set of smart assets that can interact with each other autonomously based on various criteria. Smart assets can also reach out to external services over HTTP calls to further increase their interoperability with events outside the confines of the blockchain.
A smart asset may not perform any transfer of tokens on behalf of a wallet address. (to be decided - since having some form of autonomous token transfer could be beneficial for some cases)
https://ethereum.stackexchange.com/questions/20781/at-which-point-the-smart-contracts-get-executed
to be decided
perhaps the smart asset can be coded to define how it is executed. Either on API call or via the receipt of a transaction.
Smart asset execution is charged to the callers wallet in milliseconds. The actual fee still to be decided. Possibly we will have a fee structure based on some criteria as well.