Table of Contents
Wiz-Wallet is a type of smart contract wallet that minimses the on-chain transactions by using off-chain storage and on-chain verification. It is a type of wallet that is used to store the crypto assets and can be used to send and receive the crypto assets. Currently its implemented for custom tokens where users token are locked in the smart contract and can be used to send and receive the tokens. The wallet is implemented using the concept of merkle maps where the users can send and receive the tokens without any on-chain transactions. The transactions are only done when the user wants to withdraw the tokens from the wallet.
All the code for smart contract can be seen here. So as of now there are basic functions for usage-
- To mint the tokens the custom tokens of specified value. The tokens are minted to the smart contract and the user is assigned its value using merkle maps.
- To transfer the tokens from one user to another. The tokens are transferred from one user to another by updating merkle map off-chain
- To withdraw the tokens from the smart contract. The tokens are withdrawn from the smart contract by updating the merkle map off-chain and then the proof is generated and verified on-chain.
- To update the merkle map of the user. The merkle map is updated off-chain and then the proof is generated and verified on-chain.
These are the basic functionalities that we were able to implement during the hackathon. Being new to snarkyjs we had to work quite a lot to understand the concepts and implement them. We were able to implement the basic functionalities and we are looking forward to implement more functionalities in the future and implement off-chain and on-chain features for native tokens, storages, etc.
This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.
This is an example of how to list things you need to use the software and how to install them.
- npm
npm install npm@latest -g
- Install the zk cli following the instructions from here
- Clone the repo
git clone https://github.com/lordshashank/wiz-wallet.git
- Go to the contracts folder
cd contracts
- Install NPM packages
npm install
- Run the build command to build js files from the snarky files
npm run build
- Run the local off-chain server
node node_modules/experimental-zkapp-offchain-storage/build/src/storageServer.js
- Run various scripts to deploy and interact with the smart contract
similarly frontend could also be run to test it.
node build/src/main
This dapp can be used to make daily transactions on any custom tokens on the mina blockchain. It ensures less on-chain interactions for every small transaction and hence reduces the gas fees. The transactions are only done when the user wants to withdraw the tokens from the wallet. We look forward to implement this for the mainnet and also for the native tokens along with features that could be quite useful for the users.
For more examples, please refer to the Documentation
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Your Name - @0xlord_forever - shashanktrivedi1917@gmail.com
Project Link: https://github.com/lordshashank/wiz-wallet
- Mina for the amazing hackathon.
- Also, thanks to the mina discord community for helping us out during the hackathon.