An open API service indexing awesome lists of open source software.

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

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...
```