What's Next for the L1: Part 2 Blossoms of Clean Code

March 11, 2023

In Part 2, we learn what it means to have an efficient and functional code. The benefits of clean code are explained.

In the last post, we discussed the importance of removing historical technical debt from our code base. The post went over how we are working to provide clean code to improve stability, and security, and to enhance the maintainability of our code base. This post will discuss what the outcomes of that work can provide.

It is critical to understand that the improvements made by refactoring the core Divi blockchain code base, opened up the creative pathway to invent Staking Vaults, combining some of the existing features of the blockchain with a dose of ingenuity. This technology, unique to Divi, solves some of the most frustrating aspects of crypto in general: the tendency for centralization and third-party custody to make things easier. Vaults are the best response to this force out there, by far.

By separating the user’s staking funds from the node that finds consensus in the network, users can keep their funds safe in a cold wallet (seed words, private key, or offline wallet file), ‘cold staking’, if you will. Meanwhile, a vault manager node performs the function of decentralizing the network and adding weight to the consensus finding. It has all the features of a hardware wallet but gives the advantages of a staking hot wallet without delegation or pooling.

This technology has further uses. We see it in our DeFi offering, where a smart contract “mints” wrapped $DIVI based on the funds in a vault. There will be other use cases for vaulting in Divi’s future.

The critical part is that vaults have all the advantages of masternodes without increasing the attack surface of the chain. Masternodes were meant to serve as a governance placeholder while the blockchain technology was better developed, but it has become clear that the kind of governance they were to facilitate is not fully compatible with the decentralization and security of the network. As such they have ended up doing nothing that a staking node doesn’t already do. Meanwhile, we can look to layer 2 methods to implement governance such as the upcoming Divi DAO, for which there is another blog post.

There are additional reasons to be enthusiastic about Vaults. We have a patent on them. So even if copied from our node source code (open source), the ability to launch them the way we do easily in the wallet (and soon desktop), would need to be licensed by other projects.

Finally, this immense amount of core code refactoring opens up new possibilities outside Vaults. On-chain subscriptions enable crypto-based recurring payments, gift cards, escrow services, and more. Encrypted transactions harden the network from censorship.

With sidechains, and particularly the version of them we intend to implement, we can begin funding projects that would like to implement experimental cryptography, or experimental features that might benefit the base chain all while happening within a contained environment, a crypto sandbox that gets the decentralized benefits of a blockchain, without endangering the security or stability of the main chain. In essence, Divi sidechains will allow our users to create dApps as they see fit, which won’t drag down the performance or security of our layer 1 chain. All those immutability-destroying ideas that people have for L1 chains (mentioned in the last blog post) can be implemented on sidechains!

Another thing we could do is have a RAM-based free market with regard to smart contracts so that everyone can run the chain but not bloat everybody else in the process. I.e., what you do in your sidechain is cleaved from what I am doing in mine. We can also have shielded on-chain NFTs, i.e. not publicly visible to anybody who didn't own it at some point. Privacy features can also be added to sidechains, and users can opt into these by entering these sidechains. Other ideas around sidechains include Corporate sidechains and truly decentralized order books based on encrypted commitment schemes.

To implement these more advanced technologies, we must remove some of the older technologies (i.e., masternodes) that have been the source of blockchain instabilities and consume blockchain resources that need to be available for these new features. These initiatives will produce the most rock-solid, secure, and decentralized Proof of Stake blockchain out there. All this while focusing on user self-custody of their funds, enabling developers to implement new and creative blockchain toolsets, and keeping the chain free from censorship and other human-imparted limitations.

So what does all of this mean to you… Our next article will cover this in detail and how it benefits you and the Divi community going forwards. Stay tuned for the next article landing on Monday 13th March.