Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
Rohit_Deshpande
Advisor
Advisor
0 Kudos

In continuation of our previous exploration of bridging Web2 and Web3 technologies with SAP NFT Management, this post will delve deeper into the technical backbone that supports these functionalities.

SAP NFT Management (built by the CX Intelligence and Incubation (CXII) team) is structured around three key components:

1. Web2 Layer: This layer handles traditional web services and backend processes.
2. Web3 Layer: This is where blockchain technologies come into play, interfacing directly with decentralized networks.
3. React.js UI Server: Manages the user interface and front-end interactions.

In this article, we will focus specifically on the Web2 and Web3 layers, which form the core back-end of our system, to give you a clearer picture of how they operate and interact within the broader architecture of NFT management.

Screenshot 2024-04-20 at 5.42.51 AM.png

Web2 Layer: 
The Web2 layer is designed to provide a traditional web user experience using established server architecture. It acts as the primary interface for most users interacting with our system. Key components include:

1. GraphQL API server in Go:
   - Functionality: Serves as the primary interface for querying and manipulating data. It allows clients to request exactly what they need, making interactions efficient and fast.
   - Why it matters: We use Go's goroutines to interact asynchronously with the Web3 interface layer, accommodating the asynchronous nature of blockchain calls.
2. Postgres Database:
   - This stores all metadata about our system, tenants, users, NFT collections, and individual NFTs.
3. Key Vault:
   - Manages and safeguards cryptographic keys and other secrets used by applications.
4. Azure Email Service:
   - Essential for user onboarding and NFT distributions, we rely on the Azure email service.
5. Redis:
   - Used for managing user state, Redis cache is employed to enhance performance.
6. Azure Blob Storage:
   - For storing large images and videos of NFTs, blob storage is utilized.

Web3 Layer: 
The Web3 layer handles all interactions with blockchain technologies, ensuring that our platform can operate within the decentralized web ecosystem. Key functionalities include:
Core Implementation: Our server is built with Rust, utilizing the gRPC framework for robust, high-performance service communication. Rust’s memory safety features and efficient concurrency handling make it ideal for systems requiring high reliability and speed.
Blockchain Interaction: We leverage ethers-rs, a comprehensive Rust library designed to interact with Ethereum and other EVM-compatible blockchain.
- IPFS Calls: For decentralized storage solutions, especially for handling NFT metadata and assets, our server integrates with NFT.Storage
Blockchain Network Communication: Communication with blockchain networks is handled via Infura, a service that provides a reliable gateway to Ethereum, enabling our server to execute smart contract interactions without maintaining a full node.
Smart Contract Deployment: The server manages the deployment of EVM-based smart contracts written in Solidity, primarily on the Polygon network. Polygon is chosen for its lower transaction costs and faster block confirmation times, which are crucial for NFT transactions.

Detailed Steps for Deploying an NFT Collection on the Blockchain:

In this section, we'll explore the backend processes involved in registering an NFT collection. Using the image below as an example, we will detail how it is transformed into a blockchain-registered asset, securing its ownership and ensuring its traceability. This description builds upon the foundational technology discussed in our previous article. Through these steps, we demonstrate the backend architecture's role in managing and authenticating digital assets.

download.png

1. Starting Off

- Action: As you fill in collection details and upload nft image, the collection is initiated in our system and its metadata is stored in our postgres database along with unique identifier.

- Reason: This unique identifier is crucial for tracking the collection within our internal systems. It facilitates the management and referencing of the collection throughout its lifecycle but does not directly interact with the blockchain.

- Result: In our case, a unique ID, `249cfc0b-7f72-457e-9e98-602f0a7a49bd`, is generated, marking the official start of our collection's lifecycle.

2. Uploading Images and Metadata to Blob Store

- Action: In 2nd step, NFT images, metadata files, collection cover, and banner images are uploaded to azure blob storage.

- Reason: Using a blob store for storing these files provides a more performant and user-friendly experience compared to fetching them directly from IPFS, which can be slow. By storing metadata and images in the blob store and syncing crucial data with our database, we enhance accessibility and ensure that users receive a responsive Web 2.0 experience even within a Web3 application.

- Result: This setup minimizes latency and improves the overall user experience.

3. Creating a Public Wallet

- Action: In 3rd step, A public wallet specific to the collection is created.

- Reason: This wallet manages all edits for the collection like name and description changes on the open marketplaces such as opensea.

- Result: The wallet ID, for instance `0xa76b0c1d4cce315654434e87d797548041462016`, is created for our collection.

4. Contract Deployment on Blockchain

- Action: After initial setup, a smart contract for the NFT collection using the NFT Management system's wallet is deployed on the blockchain.

- Reason: The smart contract defines and manages the creation, transfer, and rules of the NFTs.

- Result: Smart contract is successfully deployed to the blockchain at Contract Address, providing a programmable foundation for the collection.

5. IPFS Metadata Upload

- Action: Essential metadata like name, description, banner image about the collection is uploaded IPFS.

- Reason: Ensures metadata immutability and permanence, crucial for verification and trust in the marketplace.

- Result: Metadata is decentralized and permanently recorded on IPFS, with the URI `ipfs://bafkreib7itf3chnio2m3obagn6z2iax2r2u5a7g4md4mtmdz3rxo7p46x4` linked to the collection.

6. Registering Metadata URI on Blockchain

- Action: The IPFS URI is registered on the blockchain, linking it to the collection’s smart contract.

- Reason: Makes the metadata publicly accessible and verifiable, crucial for marketplaces and collectors. Also marketplaces like OpenSea can fetch this metadata and display it on their website.

- Result: IPFS metadata URI is registered on the blockchain, ensuring metadata is retrievable by marketplaces and collectors. Transaction visible at Set Contract URI Transaction.

7. Minting NFTs

- Action: NFTs are minted on demand, linking them to their IPFS-stored images and metadata.

- Reason: Optimizes resource use and gas fees by avoiding unnecessary NFT creation.

- Result: NFTs are created as requested and recorded on the blockchain, solidifying their existence and ownership. Each minting action is recorded, such as in this Minting Transaction.

Availability on OpenSea Marketplace:

Our NFT collection is now available on the OpenSea marketplace, accessible at SAP NFT Management Backend on OpenSea. On OpenSea, each NFT from our collection is presented with essential details such as name, description, images, blockchain address, and TokenID. This visibility ensures that our NFTs are not only tradable but also verifiable, linking the digital assets directly to their blockchain records for transparency and security.

Conclusion:

This walkthrough highlights how SAP NFT Management seamlessly integrates traditional web technologies with blockchain innovations. By enhancing the registration, management, and deployment of NFTs, our platform ensures an efficient and user-friendly experience. As we refine and expand our blockchain solutions, we invite you to explore and engage with our platform, helping to shape the future of digital asset management.

Get in Touch & Try It Out: 
Interested in taking the next step with the SAP NFT Management? For further queries or personalized assistance, don't hesitate to contact our dedicated team. Together, let's shape the future of digital integration.  
 
We invite you to try out the product here.