https://github.com/mlabs-haskell/wallet-auth
https://github.com/mlabs-haskell/wallet-auth
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mlabs-haskell/wallet-auth
- Owner: mlabs-haskell
- License: mit
- Created: 2023-08-24T13:03:52.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-11-27T19:14:33.000Z (over 2 years ago)
- Last Synced: 2025-03-16T13:42:02.573Z (over 1 year ago)
- Language: TypeScript
- Size: 1.37 MB
- Stars: 1
- Watchers: 6
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# wallet-auth
Implements unified primitives for building sign-in/sign-up flows
with different kinds of wallets:
- All CIP-30 compatible wallets (Cardano)
- Metamask
- Keplr (Cosmos)
- Phantom (Solana)
Consists of two parts:
- `client` part is meant to be light-weight and usable in the browser,
it only handles data signatures by interacting with wallets.
- `server` part is used to validate signatures produced by the `client`.
# Notes
* As an additional security measure, we require that signed data always starts with the address used and a new line character.
* For Cardano wallets either a stake key or a payment key can be used
(see `AvailableCip30` constructor).
* Only mainnet addresses are allowed by default
(pass the proper option to `AvailableCip30` constructor if you want to use testnet)
## Tests
The `client` library provide a test HTML page that can be used to create `SignedData` objects
using various wallets.
You have to have wallets of your choice installed in your browser.
```bash
cd client
npm install
npm run pack
sleep1; xdg-open http://localhost:8080/index.html & miniserve .
```
There are some tests in `server` to ensure `SignedData` objects can be properly validated or rejected:
```bash
cd server
npm run build
npm run test
```