https://github.com/unlock-protocol/password-required-hook
A smart contract hook to use with your lock to enable password protected purchases
https://github.com/unlock-protocol/password-required-hook
Last synced: 5 months ago
JSON representation
A smart contract hook to use with your lock to enable password protected purchases
- Host: GitHub
- URL: https://github.com/unlock-protocol/password-required-hook
- Owner: unlock-protocol
- Created: 2022-09-09T20:50:30.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-04-11T15:58:43.000Z (about 2 years ago)
- Last Synced: 2025-04-06T20:25:46.801Z (about 1 year ago)
- Language: JavaScript
- Size: 514 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Password Hook for Locks
This project implements an Unlock [PublicLock Hook](https://docs.unlock-protocol.com/core-protocol/public-lock/hooks) that can be used on Locks smart contracts to ensure that users who are purchasing a key from a lock have entered the right password on the frontend application.
This process is _secured_ and cannot be bypassed by calling the contract directly as the password is used to submit the transaction on-chain.
When the user enters a password on the frontend application, the password is used to generate a private key that is then used to sign the recipient's address. That signature is passed as the data argument on the `purchase` call.
A lock manager can set the right signer based on the password for a lock using `setSigner`.
The Unlock Protocol team has deployed and verified a version of this hook on the following networks:
## Using the hook for your own lock
From the Unlock Dashboard, go to "Settings", then select "Advanced" and finally "Hooks". Check this [Guide](https://unlock-protocol.com/guides/password-protected-nft-memberships/) for more details.