How WeiDai works

Imagine a Digital Gold Standard (Analogy)

Over the years, the state couldn’t resist printing more notes than gold, which brought into question the actual value of each note. In order to avoid the embarrassing situation of too many note holders redeeming gold that didn’t actually exist, the nation states of the world eventually abandoned the link between notes and gold.

Suppose instead of abandoning the gold standard, a new magical technology came into existence that allowed each circulating note to calculate how much gold it was currently backed by. For instance, assume the state starts with 1000 ounces of gold in reserve and 1000 notes in circulation. Each note claims to redeem 1 ounce of gold. Now the state prints 600 more notes so that there are now 1600 notes in circulation and 1000 ounces of gold in reserve. The notes automatically update their promise to 0.625 ounces of gold. The money therefore instantly debases itself and existing holders are instantly poorer.

Conversely, if the state added to its gold reserve without printing notes or retires a portion of notes from circulation, the circulating notes would instantly register an increase in their redeem value. This is how WeiDai works. WeiDai is collateralized by Dai (instead of gold) in a smart contract. At any point in time, WeiDai has a redeem value stated in Dai. WeiDai is created by sending Dai to a special smart contract that generates new WeiDai in accordance with the existing redeem value. When WeiDai is redeemed, it is destroyed and Dai is released from reserve to the redeemer so that the redeem rate doesn’t fall.

WeiDai is never printed without backing. There is no decentralized or centralized mechanism to create WeiDai without first supplying Dai to be held in reserve. At the very least, WeiDai is as stable as Dai.

Burn Incentives

it’s about sending an encrypted message

In addition, whenever a portion of WeiDai is redeemed, 2% of it is first set aside and burnt without releasing any Dai. This acts as a transaction fee. The remaining 98% is redeemed against the reserve of Dai and destroyed in the process. Both of these pressures on circulation mean that the circulating supply of WeiDai is always falling relative to the reserve supply of Dai. This instantly and automatically pushes up the redeem value of the remaining WeiDai. WeiDai is not the first token to have burn incentives but the combination of burn incentives and stablecoin collateralization is the magic formula required to create a thriftcoin.

How It Works (semi-technical)

Patience is a virtue

WeiDai is no different but the transfer process is new. WeiDai rewards patience, a bedrock of thriftiness and as such transfers wealth from the impatient to the patient using a special Ethereum smart contract known as the “Patience Regulation Engine”.

To create WeiDai, a user sends Dai to the Patience Regulation Engine (PRE, henceforth). The WeiDai (an ERC20 token) is instantly generated according to the current redeem rate but is locked. The user must wait a certain number of blocks, after which the WeiDai is unlocked and can be withdrawn. This wait duration is known as the incubation period. If the user wishes to withdraw their WeiDai early, they incur a penalty. The less patient the user (and hence the earlier they wish to withdraw), the steeper the penalty. The penalty declines from 100% at the time the WeiDai is created in discrete 5% lumps until it reaches 0%, at which point the the incubation period ends and the WeiDai can be claimed without penalty.

Mining Difficulty

What happens to the penalty?

What about Whales?

Satoshi and Sarah each own 50 WeiDai and there is 100 Dai in reserve. This means that each WeiDai token can be redeemed for 1 Dai token. Satoshi decides to redeem 25 WeiDai. 0.5 WeiDai (2%) is burnt as a fee, and the remaining 24.5 is redeemed for 24.5 Dai. The reserve now contains 24.5 fewer Dai but 25 WeiDai were taken out of circulation. This means that the remaining WeiDai can be redeemed for (75.5/75 =)1.006 Dai. Sarah initially could redeem her 50 WeiDai for 50 Dai but can now redeem it for 50.3333 Dai. Her WeiDai wealth has passively grown by 0.6%.

I want to get some WeiDai now!

Please visit the repo at Github. WeiDai is also live on Kovan testnet if you’d like to play around first before committing real Dai. Just remember to switch the network in Metamask.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store