Skip to main content

Boson Protocol contracts layer

The smart contract layer is the substrate of Boson Protocol. It consists of four main modules (offer, exchange, rNFT, dispute resolution) and several additional ones.

As a state machine, the protocol can be represented with the state of its data structures (about the protocol itself and the exchanges recorded within) and the transitions of these structures, initiated by various actors, as shown in the below diagram.

Transitions and States

It is implemented as a set of smart contracts, written in Solidity and based on the EIP-2535 diamond pattern which enables a single point-of-entry to the protocol’s multitude of functionalities, as well as upgradeability and other benefits.

Core exchange modules cover the main process, starting with the Offer module for creating offers that can be simple, such as one-item offers, or more complex, involving groups of things, physical-digital twinning, conditional offers etc. The exchange module handles the interactions of Sellers and Buyers related to their commitments and fulfillment of promises. The NFT module manages the vouchers as redeemable NFTs that exist intermittently to provide Buyers with features to transfer and trade the right to claim the offered thing. The dispute resolution module provides a path for Buyers and Sellers to either match their proposals or escalate it to the ultimate resolver.

Non-core exchange modules provide supporting functionalities to the protocol or provide additional features, of which some are optional and offer more complex use-cases.

Phygital module

This makes it possible to link a physical thing to its digital counterpart, thus making a “phygital” twin, and furthermore to bundle multiple items or twins within a single Offer. The phygital module allows the creation of an Offer for an off-chain asset along with a number of ERC-721, ERC-1155 and ERC-20 tokens. The organization of smart contracts makes these complex scenarios still easy to use.

Token-gated Offers module

This facilitates conditional offers that are available only to holders of specified token(s). This token gating provides restrictions (such as exclusivity) on the Buyers that are allowed to participate in such offers. The conditions can be set to fungible tokens (balance condition) and non-fungible tokens (ownership condition).

Accounts module

This provides the basic structure and functionality for managing account profiles of actors in Boson Protocol. Its purpose is to separate responsibilities within an organization. In particular, those are the operation, administration, and funds withdrawal activities.

Mutual resolution module

covers the on-chain part of the mutual resolution game that Sellers and Buyers are encouraged to partake in for negotiating disputes on their own. As such, it plays an important role in Boson Protocol. Its implementations rely heavily on game theory and it is the Seller that chooses the best suited template for a particular use case.

Dispute resolution mutualization module

This mainly provides support for handling the mutualizing fees for dispute resolution.

Funds management module

This manages the custody of funds and withdrawals of available balances. There are several accounts/buckets involved, though not all reside in-protocol. Per each exchange, the protocol encumbers all corresponding funds into the escrow when the Buyer commits to an offer. In case all the required funds can’t be pulled in, the transaction reverts. After the exchange process completes (i.e. reaches its final state), the funds are split according to the payoff algorithm and made available for parties to withdraw their balance.

For more detail, see the latest White Paper, and for code-level documentation, see the contract docs for more information.