Arcology-Builders / democracy

Tools for peer-to-peer privacy with Ethereum and AZTEC
http://zk-transfer.netlify.app
MIT License
44 stars 22 forks source link

Auto-minting of ZK notes (on Rinkeby) #53

Closed learner-long-life closed 4 years ago

learner-long-life commented 4 years ago

Background

This task is part of a larger project to create an interactive web demo / playground for users to learn about zero-knowledge (ZK) assets and gain intuition about them by directly transacting with the contracts on-chain.

Currently when a new user first loads the page (the majority of user experiences), they will see a zero ZK note balance, as show in the screenshot below. This is not an optimal situation, as they will probably not be sure how to receive ZK notes to experiment with, and therefore not be able to experiment transferring them to other users.

Screenshot_3_17_20__11_48_PM

As described (and implemented) in #45 , minting (creating) new ZK notes is a very manual process that involves an administrator account, which we can publish the credentials for on the Rinkeby testnet and embed into our demo site. (A different, future task will discuss how to enable this on Mainnet).

The task for this issue is to automatically mint a new 10-value ZK note, for one of the three ZK tokens (with trading symbols 'AAA', 'BBB', or 'ABC'), every time the user refreshes the page at https://zk-transfer.netlify.com, including when the page is first loaded.

Task Description and Examples

A static demo, created with react-scripts, is currently running on: https://zk-transfer.netlify.com

In this task, you'll modify the source code in https://github.com/invisible-college/democracy/tree/master/packages/zk-transfer-web

Your task has two parts:

  1. mint a new 10-value note programmatically, using the knowledge from issue #45
  2. update the balances of the ZK token with this new note, with an animation or a sound effect, whenever the note has finished minting (there is a delay)

How to Work on This Task

Working on this task requires the following steps

Editing the Source Code

Here's an example of code that mints a configurable value of ZK note when a button is pushed in React that you may find helpful.

https://github.com/invisible-college/democracy/blob/master/packages/aztec-web/src/token.jsx#L103

You can test it out in-person by going to https://aztec-web.netlify.com and following the web minting instructions in issue #45

Deploying to Netlify

When you create your pull request of your fork back to the base repo, Netlify will include a preview deploy.

Looking forward to working and learning with you on this project ⛰

gitcoinbot commented 4 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 25.0 DAI (25.0 USD @ $1.0/DAI) attached to it as part of the invisible-college fund.

learner-long-life commented 4 years ago

welcome @sebastianf ! Thanks for your interest. Can you join me and @owonwo in our gitter channel for discussion? https://gitter.im/invisible-college/democracy

He has written most of our React code, so you might have a mutually interesting conversation.

learner-long-life commented 4 years ago

@owonwo Can I have a code review please? https://github.com/invisible-college/democracy/pull/55

gitcoinbot commented 4 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work for 25.0 DAI (25.0 USD @ $1.0/DAI) has been submitted by:

  1. @owonwo

@cryptogoth please take a look at the submitted work:


gitcoinbot commented 4 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


The funding of 25.0 DAI (25.0 USD @ $1.0/DAI) attached to this issue has been approved & issued to @owonwo.

learner-long-life commented 4 years ago

Implemented by #54