Intro to DeFiChain Concepts
The basic concepts
The basic concepts
How does DeFiChain keep track of everyone's DFI balances and make sure that no one is trying to use their DFI twice (known as double-spending)? In the real world, if we give someone a 1 USD bill, we will no longer be in control of that bill. But in cryptocurrency, we must have a different way to guarantee that someone cannot keep using the same "1 USD bill" over and over again.
DeFiChain uses the UTXO model to account for everyone's balance and prevents double-spending. UTXO is short for Unspent Transaction (TX) Output. It sounds very complicated, but it can be explained simply with real world analogies.
The best example of UTXO would be cash. When you create your wallet, you have no cash, but as you earn money your wallet gets fuller with more bills. When you spend using cash and coins, you can only send money using the cash and coins that you have. You cannot give someone a $3 bill for a $3 product, you have to spend a $2 bill and a $1 bill. So, in the UTXO model, your wallet balance is the total amount of coins you have received in a transaction minus the amount of coins you have spent. All of these records are downloaded by people all around the world, so that a person cannot simply create fake records, it has to be accepted by everyone else. In this way, we prevent people from trying to spend their money more than once.
As explained above, in order to prevent malicious actors from creating their own databases and writing transactions while remaining decentralized, DeFiChain encourages and incentivizes certain users to help with the processes. Already, every device that runs the desktop wallet of DeFiChain syncs the entire blockchain and saves it. This way there are tens or hundreds of thousands of the same copy of all of the transactions and unspent DFI.
Now, in order to actually be able to process transactions (add new records), you cannot simply create a wallet and sync the blockchain, you must have to "risk" some of your DFI. Currently, a user needs to have 20,000 DFI that can be risked in order to be able to process transactions. This way, if a malicious actor tries to create new blocks and process transactions at their discretion, they will lose their 20,000 DFI, deterring them. However, as long as you do not maliciously attempt to manipulate the blockchain (which cannot be done accidentally), you will not lose your 20,000 DFI. In other words, you may "risk" your DFI but if you are not a bad actor, there is no way you can lose your DFI. This "risking" is why we call this process "staking," because you are putting your DFI at stake, which discourages you from acting maliciously.
Once you stake 20,000 DFI, you and other investors who are also staking will randomly take turns to process transactions in chunks called blocks. When it's your turn to create the next block, you will get to write the next chunk of data, moving DFI across the network.
For your work, you receive a block reward which comes from new coins being minted. You also earn transaction fees paid by users in the transaction.
It's important to note that every 32,690 blocks, which is approximately 11 days and 8 hours, the amount of new coins minted decreases by 1.658%, meaning your staking rewards are constantly decreasing. This reduction comes as a result of maintaining DFI supply below the 1.2 billion cap. It isn’t possible to mint a consistent amount of DFI forever.
DeFiChain, which mainly bases itself on the system of UTXO DFI (the ones that act like cash), also has what is known as token DFI (which act more like a digital asset).
Token DFI, like UTXO DFI, can be sent in units of 0.00000001 (a fi, if you'd like to know). They are used to avoid paying transaction fees. Sometimes, the system requires many (thousands or more) transactions of small amounts of DFI in a block, and using UTXO DFI would create a massive backup and make transaction fees much more expensive than they are now. It's important to note that the two forms of DFI can be changed to one another, so you can change token DFI to UTXO DFI and vice versa, for a small transaction fee. Both token DFI and UTXO DFI count towards the maximum supply, so don't worry about them ever adding up higher than 1.2 billion.
Another difference of token DFI is that you cannot send it to another user's wallet, it can only be sent and received for special purposes. Only UTXO DFI can be sent to other users.
It is very easy to convert between UTXO DFI and token DFI, most wallets do it automatically when you need to convert.
How does it work?
Imagine Ruben has 100 UTXO DFI. He wants to convert it into token DFI to invest it, so he writes a transaction to masternodes, "I want 100 token DFI, give it to me and make this 100 UTXO DFI spent like I sent it to somebody." Ruben trades his token DFI but didn't make any profit or loss, but now he wants to send it to his friend as a birthday gift. So now he writes another transaction to tell the nodes, "I gave my 100 UTXO DFI for the token DFI, take my 100 token DFI and give me back my 100 UTXO DFI."
In short, conversions are like conversations with the ecosystem, making and taking away UTXO or token based on what a user wants.
This system also prevents users from trying to mint free DFI, because if the nodes find a user tries to request back more token DFI than they had exchanged from UTXO DFI, and they have not made a profit to get the DFI, everyone can see the false attempted transaction and the transaction will be blocked and become invalid.
That's it for this tutorial! If you want to read the next one, check it out: DeFiChain Decentralized Exchange