This is the project built at the ETHGlobal Tokyo
output.mp4
HyperBOB is an ERC4337 wallet that implements an anonymous transfer feature on Ethereum L1, where wallet users are able to transfer any stablecoin to another address without exposing the on-chain connection of each address. This is made possible by the combination of cutting-edge technologies, such as HyperLane’s customizable interchain bridge and zkBOB’s zero-knowledge solution for private token transfer.
The zk solution utilized for this private transfer feature is built by zkBOB which is currently only available on Optimism and Polygon but not on Ethereum L1 as its on-chain zk-proof verification is undeniably gas-expensive. However, HyperBOB allows users to have access to zkBOB from L1 by integrating Hyperlane’s Warp API that helps bridge BOB from L1 to Polygon.
*The current zkBOB’s fee model doesn’t have users pay gas fees on-chain but charges small fees in BOB subtracted from the deposit balance, which means that they subsidize the cost of on-chain transactions.
Hypelane Warp API consists of two router contracts separately deployed on both local and remote chain. Our HypERC20Collateral on L1 contract serves as a pool for depositing BOB and HyperLane’s relayer sends a request to HypERC20 that mints a wrapped BOB token to the AA wallet on L2.
HypERC20 itself is a token contract that is also compliant with the ERC777 standard and HyperBOB AA wallet implements ERC777receiver interface. Hence, when AA wallet contract receives the newly minted BOB, tokensReceived method on the AA contract gets triggered in which subsequent functions to deposit BOB to zkBOB contract will be executed.
The function used for depositing BOB to zkBOBPool is directDeposit which allows any external contract to directly deposit BOB to a zkBOB Account with a given zkAddress. So, the sender, HyperBOB AA wallet, doesn’t have to interact with zkBOB app UI beforehand, in which usually they would have to create zkAccount first and deposit BOB to the zkBOBPool.
And most importantly, all of the complex executions described above is done by sending one transaction while it actually contains multiple transactions in a cross-chain manner, such as approve, swap, bridge, and deposit. So from the user’s point of view, it’s just one click. This is enabled because of the mere fact that the Account Abstraction wallet can execute a batch call and implement arbitrary executions inside.
- Verify that your Node.js version is >= 18.12.0.
- Clone this repository.
- Make sure you configure the
provider
insrc/exconfig.json
to theGoerli
network. - Edit the
bundler
URL pointing toGoerli
network and accepting EntryPoint=0x0576a174D229E3cFA37253523E645A78A0C91B57
- Run
yarn install
to install the dependencies. - Run
yarn start
- Load your extension in Chrome by following these steps:
- Go to
chrome://extensions/
- Enable
Developer mode
- Click on
Load unpacked extension
- Select the
build
folder.
- Go to
- Happy hacking.