What Is CICO
CICO is a cryptocurrency that is forked from qtum and it uses both ethereum’s smart contract functionality and bitcoin’s[BTC] security to create a coin that is suitable for adoption by large organizations and businesses.
Cico is now PoS based and boasts a Decentralized Governance Protocol (DGP) allowing specific blockchain settings to be modified by making use of cico smart contracts. For instance, the block size of CICO just like qtum can be increased without the need of a hard fork
|Staking Methods||Offline & Online|
CICO and UTXO
To gain a layman’s understanding of how UTXOs work, think of how basic cash transactions work. Suppose your friend owes you $6. She reaches out to her purse and takes out a $5 and $1 note, and pays you back with it. Now, if you owe someone $8, you take out the $5 and $1 that your friend had earlier paid to you and $2 that someone else had earlier paid to you. That’s pretty much how transactions work in Bitcoin. The outputs of a previous transaction become the inputs of a future transaction. So, keep this in mind, and let’s look at how Bitcoin transactions work.
Suppose Alice needs to send some Bitcoins to Bob. To do this transaction, Alice’s wallet will make the outputs of her previous transactions the input of the new transaction. So, suppose Alice needs to pull bitcoins from the following transactions which we shall name TX(0), TX(1) and TX(2). These three transactions will be added together and that will give you the input transaction which we shall call TX(Input).
The output basically will have the number of bitcoins that Bob will possess post transaction and any remaining change that is left over, which is then sent back to Alice. This change then becomes her input value for a future transaction. Now, this is a straightforward transaction that has just one output (apart from the CHANGE), some transactions are possible with multiple outputs.
So, why did CICO adopt the UTXO model? There are two main reasons:
- Firstly, to use a mature, stable and secure transaction model that is widely understood from the Bitcoin blockchain.
- Secondly, the UTXO model helped in the implementation of Simple Payment Verification (SPV). SPV will allow a light node to interact with smart contracts and verify transactions. Light nodes are nodes that only download a part of the blockchain instead of the complete blockchain. CICO and EVM
As mentioned above, Ethereum ushered in the era of smart contracts. Smart contracts are self-executing and automated agreements between two or more parties, which doesn’t require any legal intermediaries. That sounds pretty amazing, right? However, where exactly do you execute these contracts? Smart contracts can be executed in one of the two following systems:
Virtual Machines: Ethereum uses this.
Docker: Fabric uses this.
Let’s compare these two and determine which makes for a better ecosystem. For simplicity’s sake, we are going to compare Ethereum (Virtual Machine) to Fabric (Docker). So, Virtual Machines provide a better deterministic, terminable, and isolated environment for smart contracts. EVM integrates a gas mechanism to prevent infinite loops and spam (execution terminates when the contract call runs out of gas). Want to know more about gas? Click here.
Connecting UTXO and EVM
Since UTXOs and EVM are wildly different concepts, how did CICO manage to connect them in their platform? Via the addition of the Account Abstract Layer (AAL). AAL acts as an interface layer between the UTXO and EVM. The beauty of the AAL is that its not confined to just EVM. Any virtual machine that is compatible with the AAL can execute on top of AAL. So, before we venture further into AAL, let’s understand what abstraction means. Abstraction means that anyone can use any system or protocol without completely knowing the ins and outs and all the technical details. Eg. When you use your iPhone, you don’t need to be a programmer or an engineer to operate it. You simply press on the screen to activate an app, or press on the call button to call someone. You don’t need to know how pressing certain apps activates the circuit inside the phone or how certain apps were programmed. Abstraction makes a sophisticated technology accessible to the masses by hiding the complexities. For smart contract platforms and dApps, abstraction is pretty much the holy grail. If mass adoption really is the goal, then dApps need to run similar to a normal application. Similarly, CICO should integrate EVM and UTXO in a way that it is straightforward for users and developers to interact with it. So, to gain a better understanding of how AAL works, let’s see how a simple Bitcoin transaction works at the code level. During a transaction, your wallet will execute the following opcodes on your machine. This basically instructs the software to check if the public key of the transaction matches the signature or not:
The “Script” column has a bunch of keywords that are called opcodes. Bitcoin transactions are scripted by the combination of these opcodes. The AAL adds three more opcodes to the original Bitcoin list to enable smart contract support.
OP_CREATE: Used to create new smart contracts.
OP_CALL: Used to execute code inside an existing smart contract.
OP_SPEND: Used to spend the value in a smart contract.
So, how do these opcodes process? Let’s take a look.
The validator’s software parses the script in the CICO transactions.
When they come across one of these three opcodes, they set them aside to be processed by EVMs. The EVM contract transactions are then processed into a special “Expected Contract Transaction List,” which is executed by validator nodes. These transactions are then run against the EVM, with the resulting output being converted into a spendable CICO tx. If, during the execution of a contract, the contract calls another contract with a value, that transaction is also turned into an explicit CICO tx and attached to the current block. The size of the CICO UTXO can be managed fairly well since the OP_CREATE, OP_CALL, and OP_SPEND transactions are all spendable. When a contract self-destructs, the OP_CREATE transaction is spent, which removes it from the UTXO pool. If you are a solidity developer, then it will be pretty straightforward for you to start coding on CICO since it already leverages the EVM. If you are interested, then we recommend you to get started on their comprehensive developer’s guide. However, as mentioned before, EVM is not the only virtual machine available on CICO for smart contract execution. The CICO team is developing an x86 smart contracts virtual machine for CICO. This x86 VM will allow developers the flexibility to code smart contracts in popular programming languages like Rust and others.
CICO and Proof of Stake (POS)
As mentioned multiple times already, CICO uses a POS consensus model. Many of the modern blockchains have opted for a POS model because of the advantages it has over the classic POW model. POW or proof of work was the consensus model introduced by Bitcoin, wherein specialized nodes called miners solve cryptographically hard puzzles by using ASICs.
The problems with proof of work.
Proof of work is an extremely inefficient process because of the sheer amount of power and energy that it eats up. People and organizations that can afford faster and more powerful ASICs usually have a better chance of mining than the others. This means that Bitcoin mining isn’t as decentralized as we want it to be. Since POW mining eats up real-world resources, it is highly detrimental to the environment. Proof-of-stake, on the other hand, makes the mining process completely virtual. Let’s give you a brief overview of how POS works:
The validators/miners lock up some of their coins as stake.
After that, they will start validating the blocks. Meaning, when they discover a block that they think can be added to the chain, they will validate it by staking one or more UTXOs for 500 confirmations.. If the block gets appended, then the validators will get a block reward, where the frequency of block rewards is proportionate to the amount staked by that validator. Different projects use different variations of the POS algorithm. Ethereum will be using the Casper protocol, while Algorand uses pure POS. Then there are projects like EOS that use delegated POS
CICO uses POS version 3 or POSv3, which is built for UTXO-based blockchains.