A customer connects their cryptowallet to Yellow.org, deposits funds from the wallet (this means that the state channel gets opened and funds get locked on its smart contract, while the user receives corresponding wrapped tokens on the platform). And the user performs trades completely off-chain, within the state channel.
A withdrawal goes the opposite way: The user requests the withdrawal, if it complies with the smart contract (state channel) conditions, the asset amount gets updated on-chain (in the wallet), while the equal amount of wrapped tokens get burned.
State channel smart contracts are a set of standardized logic that allows opening standardized state channels between counterparties on different blockchains. The first iteration of the Yellow project will support opening channels only on the single blockchain.
The logical unit of state channels is payment. Payments can be combined to create more complex business logic (i.e. trading, games, etc.) Using such architecture can help to keep smart contracts simple while moving the heavy logic inside state channels programs.
State channel has the next lifecycle:
- initialization (on-chain) — record initial states
- operating (off-chain) — send transactions
- closing (on-chain) — writing the final state to the blockchain
State channels are created using Nitro protocol. The protocol describes the opening and closing of state channels completely off-chain. It allows instant finality state channels and partial withdrawals for users.
To significantly reduce errors, help with financial reporting, and prevent fraud, we added double-entry bookkeeping to the smart contract execution.
In addition to the state channel contract, we will have a default staking contract that will be used for staking project tokens on different blockchains. The staked amount will represent the project commitment of a specific Finex node. Regular users will be able to join staking by delegating their project token to a specific Finex node.
In the later phases the project can become self-governed with the use of the native token. Each token holder will be able to vote for project proposals. Accounts that are holding more than a specific amount of native tokens will be able to create a project proposal.
During the initial phases of the project, we will support a limited number of blockchains. But to diversify assets that are traded on the network, Finex nodes will be able to use wrapped tokens of popular coins from other blockchains. The system will have an official list with tokens' smart contracts. Market pairs with validated tokens will have a special sign.