cic-docs/spec/002_dai_reserve_migration.md

67 lines
3.2 KiB
Markdown
Raw Permalink Normal View History

2020-07-18 07:14:16 +02:00
# x/bDAI Migration spec
<!--
valid status values are: Pre-draft
-->
* Authors: Will Ruddick <will@grassecon.org>
* Date: 2020.04.22
* Version: 1
* Status: Pre-draft
## Rationale
2020-05-17 07:20:40 +02:00
We want to give donors and community members a way to contribute to and cash-out from Community Inclusion Currencies with National Currency.
2020-07-18 07:14:16 +02:00
By connecting to a reserve that is stable to the US dollar called x/bDAI we bring some stability and the ability for many to support local communities.
We also enable any CICs that have bDAI as a reserve to convert to any other CIC with bDAI as reserve.
## Before
2020-04-24 20:18:55 +02:00
Currently we are using a virtual reserve a generic ERC20 token. We have 2 Million of those reserve tokens against 8 Million Sarafu issued (the current Kenyan CIC). (Call those Sarafu_1 or S1)
## After
2020-07-18 07:14:16 +02:00
We have 40,000 DAI to bridge to a bDAI token and put as the reserve and are looking at minting (16Million) tokens (called Sarafu_2 S2)
2020-05-17 07:20:40 +02:00
with a connector weight (target Reserve Ratio) of 0.25 (25%) and an inital price of roughly 100 Sarafu to 1 xDAI (USD stable)
(Note that the 100 Sarafu to 1 xDAI will approximate the Kenyan Shillings to USD rate)
## Implementation
2020-06-17 14:17:03 +02:00
2020-07-18 07:14:16 +02:00
Each existing user should have a completley new wallet and private key for security reasons and be given the same balances they currently have with the new (bDAI reserve) Sarafu. Roughly 8Million Sarafu_1 in wallet will be replaced with Sarafu_2
### Workflow
2020-06-17 14:17:03 +02:00
2020-07-18 07:19:34 +02:00
1. Bridge bDAI to DAI on BloxBerg
1. Setup an onserver node on BloxBerg
2020-04-23 07:33:10 +02:00
1. Synch db <->Blockchain - ensure synronization between our db (USSD interface) and blockchain
2020-07-18 07:19:34 +02:00
1. (delayed) Finalize any contract changes to Bancor Suite (such as [Depth Bump](https://gitlab.com/grassrootseconomics/cic-docs/-/blob/master/spec/003_depth_bump.md))
1. Understand all Public vs Private (owner owned) Functions - Make all contracts as permissionless as possible
1. Create group of govenors on a multi-sig wallet with the power to assign the facilitator address of all blockchain contracts (Bancor Suite).
1. Security checkes
2020-04-23 07:33:10 +02:00
1. Deploy contracts to create Sarafu_2, set inital variables - deposit reserve and mint tokens
2020-05-18 11:29:15 +02:00
1. Migration - New wallets for users - Replicate user accounts with new token Sarafu_2 - ensure private keys are safely stored
### Variables
1. Synch variables, - synch frequency - and limitations
2020-07-18 07:19:34 +02:00
2. Contract variables (reserve ratio (0.25), reserve amount (40k bDAI), number of Sarafu_2 (16Million), convert fee 0.005 (0.5%))
2020-04-23 07:33:10 +02:00
3. Migration speed - how often is synching done between USSD db and blockchain
2020-07-18 07:19:34 +02:00
4. 3rd party Fiat <-> bDAI conversion costs and speed
### Interface
2020-04-23 07:33:10 +02:00
This migration will all be done at code and command line level, while some testing can be done on the platform gui
## Testing
2020-07-18 07:19:34 +02:00
1. Check bDAI to DAI on bridge on BloxBerg
1. Test observer node on BloxBerg for dashboard
1. Check db<->blockchain synch - verify they are synched and we can do external transactions and handle RPC failure
2020-04-24 18:50:41 +02:00
1. Token Governance
1. Contract deplyment - conversions, transfers all work as expected
1. Migration - new wallets match old wallets
2020-05-17 07:20:40 +02:00
1. Store old blockchain wallet IDs (as a list with older POA and xDAI wallets)
## Changelog
<!--
Please remember to describe every change to this document in the changelog using
serial number:
* version 1:
-->