This repository contains an example integration between VSL (Verifiable Smart Layer) and MetaMask using the MetaMask Snaps platform. The integration consists of two main components:
- A MetaMask Snap that interfaces with the VSL core server to enable secure transaction signing and verification
- A companion web application that demonstrates how to interact with the VSL snap
The integration showcases how VSL's verification capabilities can be leveraged within the MetaMask wallet environment to provide additional security guarantees for blockchain transactions.
- Node.js (22.0+) with
npm
installed. - MetaMask Flask Browser Extension.
- (Optional) VSL Core Service running locally
- Clone the repository
git clone https://github.com/Pi-Squared-Inc/vsl-wallet.git
At the root directory, run
npm install
Make sure you have VSL core server running locally at localhost:44444
, then run
npm run dev
This will start the companion application at port 8000
and snap provider at 8080
. The snap will listen to the VSL core server at 44444
. The companion application must run at port 8000
otherwise the it will not have the permission to call snap endpoint. Please make sure the port 8000
is available.
npm run dev:remote
This will start the companion application at port 8000
and snap provider at 8080
. The snap will instead connect to the remote VSL server.
npm run build
This will run the production build for both the companion application and snap. After building, run
npm run start-companion
to start the build version of the companion application. This will use the snap released in NPM. For publishing the NPM snap, run
npm run release-snap
and it should release the snap. (But you need to bump up the version number in the configuration files. See separate documentation for snap and companion)
See Snap Readme and MetaMask Readme for more information. This includes details for
- How to connect to different snap provider for companion application.
- How to configure VSL endpoint for snap itself