Home

Awesome

EOSIO Assert Contract

The EOSIO Assert Contract is a security feature to reduce the need for users to trust blockchain apps when a user signs a transaction for a trusted blockchain network with a trusted wallet application. It is a solution aiming to:

EOSIO Labs

About EOSIO Labs

EOSIO Labs repositories are experimental. Developers in the community are encouraged to use EOSIO Labs repositories as the basis for code and concepts to incorporate into their applications. Community members are also welcome to contribute and further develop these repositories. Since these repositories are not supported by Block.one, we may not provide responses to issue reports, pull requests, updates to functionality, or other requests from the community, and we encourage the community to take responsibility for these.

Feature Overview

Assert will be a system contract within the EOSIO software.

Actors

End-User

The End User is the person who is interacting with a Blockchain Application, and uses a Trusted Wallet Application to sign blockchain transactions when needed.

Blockchain Application

The Blockchain Application is the interface that an End User uses to perform some task that will be represented as a blockchain transaction, requiring a signature from an End User, facilitated by a Trusted Wallet Application.

Some Blockchain Applications may appear to be trustworthy, but have malicious intent. Some examples of malicious intent include: a) attempting to trick a user into divulging their private keys, and b) attempting to deceive a user into signing a transaction that does not represent the user’s intended interaction.

Trusted Wallet Application

The Trusted Wallet Application is where a user stores their private keys, and the interface through which they securely use those private keys to sign blockchain transactions proposed by Blockchain Applications. It is trusted by implication that it is aware of the End User’s private keys. A Trusted Wallet Application should implement measures to protect the End User from potentially malicious Blockchain Applications.

Trusted Blockchain Network

The Trusted Blockchain Network is where smart contract code representing the execution of the signed transactions run to produce an agreed upon global state so that users can cooperate through the use of Blockchain Applications. It is the most trusted component because it is often public and decentralized, and because it represents the ultimate source of truth. So the Trusted Blockchain Network is the best place to perform final checks of validity that what is claimed by a Trusted Wallet Application to have been agreed upon by the End User, is accurate and valid in comparison to the current state of the chain.

Flows

The sequence diagrams in this section describe how and in what order different actors work together when performing actions regarding the Assert Contract.

eosio.assert::set.chain

<img src=".images/setchain.png" alt="Set Chain" width="1400">

Block Producers set chain info for Trusted Blockchain Network

eosio.assert::add.manifest

<img src=".images/addmanifest.png" alt="Add Manifest" width="1400">

Blockchain App publishes manifest to the chain

eosio.assert::del.manifest

<img src=".images/delmanifest.png" alt="Del Manifest" width="1400"> Blockchain App removes a manifest from the chain

eosio.assert::require

<img src=".images/require.png" alt="require" width="1400">

Functional Specifications

Each function of the EOSIO Assert Contract will be explained in detail in this section, including the actor, requirement, parameters and results.

eosio.assert::setchain

Allows Block Producers to set chain metadata, so that a Trusted Wallet Application can display chain information to an End User, and ensure that the validity of the information will be validated by the Trusted Blockchain Network by enforcing the inclusion of a valid eosio.assert::require action in every transaction for which it signs a transaction with the private keys of an End User.

ItemDescription
Contract nameeosio.assert
Action namesetchain
Pre-conditionsRequires eosio authorization

Parameters

Result

eosio.assert::add.manifest

Allows a Blockchain Application to publish an app manifest to the Trusted Blockchain Network. The manifest allows a Trusted Wallet Application to ensure that: 1) the metadata claimed by a Blockchain Application matches that of a manifest previously registered by the Blockchain Application, 2) the actions included in a transaction proposed by a Blockchain Application are whitelisted in a manifest previously registered by the Blockchain Application.

ItemDescription
Contract nameeosio.assert
Action nameadd.manifest
Pre-conditionsAction must be authorized by the account which owns the app. The added manifest doesn’t already exist.

Parameters

Result

eosio.assert::del.manifest

Allows a Blockchain Application to remove a previously published app manifest from the Trusted Blockchain Network.

ItemDescription
Contract nameeosio.assert
Action namedel.manifest
Pre-conditionsAction must be authorized by the account which owns the app. The manifest to be deleted exists.

Parameters

Result

eosio.assert::require

When added to a transaction, ‘require’ action performs multiple security checks. If any of the checks fails, the transactions fails.

ItemDescription
Contract nameeosio.assert
Action namerequire
Pre-conditions

Parameters

Result

Contributing

Contributing Guide

Code of Conduct

License

MIT

Important

See LICENSE for copyright and license terms. Block.one makes its contribution on a voluntary basis as a member of the EOSIO community and is not responsible for ensuring the overall performance of the software or any related applications. We make no representation, warranty, guarantee or undertaking in respect of the software or any related documentation, whether expressed or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall we be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or documentation or the use or other dealings in the software or documentation. Any test results or performance figures are indicative and will not reflect performance under all conditions. Any reference to any third party or third-party product, service or other resource is not an endorsement or recommendation by Block.one. We are not responsible, and disclaim any and all responsibility and liability, for your use of or reliance on any of these resources. Third-party resources may be updated, changed or terminated at any time, so the information here may be out of date or inaccurate. Any person using or offering this software in connection with providing software, goods or services to third parties shall advise such third parties of these license terms, disclaimers and exclusions of liability. Block.one, EOSIO, EOSIO Labs, EOS, the heptahedron and associated logos are trademarks of Block.one.

Wallets and related components are complex software that require the highest levels of security. If incorrectly built or used, they may compromise users’ private keys and digital assets. Wallet applications and related components should undergo thorough security evaluations before being used. Only experienced developers should work with this software.