An ERC20 to track Grain

Based on comments by @burrrata, as well as conversations with @s_ben, @tables, and @ianjdarrow, I think it may be time for us to make an ERC20 token that tracks Grain.

This would tremendously simplify the process for contributors selling Grain to receive $. Currently, every transaction requires either:

  • Going through OpenCollective + PayPal, which incurs middlemen fees of around ~13%
  • Having PL manually send a wire to the contributor, which requires exchange of banking information, and is generally a pain

It would be great if PL could simply publish a smart contract with a DAI budget, and that smart contract allows exchanging Grain for DAI.

However, we are not ready to make Grain a “fully on-chain” asset:

  • For ease of iteration with technologies like boosting, and Grain voting, Grain to be off-chain so we can build fast and gas-free UIs
  • Managing custody of on-chain assets is a bit like juggling razor blades, and if you drop one you lose all your money :frowning:
  • There’s no way to run SourceCred on-chain anyway, so we’re going to need an oracle no matter what

I propose that we start tracking Grain as two quantities: “Governance Grain” and “Financialized Grain”.

Governance Grain is Grain that is associated with a known identity within SourceCred (e.g. a Discourse user or GitHub account.) Grain starts as governance Grain, since it is paid out to identities based on their cred. Governance Grain is tracked in a public Git repository alongside our Cred (and everyone in the project can audit the state history and verify that Grain is being managed faithfully).

Financialized Grain is Grain that is tracked by an ERC20 token. An identity with Governance Grain can convert their grain into Financialized Grain by publicly authenticating their identity, and requesting that some portion of their Governance Grain be converted to Financialized Grain and sent to a particular address. The holders of Financialized Grain can then use it like any other ERC20, including trading it on decentralized exchanges. The holders of Financialized Grain can also convert it back to Governance Grain by burning the token in a transaction that specifies a SourceCred identity to receive it.

Governance Grain is used for SourceCred’s own governance, e.g. boosting, participating in cred-weighted voting, etc. Financailized Grain is used for exchanges and transfers. Ideally, for tax purposes, contributors would register income not when they receive governance grain, but when they convert their governance grain into financialized grain. Will need to talk to tax lawyers to see if we can work that out.

From a technical / process perspective, there are a number of open questions we’d have to resolve:

  • How do we authenticate contributors’ requests to transfer Grain? (We could have a 2fa style thing, where they need to post a Gist form GitHub, a post from Discourse, and/or a verification on Discord.)
  • How would we manage the keys to the bot that can mint Financialized Grain? We really need that bot not to get hacked.
  • How do we read the Ethereum state to find all of the Financialized->Governance transactions?

I don’t have much experience writing smart contracts, and as you can probably tell from my “razor blades” remark above, I find them kind of scary. So I’d want support from an experienced community (e.g. Aragon) in implementing this system.

2 Likes

The DAOnuts project built the apps to authenticate requests, manage pulling data from web2 to web3, and authenticate voting based on tokens. It’s setup for Reddit, but could also be integrated into Discourse (with some work).

Right now, however, we could just launch a DAO that would allow you to act as TBD on the DAO as well as the SourceCred side. This would allow us to use tokens off-chain to make computations easy, but would also allow us to easily manage tokens on-chain too. With the DAO we could also use tokens to vote on stuff, but keeping it just to redeeming tokens for DAI might be good to start. Aragon DAOs allow you to manage the redemption of a DAO’s native tokens for assets in the DAOs vault, so this is built in. If you want to set the price yourself you can. You could also use a bonding curve to create an automated floating Grain price that adjusts based on demand.

Currently here’s what I see:

  • The majority of Cred stays off-chain in notebooks that the TBD updates and we can verify. We use this for Discourse engagement, boosting, etc…
  • When people want to cash out, TBD reduces balances in the off-chain ledger and creates an entry in the on-chain ledger. Then the token holder can directly redeem their tokens for assets in the SourceCredDAO’s vault and/or trade tokens for other ERC-20s.
  • If people want to move tokens from Ethereum to “SourceCred” (TBD’s off-chain notebooks) then they can make a request in the DAO via token request app (currently under security review). If accepted by TBD, a token offering will be put in the DAO’s vault and TBD can then mint tokens either within the DAO itself or on the “SourceCred side” (off-chain).

Since Aragon DAOs are fully audited and can be deployed with pre-baked templates you won’t have to write your own contracts or anything. It should “just work.” You can browse the currently available templates here, although for this case I’d recommend a vanilla democracy DAO with Address Book and Token-Request installed.

Happy to set up a Rinkeby (testnet) DAO to explore what this might look like :slight_smile:

2 Likes

How would authentication work? Can I use a hardware wallet? What would happen to the tokens if I got hit by a bus?

:+1:

It’s an Ethereum public/private key pair. You can use a hardware wallet like Trezor or Ledger with Metamask. If you want to make your wallet a multisig then there could be recovery options if you were unavailable. This could be another Aragon DAO with you and @protocol as authorized agents, or it could be one of the many smart contract wallets that allow for key recovery. The good thing about Rinkeby is that all the tokens are on testnet so we can explore the model and test it out before committing :slight_smile:

Initiative in progress!