8000 GitHub - getwax/bls-wallet at v0.1.0
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Nov 5, 2023. It is now read-only.

getwax/bls-wallet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bls-wallet

An Ethereum Layer 2 smart contract wallet that uses BLS signatures and aggregated transactions to reduce gas costs.

Components

See each component's directory README for more details.

Aggregator

Service which aggregates BLS wallet transactions.

Clients

TS/JS Client libraries for web apps and services.

Contracts

bls-wallet Solidity contracts.

Extension

Quill browser extension used to manage BLS Wallets and sign transactions.

Signer

TS/JS BLS Signing lib.

Dependencies

Required

Optional (Recomended)

Setup

Run the repo setup script

./setup.ts

Then choose to target either a local Hardhat node or the Arbitrum Testnet.

Local

Start a local Hardhat node for RPC use.

cd ./contracts
yarn hardhat node

You can use any two of the private keys displayed (PK0 & PK1) to update these values in ./aggregator/.env.

...
PRIVATE_KEY_AGG=PK0
PRIVATE_KEY_ADMIN=PK1
...

Set this value in ./contracts/.env (This mnemonic is special to hardhat and has funds).

...
DEPLOYER_MNEMONIC="test test test test test test test test test test test junk"
...

Deploy the PrecompileCostEstimator contract.

yarn hardhat run scripts/0_deploy_precompile_cost_estimator.ts --network gethDev

Copy the address that is output.

Update ./contracts/contracts/lib/hubble-contracts/contracts/libs/BLS.sol's COST_ESTIMATOR_ADDRESS to the value of that address;

...
address private constant COST_ESTIMATOR_ADDRESS = 0x57047C275bbCb44D85DFA50AD562bA968EEba95A;
...

Deploy all remaining bls-wallet contracts.

yarn hardhat run scripts/deploy_all.ts --network gethDev

Arbitrum Testnet (Rinkeby Arbitrum Testnet)

You will need two ETH addresses with Rinkeby ETH and their private keys (PK0 & PK1) for running the aggregator. It is NOT recommended that you use any primary wallets with ETH Mainnet assets.

You can get Rinkeby ETH at https://app.mycrypto.com/faucet, and transfer it into the Arbitrum testnet via https://bridge.arbitrum.io/. Make sure when doing so that your network is set to Rinkeby in MetaMask.

Update these values in ./aggregator/.env.

RPC_URL=https://rinkeby.arbitrum.io/rpc
...
NETWORK_CONFIG_PATH=../contracts/networks/rinkarby.json
PRIVATE_KEY_AGG=PK0
PRIVATE_KEY_ADMIN=PK1
...

And then update this value in ./extension/.env.

...

CHAIN_RPC_URL=https://rinkeby.arbitrum.io/rpc
...

Run

docker-compose up -d postgres # Or see local postgres instructions in ./aggregator/README.md#PostgreSQL
cd ./aggregator
./programs/aggregator.ts

In a seperate terminal/shell instance

cd ./extension
yarn run dev:chrome # or dev:firefox, dev:opera

Chrome

  1. Go to Chrome's extension page.
  2. Enable Developer mode.
  3. Either click Load unpacked extension... and select ./extension/extension/chrome or drag that folder into the page.

Firefox

  1. Go to Firefox's debugging page.
  2. Click Load Temporary Add-on....
  3. Select ./extension/extension/firefox/manifest.json.

Testing/using updates to ./clients

For extension:

cd ./contracts/clients
yarn build
yarn link
cd ../extension
yarn link bls-wallet-clients

For aggregator, you will need to push up a release canidate (-rc) version to 'bls-wallet-clients' on npm and update the version in ./aggregtor/src/deps.ts until a local linking solution for deno is found. See esm-dev/esm.sh#216 for details.

./aggregtor/deps.ts

...
} from "https://cdn.skypack.dev/bls-wallet-clients@x.y.z-rc.w?dts";
...

About

Core components to use layer 2 smart contract wallets with the BLS signature scheme

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 14

2AAD
0