NFT Marketplace with Lazy Minting – Fullstack Tutorial

In this free multi-part fullstack tutorial on YouTube you learn how to build a NFT Marketplace with or without Lazy minting.

#0 – Get the NFT Marketplace Source Code here

#1 – Live Demo and Technologies

In this YouTube video we show you a short live demo of the NFT Marketplace with Lazy Minting and an overview of the technologies we are using to build it.

Are you wondering what’s Lazy Minting and why you actually would need it? Well, it’s an approach to mint and sell NFTs with literally no gas fees for the NFT creator or seller.

#2 – Frontend with Nextjs, React and Tailwind

In this video we will show you how to build the frontend for a NFT Marketplace with Next.js, React and Tailwind.

#3 – Ethereum Connection Layer

This is the third episode of a multi-part NFT Marketplace fullstack tutorial. In this video we build the Ethereum Connection Layer of the NFT Marketplace. First we install Hardhat and spin up a local etherum node in our development environment. Then we connect Metamask to this local ethereum node. We proceed with developing an ethereum interface modul, that enables us to connect from the client side with client wallets like Metamask but also from the server side through our Next.js backend APIs that we are going to build in the following videos. As a bonus track we build a workaround for a known Metamask bug “unchecked runtime.lasterror: could not establish connection”.

#4 – Backend APIs and Service Layer

This is the fourth episode of our multi-part NFT Marketplace fullstack tutorial. In this video we create the Backend APIs and also the Service Layer of the NFT marketplace. First we start with creating a Backend API that later on allows us to retrieve the lazy-minted NFTs from the database. Then we create a backend API that will enable us to upload new NFTs. Furthermore we will build a Service Layer, that on one hand allows our marketplace to easily interact with the Backend APIs and on the other hand it allows our backend APIs to consume other internal and external services.

#5 – IPFS and Database Layer

In this episode we explain why we create Backend APIs to interact with IPFS and why we store NFTs in a database. You learn how to store the NFT images and its metadata on IPFS through the Infura gateway and how to store NFTs along with offchain data in a MongoDB database. Furthermore we show you how to run a MongoDB database with Docker on the Google Cloud Platform (GCP).

#6 – Smart Contracts and Inheritence

In this episode we build an abstract NFT contract with permission roles and derive our tutorial NFT Collection from this abstract NFT contract. We start with a short explanation on how to write smart contracts with Solidity based on an example smart contract that comes with Hardhat. You will also learn what ABIs are and why we need it. Then we use Open Zeppelin to build the abstract NFT contract with permission roles and we show you how to derive from this smart contract by creating the Tutorial NFT collection – the Bored Ape Fake Club (BAFC). We implement the interfaceNFT module in this video, that allows our marketplace frontend to interact with NFT contracts through their ABI. The marketplace smart contract, that we will build in the following videos, will interact with this NFT smart contract to mint and transfer NFT tokens.

#7 – Lazy Minting and EIP-712

In the seventh episode we define the structure of lazy minted NFT sales orders and we implement a domain separator to protect us against replay attacks with different chain ids. Then we write code that enables nft creators and sellers to sign their sales orders. We also code the marketplace smart contract that verifies and recovers the signatures of these lazy minted sales orders and that performs several security checks before it mints the NFT token on the blockchain or transfers the NFT token to the buyer. Eventually we will invalidate the lazy minted sales orders directly on the blockchain once they were used.

#8 – Get the Source Code (Surprise!) and install it

In this episode we exactly show you how to get the source code of this NFT Marketplace with Lazy Minting – Fullstack Tutorial and how to install and run it. Watch this video until the end then you might be in for a pleasant surprise!

You can get the source code here (payable).

#9 – Monetization and Revenue Distribution

In this episode we show you how to monetize your NFT marketplace. In an NFT marketplace there are several particpants who can earn their fair share – the NFT Creator, the NFT Seller and the NFT Marketplace. In this video we just implement a very simple earnings distribution between the seller of an NFT and the marketplace and we show you how we use integer operations in the Marketplace Smart Contract to overcome the technical restrictions with decimals in solidity.

#10 – Royalties and EIP-2981

In this video we implement Royalty payments to the creators of the NFTs. The NFT creators will receive a creator share, which is a fraction of the sales price, whenever their NFT Token is sold. For this purpose we will extend the revenue distribution that we implemented in the 9th video. In order to support Royalty payments for secondary sales across different marketplaces we implement the EIP-2981 standard, which is a standardized way to retrieve royalty payment information.

Have fun watching and don’t miss out on any episode by subscribing to our YouTube Channel

How to run a Chainlink Node and Postgres Database with Docker

Problem Statement:

You want to setup a Chainlink Node quickly with Docker and without paying additional fees for a cloud based Postgres database service, e.g. on on the Google Cloud Platform (GCP)?

Solution:

You can achieve this by running the Chainlink Node itself and also its PostgreSQL database in separate Docker containers.
Watch this YouTube video and see how to setup Chainlink and its PostgreSQL Database with Docker:

With this approach you can save the fees for the database service and you also can save time by utilizing a Container Optimized OS (COS) – Image with Docker already preinstalled.

Follow this 10 steps process to setup the Chainlink Node and its PostgreSQL database with Docker :

  1. Create a VM instance on the Google Cloud Platform (GCP). Choose a machine type with at least 2GB of memory and change the boot disk from Debian to Container Optimized OS. Then create the instance and SSH into it.
  2. Create the directories for the Chainlink Database and the Chainlink Node:
    mkdir -p chainlink/db
    mkdir -p chainlink/chainlink_rinkeby
  3. Create the container for the PostgreSQL database
    docker run --name postgres-chainlink -v $HOME/chainlink/db:/var/lib/postgresql/data -e POSTGRES_PASSWORD=myPostgresPW -d -p 5432:5432 postgres:11.12
  4. Create the chainlink Postgres user in postgres database container:
    docker exec -it postgres-chainlink psql -U postgres -c "CREATE USER chainlink WITH PASSWORD 'myChainlinkPW';"
  5. Create the Chainlink Database (for the Rinkeby test-network in this sample)
    docker exec -it postgres-chainlink psql -U postgres -c "CREATE DATABASE "chainlink_rinkeby";"
  6. Grant the provilieges to the chainlink user
    docker exec -it postgres-chainlink psql -U postgres -c "GRANT ALL PRIVILEGES ON DATABASE "chainlink_rinkeby" TO chainlink;"
  7. Create the .env file for the chainlink node and refer to the required Ethereum network and to our new Postgres Database
    vi chainlink/chainlink_rinkeby/.env

    and enter

    ROOT=/chainlink
    LOG_LEVEL=debug
    ETH_CHAIN_ID=4
    MIN_OUTGOING_CONFIRMATIONS=2
    LINK_CONTRACT_ADDRESS=0x01BE23585060835E02B77ef475b0Cc51aA1e0709
    CHAINLINK_TLS_PORT=0
    SECURE_COOKIES=false
    GAS_UPDATER_ENABLED=true
    ALLOW_ORIGINS=*
    ETH_URL=wss://rinkeby.infura.io/ws/v3/<YOUR_INFURA_PROJECT_ID>
    DATABASE_URL=postgresql://chainlink:myChainlinkPW@localhost:5432/chainlink_rinkeby?sslmode=disable

    For this demo we use Infura as external provider for the connectivity to the Ethereum blockchain.
    If you want to use Infura as well, make sure that you adapt the Infura Project ID accordingly.

    Also make sure that you use the same Chainlink Postgres password here that you have used to create the Chainlink Postgres User before.

  8. Create the .password file which holds the password for your node wallet
    vi chainlink/chainlink_rinkeby/.password

    Enter your password for your node wallet. This password
    – must be longer than 12 characters
    – must contain at least 3 uppercase characters
    – must contain at least 3 numbers
    – must contain at least 3 symbols

  9. Create the .api file which holds the credentials for the GUI interface of the node
    vi chainlink/chainlink_rinkeby/.api

    and enter your email address and password. This password must be 8 to 50 characters.

    <YOUR_EMAIL_ADDRESS>
    <YOUR_NODE_GUI_PASSWORD>

  10. Now we can create the container for the chainlink node itself
    docker run --name chainlink_rinkeby --network host -p 6688:6688 -v $HOME/chainlink/chainlink_rinkeby:/chainlink -it --env-file=$HOME/chainlink/chainlink_rinkeby/.env smartcontract/chainlink:0.10.8 local n -p /chainlink/.password -a /chainlink/.api

    Note that we have added “–network host” to the command since we run the database locally from the node’s perspective.

Access the GUI of your new Chainlink node:

  1. Open a command prompt on our local machine and authenticate with gcloud, in order to be able to access the GUI of your new Chainlink Node
    gcloud auth login

    Note: Alternatively you can download and authenticate with your API keys

  2. Create a SSH tunnel for port 6688
    gcloud compute ssh instance-1 --project <YOUR_GCP_PROJECT_ID> --zone=<YOUR_GCP_ZONE> -- -L 6688:localhost:6688

 

Maintenance – How to stop and start your chainlink containers from your VM SSH shell:

Stop and start the PostgresSQL Database container:

docker stop postgres-chainlink
docker start postgres-chainlink

Stop and start the Chainlink Node container:

docker stop chainlink_rinkeby
docker start chainlink_rinkeby

(Start and attach: docker start -i chainlink_rinkeby)

Detach from and attach to the Chainlink Node container:

Ctrl-PQ
docker attach chainlink_rinkeby

Need further support or consulting?

Please checkout our Consulting hours.

 

 

Global Tax Blockchain Link: Live Demo and Architectural Overview

How Google Maps interacts with the Ethereum Blockchain to display global indirect tax rates. 

In this video we show you how Google Maps receives global indirect tax rates for VAT, GST and US Sales Tax through the Global Tax Blockchain Link from Blue Antoinette and GT4M. Be prepared for deep insights into the architecture behind the scenes, like the Ethereum Blockchain, Web3,js and Chainlink.

Blue Antoinette to Launch a Chainlink Node

Blue Antoinette to Launch a Chainlink Node to Make Global Tax Solutions Available to Smart Contracts

 

With the rapid increase in financial applications being launched on blockchain-based smart contract platforms, there is increasing demand for tax information from developers building these “DeFi” products. This is especially important for organizations that want to sell their products via public blockchains and decentralized platforms and to accept cryptocurrencies under applicable law.

In order to service this new and growing demand, we are pleased to announce that Blue Antoinette will launch our own official Chainlink oracle node to make Global Tax solutions (GT4M) available to smart contracts. The Chainlink node provides us with a universal gateway for getting our existing APIs blockchain-enabled across the leading smart contract platforms. By doing so, we can provide our tax data and solutions directly to blockchain applications, as well as sign our data on-chain using a unique cryptographic signature (private key) to prove that all data submitted by our node is tamperproof and directly from Blue Antoinette.

 

Our Chainlink node, which runs on the most widely used oracle network in the industry, gives developers across various blockchains access to our entire suite APIs. Not only does this exposure to new markets enhance our ability to earn more revenue, but businesses will be able to build innovative solutions on the blockchain under consideration of potential tax relevant information. This helps fill a needed gap in automated on-chain tax services and enables an entirely new crop of applications to emerge that require financial compliance as a foundational primitive.

 

Building Tax-Compliant Smart Contracts Using Blue Antoinette and Chainlink

Our Global Tax Rate APIs (GT4M) allow businesses to build on-chain applications that calculate indirect taxes in real-time based on combining up-to-date tax rates with on-chain financial transactions. Using the GT4M solution, financial services providers, merchants or marketplaces can define global tax rules for VAT, sales tax, GST, and any other indirect taxes. This allows businesses to build tax-compliant eCommerce solutions that utilize smart contract backends and dApp developers to build on-chain tax services specifically tailored for DeFi.

While there are numerous possibilities around automated on-chain tax compliance, there is a fundamental limitation, smart contracts cannot natively make API calls to external systems. Thus, smart contracts cannot not access current tax rate data. In order to overcome this, smart contracts need to make use of a blockchain oracle, which retrieves external data, attest to its validity, and broadcast it on the blockchain for consumption. 

Upon reviewing various oracle solutions, we identified Chainlink as providing the most extensive set of capabilities towards maximizing our ability to monetize GT4M usage within the smart contract economy. Some of the key features of being a node operator on the Chainlink Network include:

  • Data Signing – the Chainlink node cryptographically signs every piece of data it posts on-chain, allowing us to provide clear proof that the data originated from our API. 
  • Blockchain and API Agnostic – Chainlink nodes can integrate with any blockchain and API, providing us with a single gateway to sell our data to all blockchains and from any API that exists both now and in the future.
  • Large Addressable Market – The Chainlink Network is the most widely used oracle solution in the smart contract economy, presenting us with a large and growing market of potential users that include large and small projects alike.
  • Time-Tested Infrastructure – Chainlink is thoroughly audited open-source software that collectively secures billions of dollars in value on mainnet, proving its ability to protect and trigger the movement of real economic value.

These are just a few of the many reasons why we are confident in the Chainlink Network and look forward to joining its fast-growing ecosystem. A parallel financial system is being built using a new tech stack: blockchains, smart contracts and oracles. Through Chainlink we can take an active role in its provisioning by supplying tax data directly to developers building next generation applications on it, both expanding our own addressable market and supporting the creation of new financial products.

“The rapid increase in DeFi development and adoption is putting increasing demands on tax solutions to service the wide variety of unique financial applications being deployed,” said Blue Antoinette CEO Robert Schmid. “Running our own Chainlink node allows Blue Antoinette to be directly involved via providing key tax data solutions to businesses, developers and/or applications, ultimately empowering more efficient ways to automate compliance on-chain across different jurisdictions.”

 

About Chainlink

Chainlink is the most widely used and secure way to power universally connected smart contracts. With Chainlink, developers can connect any blockchain with high-quality data sources from other blockchains as well as real-world data. Managed by a global, decentralized community of hundreds of thousands of people, Chainlink is introducing a fairer model for contracts. Its network currently secures billions of dollars in value for smart contracts across the decentralized finance (DeFi), insurance and gaming ecosystems, among others.

Chainlink is trusted by hundreds of organizations to deliver definitive truth via secure, reliable data feeds. To learn more, visit chain.link, subscribe to the Chainlink newsletter, and follow @chainlink on Twitter.
Docs | Discord | Reddit | YouTube | Telegram | Events | GitHub | Price Feeds | DeFi | VRF

 

About Blue Antoinette:

Blue Antoinette is a diversified technology group. It provides Global Tax Solutions, a Commerce Cloud, an Online Marketplace, highly specialized software and global services.
To learn more visit blueantoinette.com and gt4m.com and subscribe to the Blue Antoinette newsletter