Stafi Whitepaper(Draft)

Under Translation


PoS (Proof of Stake) world adopted Stake model as a safety feature, weighing its players by, not computing power as its PoW (Proof of Work) counterpart, but how many tokens they are staking—solving extravagant computing power arms race for the right to produce. On the strength of that, it was making its debut while claiming its superiority over PoW. Any PoS system is underpinned by the stakability of its token, as an approach to keep it democratic enough. It is, in a way, solving the centralization problem of computing power in PoW. This mechanism, however, puts “Stake” itself at stake. Whereas, relevant solutions are not perfect enough so far, some hurting the interests of token holders, some others depreciating the system as a whole. On the one end of PoS spectrum, almost all field tests of it are integrating incentives for a higher Stake ratio from a safety aspect. On the other end, they also are binding stake tokens to a lock period to prevent potential attacks from a bulky token staker. In the middle is a paradox between the safety of mainnet and the liquidity of tokens. That is to say, a system that locks all tokens staked is an extremely safe one, but its value growth is pushed to the brink due to zero token liquidity. Therefore, we are determined to create a decentralized bond protocol, in which staking behaviors are regulated by contracts and bonds of equal value to tokens staked are issued. In this way, Liquidity is guaranteed while tokens staked to the chain remain comparatively static to keep the system safe.


PoS was debuted in 2011 by QuantumMechanic on Bitcointalk Forum. The system creatively replaces computing power weight by token weight in Block Producer elections. Token holders can claim its run for BPs to the system by staking their tokens, while the system selects BPs through random algorithm. Those selected will be responsible for packing, verifying of transactions and prolonging the chain. As a late-comer to the game, PoS drew on the experience of PoW with regards to consensus, elections, packing, verification and so forth. As technology advances, PoS is steering the development of blockchain world in performance, capacity and sustainability. 2019 and the following year will be seeing, with excitement, the landing of second-generation PoS 1 consensus as projects like Cardano, Tezos, Cosmos, and Polkadot will soon launch the mainnet, making them the touchstone of PoS consensus in the new era.

Stake model in PoS overturned computing power weight, integrating the right of possession with that of mining. So that the token holders can participate in the system consensus just through staking. During the whole process, the token holders only have to run servers of certain standards or delegate to professional verifiers (After 2015, all mainstream PoS projects started integrating delegating mechanism to enhance the staking ratio of tokens, thus making the system safer). Moreover, random election solves the problem of squandering computing power brought about by mining competitions. At the same time, a new blockchain relationship is created—holders are miners, blowing a new wind to the public chain world.

Incentives, no matter when it comes to PoW or PoS, are integrated in order to encourage engagement in nodes operation. Right before the launch of a mainnet adopting PoS consensus, the system will strengthen the incentives to guarantee that enough tokens will be staked. Therefore, more coins that are initially distributed will be locked to step up systemic safety. As Arthur, the founder of Tezos, wrote in that project’s whitepaper: the preliminary incentives must be high enough. This is of paramount importance for a safe launch of mainnet. Stakers must bear certain time and opportunity costs (2). If the incentives fall short, the mainnet will bear grave safety threats. Another example, Cosmos wrote floating annual rate that is as high as 7%~20% to its codes to motivate staking while their mainnet was launching.

Lock period is an important feature that sets PoS apart from PoW consensus. In Stake model, the system has stability requirements for tokens staked, which is used to prevent long-range attacks: Nothing at stake. There is also a problem of computational fragmentation. The tokens that have been staked are locked by the system for a certain period(3). Although the token holders can initiate the unlock at any time, but the tokens will still be untradable during the unlocking period. That is to say, holders still can't dodge the risk of value fluctuations of the token at that phase. This is underlied by the contradiction between Token Stake security and token liquidity.

The paradox, to a large extent, causes problems in both ways. Many people are too afraid to stake, and the system will be in jeopardy as a result. This is a slippery slope, for a small nexus is seizes most reward fruits while the system still remains highly risky. For some PoS consensus projects that have already launched, the Stake rate is about 40%. As for those star projects, the number is generally around 50%~60%, up to 80%, less-known ones only about 20%. In theory, the most satisfying Stake rate, from a safety aspect, should be 100%, but this is often unrealistic. In addition, the 100% Stake rate means that the liquidity of the token is 0. For many projects with a vision of creating a blockchain OS (operating system), the liquidity of the token plays a significant role in underpinning the operation and value of the system. So, the impact of zero liquidity is almost entirely negative. At present, PoS world has not reached an agreement on a reasonable Stake rate. Or, maybe we should put it this way—it is impossible to reach an agreement because of testing a distributed network with a simulated environment is hardly possible.

Stafi provides a secured solution to address the conflict between the mainnet security and the token liquidity in the Stake model. The token holder obtains bonds of equivalent value to the tokens through Stake Contract. For example, if we stake XTZ, we will obtain XTZ_STAKE, a bond of value, which represents regular yields of tokens and the ownership of XTZ on the original chain. At the same time, XTZ_STAKE can be traded on the bond market that bases the Stafi agreement. Different to XTZ that is staked and locked on the original chain, tradable XTZ_STAKE has no lock period, but still keeps generating returns. As a result, holders of XTZ_STAKE no longer need to bear the risk of volatility and make timely judgments on market conditions. The Stafi agreement gives holders more rights. Due to financial motives, a holder will join the Stake contract for Staking for the risks no longer exist. This will serve as an adrenalin to Stake rate. Theoretically, projects that are decentralized enough will increase the Stake rate to over 90% (missing tokens not considered) while at the same time maintaining the liquidity over 90% with the help of Stafi agreement.

Existing Work—Unleashing Liquidity

The pre-existing ways of doing this are scarce, which can be categorized into decentralized and centralized ones.

A centralized token circulation model is often endorsed by a third party, which obtains the ownership of tokens by collecting them from holders, then conduct Stake in an intensive way. Tokens that are staked will be used to produce blocks through a node, thus being rewarded. When the third party reaps enough tokens, it will be well-positioned to issue a bond to its customers (for example, a standardized ERC20 token, namely, say, CENTRALIZED-STAKE). Then, it can also launch a trading pair with that issued token on one end, in collaboration with a centralized exchange; or even create a trading pair at any decentralized exchange. Holders of CENTRALIZED_STAKE can trade the ownership (also redemption right and income right) of the original token, without redeeming tokens on the primary chain. In this way, the liquidity of Stake tokens are, to some extent, boosted. There are side effects, though. This model is hardly possible without the trust of token holders in the endorsement of a third party and in the authenticity of its redemption and income right. Trust alone is insufficient still. Holders must take into consideration the third party’s capability of guaranteeing the trading depth of the trading pair with CENTRALIZED_STAKE. This capability is determined by various factors, of which an important one is third party’s deep pocket filled with Stake tokens. Small-scale third party is entitled to the right to issue the bond. If the power is wielded, however, few may respond. And this way of unleashing liquidity exists in name only. On the other hand, if massive CENTRALIZED_STAKE are minted by one single bulky third party, another risk may underlie—centralization, exposing that party to the attacks by hackers. Users’ assets may also bear grave loss. Similar attacks can be found in the history of attacks to centralized exchanges, which was happening frequently. Set security issues apart, this approach runs in oppositions to the very decentralized spirit in blockchain world.

Another centralized approach lies in the cooperation between a project party (Developers, or Devs) and a centralized exchange. Assets that are staked are endorsed by the project party for that exchange. Or, Devs may even delegate custody of locked Stake tokens to the exchange (provided that the ownership to the tokens that are staked is explicitly held by Devs when Stake was designed). Endorsed by Devs, the exchange can issue a token (for example, a standardized ERC20 token, namely, say, EXCHANGE_STAKE) and create multiple trading pairs derived from this token to ensure the liquidity of Stake tokens. Meanwhile, it supports all redemption actions for Stake tokens on the primary chain by EXCHANGE_STAKE. But the exchange cannot be bypassed. The problem is that Devs change the ownership relations of assets and misappropriate assets arbitrarily. When the ownership of tokens is handed by the exchange, problems like covert deals or embezzlement may happen. There are examples in the theft of exchange in the history. In a nutshell, the aforesaid two approaches are both completely deviated from the decentralized spirit of the blockchain.

The third approach is that Devs modify the underlying protocol in order to obtain Liquid Token after staking (which can be called PBLT, Project-Base Liquid Token). Users can trade PBLT without waiting for the unlocking time of the Staking Token, solving the security threat brought by frequent unstake and bringing convenience to users. The advantage of this solution lies in PBLT as an ABS asset endorsed by a system-level entity to guarantee security. And at the same time, the rights entitled to PBLT is recognized by the entire consensus. However, the problem is that most of the public chains that have been launched are still maintaining a relatively neutral attitude, for it may be difficult to directly modify the underlying layer, and the open community development process will be strained. For PoS Token holders, this is not an all-round solution. At present, only Cosmos and Near Protocol have put forward their own ideas. The holders of other assets cannot solve their locking problems like this.

Stafi agreement is meant to establish a Stake contract at the upper level, so that the holder can initiate a Stake through the designated Stake Contract, and at the same time obtain a XXX_STAKE (hereinafter abbreviated as XXX_S) bond. The holder of XXX_S can trade their possessions at the bond exchange built on the application layer. The holder's Stake process and the XXX_STAKE bond issuance process are both automatically executed by the contract code. There is no need for any third party endorsement, and the user holding the Stake token can initiate Stake or redeem at any time, the contract will be automatically executed once the verification is passed. Except for the absence of third-party intervention, the entire XXX_S distribution rights are given back to the original chain token holders. What’s more, holders can issue the value-bearing bonds of the corresponding value, which is similar to the current method of asset securitization. The biggest difference is that it is each and every individual, but not institutions, who issues bonds. The meaning of individual issuance is to resist volatility. Therefore, in theory, this decentralized method should better motivate the original chain holder to obtain XXX_S. To this end, the number of XXX_S securities on the market will also become sufficient to prop up a bond trading market. Meanwhile, this decentralized model will reversely stimulate the trading of bonds, thereby reducing the spot transactions. As a result, the great picture of mass issuance and trading of bonds will be finally realized.

Mass issuance of bonds is endorsed by Stake Assets, and Stake Assets is endorsed by the public chain/function behind its model. At present, the Stake model has not been abused, which guarantees the quality of Stake assets. Compared with the current asset securitization assets (ABS), Stake assets do not require the ABS credit enhancement, which greatly lowers the threshold for of issuing XXX_S. But the problem/risk of this kind of bond is that the regular income of this Stake asset is highly dependent on Token. Although the holder can continue to earn income through Stake, this income expectation to legal currency is still fluctuating, which causes inconsistent expectations of XXX_S trading in the trading market. Leverage may fill the market in great numbers, which brings more opportunities and possibilities to the creation of decentralized bond trading on Stafi. When a large number of PoS consensus projects are launched on the main network from 2019 to 2020, the Stake assets will proliferate and the transactions will become more frequent. When the holder of the currency is also the debtor, tokens that are staked will serve as the collateral. And the redemption right will be shift as the collateral is traded. These relations are all stipulated by smart contracts, not by centralized companies or institutions, and this stands Stafi, a decentralized agreement, out among its centralized counterparts.

Stafi Protocol

Stafi is a decentralized bond agreement that encompasses 3 layers—bottom, contract and application layers. The bottom layer is mainly based on a blockchain system established by Substrate (which is a blockchain architecture developed by Parity, and the whole architecture integrates many development modules, including consensus module, P2P module, Staking module, etc.). The contract layer support creating a variety of Stake contracts, such as Stake contracts for XTZ, Atom and Dot respectively. The token holder can Stake through Stake contract, which is consistent with the inflation incentives obtained by the ordinary Stake. But the difference is that The holder also can obtain a bond XXX_S (such as XTZ_S). Last, the application layer supports third-party Stafi-based APIs or customized APIs to create a decentralized bond trading market for XXX_S assets to circulate, transfer, and trade on the Stafi agreement.

The protocol runs in a purely decentralized manner. Stafi, which is built on Substrate, will be connected to Polkadot as a parallel chain, sharing the underlying consensus of Polkadot. The main security and performance are also guaranteed by Polkadot. The core layer is the contract level, and the ownership of the Stake token is fully guaranteed by the contract code. Stafi uses a distributed key storage protocol to ensure the security of the Stake address through multi-signatures. The holder can initiate Stake or redeem the Stake anytime and anywhere without the need for third party intervention. When the holder of the coin initiates the Stake token to the Stake contract, the system's inflation incentives can be obtained at the appropriate time. Meanwhile, any holder of the XXX_S holder can initiate a redemption operation to the corresponding Stake contract anytime, anywhere (The redemption operation interacts with the original chain through the Stafi protocol. After the redeeming transaction is written to the chain, Stake coins will be sent to the submitted coin account after unlocked.) The Stafi agreement guarantees that each and every XXX_STAKE exclusively correspond to the token on the original chain. That is to say, only the holder of the XXX_S can initiate the redemption of the original token to the Stake contract. When A trades the bond XXX_STAKE to B, A no longer has the redemption right of XXX, and B now can initiate redemption to the Stake contract. The whole process does not require third party intervention.

Any third party can establish a decentralized bond exchange using the Stafi protocol to at the application layer. All bond exchanges share the depth of the transaction. The exchange also supports the creation of various types of services around XXX_STAKE assets, such as securitization, credit enhancement, collateral and insurance, etc. Developers can use open interfaces to create appropriate rates or bond products. There’s more. they can even move services in traditional asset securitization to the upper level of Stafi to improve the reliability of XXX_S asset transactions. With the increasing number of public chains adopting PoS launching their mainnets, the number and variety of Stake's tokens will rocket. And trading of such assets will become more frequent. As a result, developers will be hugely rewarded, in the form of transaction fee, from bond transactions they initiated.


1. Stake Contract

The contract that creates the interaction with the Stake original chain at the Stafi contract level is called Stake Contract. For example, to create a XTZ-Stake contract for connecting Tezos with Stafi. When user A holding XTZ initiates a Stake operation on XTZ-Stake, the Stake Contract will first create a multi-signature address, and he will transfer XTZ through the Tezos original chain to that address.When the transfer succeeds, the contract will execute the Stake operation of the multi-sign address. Then, the Stafi protocol will receive a proof of the Tezos original chain (Proof), and then trigger the contract to generate a bond of equal quantities to XTZ, namely XTZ_STAKE(n), abbreviated as XTZ_S(n). If user A stakes 100 XTZ, the bond is represented as XTZ_S (100). XTZ_S(n) is a Token issued on the Stafi Agreement. Because of the different amount of XTZ that are staked, each Stake bond stands a unique value.

The update of the Stake Contract requires the original chain and the Stafi protocol to work together, for the contract status of each chain needs to be monitored, the implementation of the Stake contract shares many similarities with the cross-chain mechanism. When the holder initiates a Stake request at the Stake Contract, the generation of the multi-sign account occurs on the Stafi protocol. At the same time, the transfer of the personal asset to the multi-sign address is completed by the Stake user’s signature. This transfer occurs on the original chain. When the Contract captures the transfer information, a Stake request is initiated from the multi-sign address to the original chain. After the Stake operation is completed on the original chain, Stafi captures the Stake state of the address on the original chain and verifies it,and the corresponding XTZ_STAKE(n) asset is issued on the Stafi protocol immediately after the validation succeeds. Throughout the process, the Stafi protocol interacts with the original chain multiple times. The monitoring and capturing of the state plays an important role in the security of the entire protocol. The Stafi protocol captures the original state by time delay and multi-pass validation to ensure the final authenticity of the original chain. Fortunately, better than pre-existing inter-chain protocols and PoW consensus, most PoS projects launched after later 2015 see the final authenticity of block transactions as a demand that must be met. That is, when the latest height is formed, the transactions included are deterministic. At present, the common solution for the final authenticity or timely deterministic implementation is to verify the legality of the transaction before packaging the transaction to a new height. This implementation relies on the Byzantine fault-tolerant(BFT) algorithm and some artificially specified fork penalty mechanism, Slash. In view of this, the Stafi protocol has greatly improved security when interacting with the original PoS consensus chain.

2. Multi-signature Adresses

At present, almost all Stake models rely on the Account model—when the user initiates Stake, they need a private key of the original chain address to sign. In order to ensure the exclusive correspondence between the ownership of the Stake asset and XXX_STAKE(n), Stafi designed an intermediate address model. The ownership of assets in that address does not belong to anyone, meaning that no one can own the private key of this address. Stafi guarantees asset neutrality of intermediate addresses through secure multi-party computing technology and threshold multi-signing technology, ensuring that signatures are only performed when the holder of the XXX_STAKE(n) initiates a redemption. Secure multi-party computing involves privacy, which requires a group of certifiers with special functions in Stafi to participate. A certain number of certifiers are signed by their own private keys and transmitted through a secure channel to verify the validity of the signature, and, finally, realize the restoration of intermediate address signature. This intermediate address does not have a private key, nor is stored on the Stafi protocol. It is formed by the signature of the private certificate of the special authenticator only when the signature is required. The implementation of threshold multi-signing technology realizes that part, not all, of generators can generate the private key signature, which can greatly satisfy the need for the signature. For example, a multi-sign address establishes contact through a public key of multiple validators (say 21). When a person holding XXX_STAKE(n) needs to initiate a redemption, only 16 signatures of 21 verifying servers are required to verify Staking and Unstaking for Stake Assets.

3. Secure Multi-Party Computation

Secure multi-party computation mainly focuses on how to safely calculate a predefined function without the existence of untrusted third parties, addressing a problematic reality that a result reliant on multi-party data calculation where those parties are not willing to share the original data. With secure multi-party computation, the final result can be verified without revealing the initial input value to another third party. In Stafi's Stake contract, the user who stakes must generate a new multi-signal address. When the holder of the XXX_STAKE(n) initiates a redemption to the Stake Contract, the multi-signature address needs to create a private key signature with the involvement of special validators during calculation and generation. The validators transmit the calculation results through the encrypted channel, and they can mutually verify the results without the need to reveal their own private key. It is secured way of unlocking and redeeming the Stake Contract.

4. Ownership Conversion

When the Stake operation is completed, the redemption right of XTZ on the multi-sign address is in the hands of the holder of XTZ_S(n). Only the holder of XTZ_S(n) has the right to redeem the XTZ-Stake contract, other holders entitled no redemption rights. If user A trades XTZ_S(n) to user B, then user A loses the redemption right to the original chain XTZ, and the mapping relationship between the XTZ and the user A address of the multi-signed address in the contract is also given to that with B. User B can initiate redemption according to his or her own wishes, or trade XTZ_S(n) assets to other people. In this process, the multi-sign address completes multiple rounds of ownership of the original chain XTZ through the signature of special validators on Stafi who are different to that in Polkadot world—it does not requires block-producing consensus. The requirements come in only when generating the address and the changes of ownership.When user A trades the XTZ_S(n) asset to user B, special validators need to conduct the signature and complete the conversion of the original Stake XTZ.

5. Special-Validator (SV)

Different from the consensus validator, the special validator is the witness of the asset ownership in the Stafi Stake contract. When the eligible holder initiates redemption to the contract, the special validator will participate in the calculation and complete the transfer of the asset from the multi-sign address to the personal address by signing. When no redemption operation occurs, the special validator stores its own private key locally, waiting to be called. A special validator is composed of multiple people picked randomly. Before the multi-signature address is formed, Stafi will select N certifiers from the certifier group through a random algorithm. N certifiers will be chosen by Stafi randomly to perform the calculation locally and transmit the results through a secret channel. After validation, the participation rights are obtained and stored locally on the servers respectively. The entire process is automated by the system.

At the same time, each special certifier will be required to run the light node of the projects supported by Stake Contract, in order to verify the original chain trading status. This program is written to the entire special validator client and the validation is performed automatically.

6. Special-Validator Group

In order to ensure the smoothness of the redemption channel, special certifiers in Stafi perform tasks in groups with a fixed shift. During their own shift, a single certifier group completes the multi-signal address generation and storage of the secret key, and after the execution cycle is completed, replaced by another new group. This ensures the engagement of the current verifier. One term of validators lasts an Epoch (an Epoch cycle is about 1 natural day). The election for the next group is done in the previous Epoch. Stafi randomly selects new N special certifiers from candidates to organize a group. The new special certifiers replace the old through secret channel verification. And the new certifiers will replace the old certifiers’ private key with their own private keys. Meanwhile, the system will destroy the relationship established with the old certifiers’ private key. However, frequent turnover will affect computational efficiency. When Stafi officially launches, it will select a reasonable replacement cycle balancing safety and efficiency.

7. System of Encouragements and Penalities for Special-Validators

Due to the importance of special verifiers, Stafi has established a system of encouragements and penalties for them, stimulating positive behaviors such as calculations and storage, and punishing negative behaviors such as disconnections and non-timely replacements. Stipulated by Stafi protocol, participation in the generation of addresses, computing, and signatures will be rewarded Stafi's token--SFI incentives. On the other hand, Stafi's penalties for security issues are severe. Stafi will require all certifiers involved in computing and storage to maintain designated online time. If the certifier is frequently dropped out, it will be slashed. If the dropping time is longer than N hours, the certifier will be Jailed and will not be able to participate in any computing and storage of the special certifier group for a period of time. In addition, the system will severely punish attacks that attempt to recover private keys and steal other people's assets based on provable data on the chain.

8. Staking Mechanism for Special-Validators

Anyone holding Stafi tokens can apply to become a special certifier of Stafi. A special certifier needs to stake SFI Token. The smuggled SFI Token is proportional to the amount of Stake that can be accepted, that is, the more SFIs that are staked, the greater the value of Stake asset calculation and storage. This can effectively increase the cost of joint malicious behaviors conducted by special certifiers. The SFI that are staked will be motivated by the system, and at the same time, is also the pool of funds for system punishment. Due to the speciality of Stafi system, the requirements for the special verifier are strict, and the nodes in the early days after launch will be opened gradually to engage validators.

9. Stake Contract Safety

The asset security of the Stake contract is guaranteed in many ways. First, the asset neutrality, the overall Stake asset is stored in a multi-sign address address, and the asset change of the multi-sign address is guaranteed by the N special certifier through the threshold multi-signal sharing technology. Safe, not subject to any single third party control. Second, the multi-signature address uses the asset mechanism. The special verifier is selected by the Stafi random algorithm. The verifiers do not know each other, the possibility of collusion becomes small, and the asset protection will be dynamically replaced within a certain period to ensure security. . The third is punitive. When the certifier participates in the private key signature calculation and storage, it needs to mortgage a certain SFI to participate. In the event of an attack or illegal behavior, the mortgaged SFI will be Slash, the value of the mortgage and can be processed. The value of the assets is directly proportional. When a variety of conditions are combined, the Stafi system can effectively punish certain risk factors. Under the assumption that most people are honest, the assets of the Stake contract can guarantee certain security.

10. Decentralization of Stake Contract Assets

When a holder initiates Stake from the Stake contract, the entire Stake asset will be concentrated in one contract. Although each Stake is initiated by a single address, it will not affect the degree of decentralization, but when the Stake assets are too concentrated, they are more easily attacked. Stafi avoids the concentration of assets by establishing multiple Token Stake contracts of the same kind. The total amount of the contract will automatically increase according to the amount of Stake assets, and the new assets will enter the new Stake contract. At the same time, Stafi will establish multiple Stake contracts at the initial start-up. The Stafi system will automatically distribute the initial Stake demand evenly among these Stake contracts, which will serve as a buffer. Later, as the demand of Stake increases, the number of contracts will gradually be increased and differentiated by variables. At the same time, Stafi is a decentralized open agreement. The Stake Contracts developed by initial developers will be audited and open sourced for third parties, which can create their own Stake Contracts to achieve the decentralization of Stake assets.

11. Open APIs

Openness is very important for decentralized protocols. Stafi protocol provides multiple types of architecture/interfaces for developers. Including customized interface for using Stake Contract assets, the underlying interface of self-established Stake Contract, the customizable underlying interface of the entity/virtual ABS assets, the on-chain matching interface for ABS assets, etc. These rich RPCs provide the greatest freedom for developers to use the Stafi protocol assets and develop/issue new assets on the Stafi protocol.

Stay tuned for following Stafi developer documentations on the usage of APIs.

Token Economy

As a decentralized bond protocol, Stafi supports the asset-backed securitization of tokens, and their circulation and transaction. Different to traditional ABS assets, computing resources are required during the process. Practitioners deploy contracts on Stafi protocol in a decentralized and automatic manner to realize the freedom of security issuance. SFI is the Native Token in Stafi world that coordinates the operation of the protocol as a value medium of circulation. It is used during the issuance circulation and transaction of securities without the trust from a third party. SFI is designed to act as the following roles:

1. Staking

A number of special validators need to guarantee the ownership of the contract assets. In order to motivate the validator to participate, and also to prevent the validators from doing evil, the validator needs to stake SFI to obtain the participation opportunity, and after actually completing the corresponding calculation and storage, get the system's SFI reward. SFI that are staked will be locked and unlocked only when a new group of special validators has replaced the old one. At the same time, in order to secure the contract assets, the system stipulates that the number of SFI that are staked is proportional to the number of Stake assets that can be processed, which means that the more SFI staked, the more Stake contract assets that can be processed, and the more SFI can be obtained as a reward. If the dishonest behaviors of the special validator is detected, the system will perform Slash on Stake's SFI. The Slash ratio varies case by case. For example, Stafi has stricter online time requirements for the validator, and if the drop time is longer than 2 hours, the validator will be jailed and lose all rewards on a natural day. If you drop more than 1 natural day, you will be slashed by 5% of Staking SFI. In severe cases, such as trying to recover property that is not owned by yourself, all Staking SFI will be Slashed. So Staking's design is an important feature in the Stafi system to ensure contract asset security.

2. Stake Contract Deployment & Storage

The Stafi protocol supports the deployment of Stake contracts, and will also be the deployment platform for future securitization of ABS assets. A new Stake contract deployment requires a certain SFI to execute. Consistent with Ethereum's GAS consumption model, the SFI required for execution is calculated by the following model:

Fee=Gas x GasPrice

Gas is equal to 10^-9SFI, and the initial parameters are set by Stafi system, GasPrice is customized by the deployer, and final Fee is priced by SFI. If the paid SFI is higher than the resources required for system operation, then the system will return the excess SFI when the operation is completed. Otherwise, the system will stop running when there is no SFI to pay.

3. Stake Contract Calling

The Stafi protocol will open interfaces for third parties. Contract calls will consume system computing resources. In order to limit malicious low-cost attacks, and to meet a certain degree of commercial calls, the caller needs to reach a certain high frequency, and part of computing resources need to be born by callers. Of course, the business caller can customize the payer, either the platform user or the platform itself.

The overall Fee model is priced in SFI. The system calculates the computing resources and storage resources that the node pays when calling, and compares the SFI paid by the caller, then determines the final execution.

4. Transaction Fee

The Stake contract created on Stafi obtains the XXX_STAKE(n) circulating on the Stafi protocol through Stake on the original chain, and the XXX_STAKE(n) that circulates in Stafi protocol requires SFI to be paid in order to obtain computing power. The validators pack the transaction and uploads it to the latest block. after the block height is updated, XXX_STAKE(n) transaction is completed. The amount of SFI to be paid is related to the size of the transaction data that needs to be run. The fee model for common transactions is as follows:

Fee=Gas x GasPrice

Gas is equal to 10^-9SFI, and the initial parameters are set by Stafi system, GasPrice is customized by the deployer, and final Fee is priced by SFI. If the paid SFI is higher than the resources required for system operation, then the system will return the excess SFI when the operation is completed. Otherwise, the system will stop running when there is no SFI to pay.

The aforementioned Fee will go into a Pool maintained by the system to reimburse running Parachain on Polkadot and reward special validators.


At current stage, it is must to enhance to improve the liquidity of Stake assets. With more PoS public chains launch in 2019~2020, the cryptocurrency world will welcome a sea of Stake assets. It is estimated that in the 2~3 years to come, the market value of Stake assets will reach 100 billion level, when many assets will be locked due to safety matters. The liquidity value will diminish, too. Stafi protocol starts from the ABS of Stake assets and aims at creating a decentralized ABS asset issuance protocol. At the primary stage, it will focus on providing Stake assets without the trust endorsement from a third party. Meanwhile, it will issue ABS products of Stake assets in a cross-chain manner, thus addressing the contradiction between the liquidity and safety of Stake assets. Not matter when it comes to XTZ, ATOM or DOT, DFN that will appear in the future, they will issue XXX_STAKE(n) assets on Stafi protocol as an enhancement to token liquidity. Stafi provides a plaform of trading and circulation for projects that demand an even higher liquidity.

The aforesaid platform is highly programmable, supporting the customization of various APIs. The underlying structure is designed for the ABS products of Stake assets, enabling a simple and fast collaboration among several public chains meanwhile issuing relevant assets. Developers can create Stake contracts on Stafi by their own demand, or using pre-existing contract API to build a circulation platform for Stake assets.

The vision of Stafi is to create a underlying blockchain architecture for ABS assets that supports the customization of ABS assets using Stafi protocol. This process cuts all red-tapes of verification, realizing genuinely the freedom of issuance and trade of decentralized securities. On the dark side of that freedom, however, is risks of, say, implicit investment returns. In traditional financial field, those risks are diluted through endorsement of trust enhancement institutions or insurance companies, which are not comply with the decentralized spirit and may incur the problems from centralized endorsement. Nowadays, with the rapid development of decentralized finance, we believe, in the future, there will be more decentralized finance entities that are address problems like that. They may be decentralized insurance or trust enhancement entities.These decentralized products, together with Stafi, will better endorse ABS assets. The development course of Stafi will not derail from decentralization in any time of the future.

Work in Future

There are many challenges on the way of issuing a decentralized asset securities product. These challenges are unknown, but deducing from the reality of the ABS assets, they must face many levels of approval and credit enhancement to ensure quality. It is time-consuming and labor-intensive. However, Stafi realized the automatic issuance of ABS assets, and reduced the third-party participation in the middle. But the development of blockchain finance is still in its early days, the decentralization of ABS assets “endorsement” was far from meeting the requirements. In this blank time, investors who want to participate must have a mature mind. In the future, in order to allow more assets to be distributed through Stafi and to allow more investors to be engaged, Stafi sets out to be an ABS issuance and trading agreement that can protect investors in a decentralized manner. To this end, there are following work to be done by Stafi.

On-chain Governance

Stafi is a decentralized agreement, and its upgrade direction is closely related to governance. For many PoS consensus projects, one of the most important government approach is to set Token Staking as a voting method. The implementation may vary by different projects adopting different Staking approaches, such as stimulating the participation of voting through incentives, or providing a reference for voting by predicting the market, or even avoiding the convergence of voting result by delegation system. Stafi believes that there are a lot of voting problems in reality. Participation and voting results are widely criticized. Providing more reference and incentives can effectively solve the voting problem. However, a perfect solution does not exist in current voting mechanisms. Most of the solutions are indirect, combined with blockchain optimization. This leads to new problems. Therefore, voting is alway a tricky issue. Although the combination of blockchain boosts efficiency, but this has not addressed some fundamental issues. Stafi will implement basic voting logic in the initial stage, then upgrade to on-chain governance logic, and put the solution of the voting problem in the long-term optimization plan.

Private-key Maintenance Methods

At present, the private key signature of the multi-signature address is through the threshold multi-signing algorithm with the participation of multiple special validators. The validator’s private key is stored on the validator's local server (after encryption), but the asset custody and validator's existence is not permanent, so the two parties may not always reach an agreement in reality, which will endanger the storage security of assets. At present, Stafi guarantees the randomness and timeliness of private key storage through regular rotation, but frequent replacement of validators is a waste of computing resources, so the frequency needs to maintain a reasonable level. At present, the best frequency is not determined, and part of the future work will focus on striking a balance between frequency and safety.

Similarly, threshold multi-signing technology still requires trust in random verifiers. Stafi is researching new algorithms that can be used to reduce trust in order to promote protocol security upgrades. At present, the research direction of privacy computing such as MPC, TEE, etc. has potential cooperative opportunities with the security model required on Stafi. The privacy computing technology is also developing rapidly. The projects of engineered application have sprung out. Therefore, we will keep exploring in this way in the future work of the contract layer.

Distributed Smart Contracts

When the holder initiates Staking through Stake contract, their tokens will be locked by the original chain. The security mechanism of the original chain guarantees the security of the token staked. However, due to the existence of the cross-chain bond, XXX_STAKE(n), the mapping relationship of the asset multi-sign account will be saved in the Stake contract. When more tokens on the original chain are staked, the contract is more likely to be attacked. Although the mapping relationship is not a decisive factor in the redemption of the original chain assets, the attack would jeopardize the system. Stafi attempts to create a distribution system that will generate the Stake contract based on the value of the Stake asset. A threshold value will be set for each Stake contract. The Staking from this contract will stop when the threshold is exceeded, a new contract, instead, will be created. Dynamic setting solves the problem of asset centralization and reduces the risk of large assets being attacked.

The Safety of Assets on the Original Chain

The issuance of ABS tokens relies on the proof from the original chain—ABS tokens will be minted and sent to the corresponding users when the Staking is done on the original chain. The Stafi protocol guarantees an exclusive correspondence between the ABS tokens and assets on the original chain, therefore ensuring the redemption. But if there is a problem with the Staking module on the original chain, the ABS token's value will depreciate accordingly. For example, if a user stakes 10 XTZs, a corresponding XTZ_S (10) will be given to him. When the XTZ is made to the value of 5 XTZ values, the ABS Token will reduce correspondingly, becoming XTZ_S (5). Dynamic monitoring involves frequent interactions between Stafi and the original chain, which complicates the entire protocol. Therefore, maintaining reasonable monitoring and interaction frequency will be a focus for Stafi protocol in the days to come.

The Risk Management of Bond Issue

The risks of decentralized investment are all borne by individual investors, which requires a more mature mind for participating investors. A large number of investment failures may hinder the opportunities for new investors to participate, so we see in reality many investment products are endorsed by large institutions or systems. When Stafi protocol introduces ABS assets, it saves many centralized endorsements and audits. Although it improves efficiency, it also brings new investment risks. In order to reduce risk assessment decisions, Stafi will create a new set of systems that operate in a decentralized mode, such as decentralized insurance, decentralized credit, decentralized risk control, etc., to help investors complete their investments.


(1) The author divides the development of the PoS consensus into two stages. The first stage is 2011~2015 with the advent of the first generation PoS consensus such as Peercoin and Nxt. The second stage is 2016~present. The second generation PoS consensus was developed on the basis of the first generation PoS consensus, such as Tezos, Cardano, Cosmos, Polkadot, etc.

(2) Staker needs to carry out Staking to participate in the PoS network consensus. In this process, the tokens participating in Staking will be locked into the system and cannot be circulated/transacted. The holder cannot respond to market changes in a timely manner. Chances of gaining a profit may be lost.

(3) The PoS consensus has computational complexity. If the weight of the Staking representative is dynamically changed during the election, the calculation will become complicated and the consensus performance will be reduced. Therefore, the Staking weight will be time-locked in a short period. It is a result taking into consideration many aspects such as performance, safety and so forth.