Divi Staking Vaults
The Divi Project has been working relentlessly to bring crypto out of the byzantine think tanks and technology elite and into the world for everyone. While other projects keep promising this, only Divi is really doing it. They started with being the first to allow crypto holders to truly launch a masternode with one click and no expertise. Then they brought Divi to WhatsApp. A world class wallet that anyone can use without complicated addresses or eldritch incantations to recover your funds is going to be released imminently. Part of this wallet will include staking vaults, that will enable you to get all the benefits of staking in the Divi ecosystem, without actually using your device to do it. What are staking vaults exactly? How do they work? How can I implement one without the mobile app? That’s what we are here for today!
Staking vaults at a high level
The basic idea for a staking vault is that everyone with Divi funds should be able to participate in staking, even if they have a poor internet connection or perhaps, don’t have a computer. More importantly, you may have a computer that can stake, but do not want to leave it on all the time or want to use it for something else, while a friend of yourshappens to have a computer they can dedicate to staking. This entire article is focused on the bare bones command line interface (CLI) wallet. If you are using the mobile app or desktop GUI version, you have a treat in store for you and this article just lets you know whats going on in the background.
The answer? Delegate your funds to a staking vault! You get the income, you don’t lose control of your coins, and someone else stakes them for you. Let’s say we have two Divi holders, Alice and Bob. Bob has some Divi, but really can’t stake. He wants to stake because of the good income and the chance for winning the lottery, but he has poor internet service that goes down all the time. Alice has plentiful bandwidth, and wants to offer her wallet to let people stake on her equipment. Maybe Bob will buy Alice a beer for helping him out, but frankly, aside from setup, there is no extra work that Alice needs to do to keep staking Bob’s vault.
So, each person has their wallet, likely with funds associated to a few different addresses within. There are three steps that need to happen:
- Alice needs to send an address of hers to Bob.
- Bob needs to fund a vault.
- Alice hosts Bob’s vault.
Before we continue, it should be clearly understood that working with staking vaults at the daemon level is not “Crypto made easy”. There are pitfalls, complexities, and messaging that doesn’t happen that wouldn’t happen with a good GUI (Graphical User Interface). This article is informational and implementation is really only for people who are comfortable with linux and working with the wallet at the CLI level. This article assumes the wallet owner of either side knows how to unlock their wallet and does so when needed.
Hosting a vault
A vault manager can stake her own funds while hosting a vault for other people’s funds. In this case, perhaps Alice creates a new address:
./divi-cli getnewaddress ""
Which returns the new address shown at the top of the wallet (none of the addresses in this article are real or even functional). She sends this address to Bob.
It’s SUPER IMPORTANT that Bob understands that he is NOT to send funds to this address. He must fund it properly.
Delegating funds to a vault
Bob is totally jazzed that Alice will help him out. So he does a getbalance command, and sees that he has 30,400 Divi available to him. He wants to keep a little around for fees and tips, but he wants to fund a vault with 30K Divi. So he unlocks his wallet and simply types:
./divi-cli fundvault [owner_address:]manager_address amount
or, for his specific situation
./divi-cli fundvault DGHJT6432FGhyhGHJghf 30000
This command will compile his wallet such the 30K worth of funds gets combined and plopped into a new address. This will also create a transactions hash, which Alice will need. By running this command, Bob’s wallet has assigned 30K Divi to Alice’s vault address that she gave him. As a response he gets two important bits of information:
That vault is a special kind of address and wont show up in normal wallet informational commands. What is shown there is <Bob’s Address : Alice’s Address>, which Alice needs later to set up the vault on her side. Bob will also want to keep the owner address (the one that starts with DBK…) because he will use this address to see his funds on a block explorer. If Bob wants to see how his wallet is laid out with regard to his vaults, he can issue a getcoinavailability command, which will show him this information:
The 30K Divi that was in 4 addresses earlier are now in one single UTXO (a single bundle of Divi for the less technically inclined) at the new address. It will stake and split down according to the stakesplitthreshold of Alice’s wallet. So Bob’s wallet now looks like this:
Accepting the funding for the vault
Now it is Alice’s turn. She must acknowledge and accept Bob’s vault for her to stake for him. She doesn’t want just anyone assigning her funds for staking. So, she adds the vault with the following command, completing the process.
And now Alice can see the status of her vault, also with the getcoinavailability command:
If Alice turns on the “verbose” feature of that command (by adding keyword true after the command) she can get far more information, such as other vaults, and the funding addresses of each vaults well as her funds that are not in vaults. Alice’s wallet will look exactly the same as the first image of her wallet. The vault address will still show 0 balance!
At this point, Alice is staking 30K of Bob’s funds for him. Well, assuming she turns on her staking for her wallet!
Taking down vaults
What if Alice and Bob get in a fight because he never bought her the beer he promised? What if Bob wants to buy a car and needs his Divi? Both vault managers and vault funders need to be able to end the funder-vaulter relationship. This is very simple.
Bob dismantles the vault from his side
Bob can get his funds back by issuing the following command:
./divi-cli reclaimvaultfunds destination amount
so for Bob,
./divi-cli reclaimvaultfunds Dfhfty6w345eHJ6hrRfbdb4b 30000
Note: right now it will simply defund all vaults Bob has created regardless of the amount he puts there. If he has 2 vaults, each with 10K and he reclaims 15K, both vaults with come down. If he reclaims 5 Divi, only one vault will come down.
The destination address is where he wants the funds to appear. He can choose one he already has, or generate a new one for that.
It’s important to acknowledge that Alice doesn’t have to do anything. Bob doesn’t need to inform her, or get permission from her. That’s because Alice was never in control of his funds. She was simply cold staking it for him. If she checks coin availability she will see that the vault has been removed.
Alice dismantles the vault from her side
If Alice wants to stop staking for Bob because she didn’t get paid, she doesn’t like his cologne, or she just thinks Bob is a twerp now, she totally can. It’s her node, she can do what she wants, as she wants. She is under no obligation to warn, inform or ask Bob for permission to take down the vault she is staking for Bob.
./divi-cli removevault <owner_address>:<manager_address>
./divi-cli removevault DBkApjavviqxTFN4wLprVzBM3XJSifVdtA:DGHJT6432FGhyhGHJghf
Now those funds are not being staked by Alice anymore. It’s important to note that Bob won’t know if Alice has done this. The way the vaults are set up currently, it’s important for vault manager and fund owner to be able to communicate. If that communication fails, both parties should assume the other has taken down their side of the vault.
Clearly, vaults accomplish some great features. With vaults you can have a friend with expertise stake funds for you without funds leaving your wallet. The scenario described above basically demonstrates this. Keep in mind, there are zero financial incentives to stake in a vault vs staking on your own live node. What can vaults be used for?
Well, one great use case for Divi Staking vaults is cold staking. You, yourself, can set up the two wallets. Once you have the managing wallet running and staking the vaulted funds, you can completely dismantle the funding wallet. Seriously, grab the seed words and take down the funding wallet altogether. Funds will be staking.
This is great becuase there is then no way for attackers to get your funds. They can have all the passwords they want to your active wallet and it will get them nothing. Just keep your seedwords safe.
With a Front End
The Divi Project is putting staking vaults into their world class, easy to use, crypto-made-easy mobile wallet (and their desktop wallet too). Because they will be encapsulating both payment and messaging inside the wallet platform, the vaulting system is very simple. They will set it up such that they are the vault manager and all you have to to is decide how much Divi you want to put in a vault and press a button. As a user, you wont have to do any of the steps described above.
- You can not create a combined utxo unless 6 confirms on the existing utxo’s have happened.
- If there are multiple wallets, not currently possible to define which one gets defunded
- There is no way for the fund owner to know if the vault manager is currently staking, or has removed the vault from their side.
- Vault managers can not take a fee on chain. All payments, contracts and such are done off chain.
- Stake rewards can not be rerouted anywhere but to the fund owners vault.
These limitations will be overcome as Divi staking vaults grow and change. The current embodiment is just the first crack at this. Staking vaults on the Divi blockchain are going to be part of a growing, vibrant cryptocurrency economy and community.
I can’t leave off writing this article without mentioning the amazing folks at Divi. The Divi Project is honestly the only cryptocurrency organization and community utterly committed to making cryptocurrency easy for people.
Further, a note must be said about the hard work that the beta testing group has done, especially “Giff”, to hammer out how these things work. Most of all, much respect from me to German Patiarroy, the brains behind the vaults. I have never seen a blockchain sorcerer work at the haste and efficiency of German.