https://github.com/moleculeprotocol/ipnft-samples
code snippets that explain certain aspects of the IP-NFT minting process
https://github.com/moleculeprotocol/ipnft-samples
Last synced: 7 months ago
JSON representation
code snippets that explain certain aspects of the IP-NFT minting process
- Host: GitHub
- URL: https://github.com/moleculeprotocol/ipnft-samples
- Owner: moleculeprotocol
- Created: 2023-01-04T11:10:06.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-09-10T13:07:34.000Z (almost 3 years ago)
- Last Synced: 2024-12-27T16:45:40.286Z (over 1 year ago)
- Language: TypeScript
- Size: 409 KB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Demo code for IP-NFT implementers
Some of these examples rely on an API key for [web3.storage](https://web3.storage). Get one and put it in a local ` .env` file.
For the crypto-related scripts to run you need add a _private key_ of an Ethereum account as `PRIVATE_KEY`to the local`.env` file. You can copy this from your Metamask wallet.
**!!!!NEVER USE ACCOUNTS THAT YOU ALSO WOULD USE ON A MAIN NET HERE!!!!**
## Checksums
Compute and verify a file's checksum using [multiformats](https://www.npmjs.com/package/multiformats)
```
yarn ts-node ./checksum.mts
```
## Uploads
uploads files to IPFS using web3.storage
```
yarn ts-node ./upload.mts
```
## Lit encryption
Reads and encrypts the provided file. Requires PRIVATE_KEY to sign in with Lit
```
yarn ts-node ./lit.mts
```
## terms signature
Reads the agreements from a preliminary ipnft.json file and assembles and signs the required terms acceptance message
```
yarn ts-node ./terms.mts
```
## Schema verification
retrieves JSON schema and IP-NFT metadata from a public location and verifies its validity
```
yarn ts-node ./verifyMetadata.mts ipfs://bafy...
```