Wrapped Chia Token - WXCH


This document describes the current implementation and architecture of the wrapped Chia token (WCHIA) smart contracts and its minting and burning functionalities. We refer the reader to the whitepaper (MaxiDAO) to get a broader scope of the system.
The WXCH ecosystem consists of custodians, brokers, and end users. The token adheres to the ERC20 token standard with the extension that tokens can be minted and burned. Standard ERC20 functionalities (i.e., besides mining and burning) are fully exposed to the end user.
Conceptually, WXCH tokens are minted when a broker deposits XCH in the custodian vault. Brokers can later burn a portion of its WXCH tokens and in return receive XCH. In the current implementation, however, Chia transfers cannot be monitored by an Ethereum smart contract; the minting process requires one broker to initiate a minting request and one custodian to approve.
In the rest of the document, we describe the technical requirements, present an overview of the implementation architecture, and then give details for every component in the system.

Technical requirements

  1. 1.
    ERC20 compliant token.
  2. 2.
    Only brokers can burn tokens.
  3. 3.
    Minting occurs upon broker request and custodian approval. Namely, in order for minting to happen, a single custodian and a single broker have to agree.
  4. 4.
    The list of brokers and custodians is controlled by a DAO, and the DAO implementation is outside the scope of the contract implementation. Initially, a multisig will control it.
  5. 5.
    Upgradability. The following components are upgradable by a DAO.
    • The token transfers are paused and the token contract is hard forked.
    • The burning and minting protocols are upgradable.
    • The process of adding new custodians and brokers is upgradable.
    • The DAO is upgradable. Meaning the DAO can transfer ownership to a new DAO.
  6. 6.
    Easy auditability. The minting and burning process should be auditable by anyone with access to the Ethereum and Chia blockchains. The protocol supports behavior that satisfies the following invariant: ​At any point in time, the amount of XCH in custodian wallet(s) is greater or equal to the total supply of WCHIA​. (assuming no unreasonable reorgs in both blockchains)
  7. 7.
    Automation of the minting and burning process. If needed, the process can be done automatically on both the broker and custodian sides, and moreover, with the blockchain(s) being the only communication channel between the two.

Trust Model

Custodians and brokers are bound to a legal agreement and also curated and audited by the DAO governance system. However, in the smart contract scope we restrict the trust model to the following assumptions:

Strict trust

  1. 1.
    The DAO (as a collective) is fully trusted.
  2. 2.
    Custodian is trusted to confirm valid mint requests, i.e, a request followed (or preceded) by a XCH deposit to custodian deposit address with greater or equal amount.
  3. 3.
    The custodian is trusted to confirm burn requests and send XCH to the broker deposit address (as depicted in the burn request).

Soft trust

The following is enforced by off-chain agreements and/or being monitored by the DAO.
  1. 1.
    Broker is trusted not to spam the custodian with dust requests.
  2. 2.
    Custodian is trusted not to frequently change his/her XCH deposit addresses.

Architecture Overview

The end-user interacts only with the ​WXCH​ component which exposes an ERC20 interface. The implementation also has an interface for minting and burning. The owner of the token is the ​Controller​ contract.
The ​Controller​ contract is owned by a DAO (e.g., a multisig wallet) which has the authority to:
  1. 1.
    Pause the token transfers
  2. 2.
    Upgrade the minting and burning protocols
  3. 3.
    Upgrade the protocol for adding (and removing) new members, namely, brokers and custodians.
The initial implementation of the burning and minting protocol is defined in the ​Bridge​ contract. The initial implementation of the member selection is implemented in the ​Members​ contract. The connection between the different contracts is depicted in the figure below.

WXCH Bridge Design

The design doc of the WXCH bridge is in this document.