Whitepaper for QED application built over Hyperledger Fabric
Abstract
This whitepaper presents the architecture, design, and implementation of a decentralized QED application built on Hyperledger Fabric. The application aims to enhance trust, security, authenticity and transparency for real world (High Value) assets. By leveraging Hyperledger Fabric’s modular architecture, permissioned blockchain features, and smart contracts, we demonstrate the potential for improved operational efficiencies and reduced costs.
1. Introduction
1.1 Background
Blockchain technology has gained significant attention for its potential to revolutionize various industries by providing a secure and transparent way to record transactions. Hyperledger Fabric, a permissioned blockchain framework hosted by The Linux Foundation, is designed to meet the needs of enterprise environments.
1.2 What does QED mean?
We take our name from the latin shorthand applied at the end of mathematical and philosophical proofs. QED stands for quod erat demonstrandum, Latin for ”what was to be shown”.
1.3 Objectives
This whitepaper outlines the design and implementation of a Hyperledger Fabric-based application aimed at solving specific challenges for manufacturers (to track assets ownership (lineage) which helps in gaining visibility to secondary market), customers (to determine the authenticity of the asset). We will discuss the architecture, components, deployment, and potential benefits.
2. Asset Tokenization Overview
2.1 What is Asset Tokenization?
Real world asset tokenization involves creating a digital representation of a physical asset on a blockchain. Each token represents a portion of ownership, rights, or interest in the asset. Common asset types include Luxury goods, premium edition branded items, collectibles, rare art, etc.
2.2 Categorization of Tokenized Assets in QED Application
Token: Tokenized assets without any restriction on the number of times an asset can be transferred.
Certificate: Tokenized assets can be transferred only once and can only be returned to the creator. Certificates are created for products which are perishable or consumables.
2.3 Benefits of Tokenization
Increased Liquidity: Enables ownership, authenticity, making assets accessible to a wider range of end users.
Enhanced Transparency: All transactions are recorded on a tamper-proof ledger, providing a clear history of ownership.
Reduced Transaction Costs: Smart contracts automate processes, reducing the need for intermediaries.
Improved Security: Permissioned access and identity management enhance data security.
2.4 Token and Asset Management
QED Blockchain offers a comprehensive framework for managing tokens and assets on the network. Features include:
Token Initialization: Create new token types and manage existing ones.
Minting and Burning: Add or remove tokens from circulation based on business needs.
Permissions Control: Define access rights for who can transfer, view, or modify tokens.
Network listeners and event triggers notify relevant parties when important events, such as token updates or minting, occur.
How does QED work to prove authenticity?
A physical item, a blockchain token and a database containing a description of the item and the unique blockchain identifier.
If the token id matches the one in the database and if the item matches the description in the database, the item can be seen as real.
You can skip this next part but at QED we love mathematical proofs.
To formalize the proof of authenticity based on the given conditions using formal logic, we can express the statement and reasoning as follows:
Let's denote:
L(x,y)L(x, y)L(x,y): Predicate indicating that ledger LLL contains an entry where xxx is the description of an item and yyy is the value for a token.
D(z)D(z)D(z): Predicate indicating that zzz is an item that matches the description xxx.
V(w)V(w)V(w): Predicate indicating that www is a token that matches the value yyy.
The given condition can be expressed as: ∀x∀y(L(x,y)→(∃z(D(z)∧∃w(V(w)∧w=y))))\forall x \forall y (L(x, y) \rightarrow (\exists z (D(z) \land \exists w (V(w) \land w = y))))∀x∀y(L(x,y)→(∃z(D(z)∧∃w(V(w)∧w=y))))
This statement reads: For all descriptions xxx and values yyy in the ledger LLL, if there exists an entry in LLL with description xxx and value yyy, then there exists an item zzz such that zzz matches xxx and there exists a token www such that www matches yyy.
To prove authenticity based on this:
Assume L(x,y)L(x, y)L(x,y) holds for a specific xxx and yyy.
By the condition, there exists zzz such that D(z)D(z)D(z) holds (i.e., zzz matches xxx).
Also, there exists www such that V(w)V(w)V(w) holds and w=yw = yw=y (i.e., www matches yyy).
Therefore, having zzz (item matching description xxx) and www (token matching value yyy) provides proof of authenticity as per the ledger entry L(x,y)L(x, y)L(x,y).
In logical terms: L(x,y)⇒(∃z(D(z)∧(∃w(V(w)∧w=y))))L(x, y) \Rightarrow (\exists z (D(z) \land (\exists w (V(w) \land w = y))))L(x,y)⇒(∃z(D(z)∧(∃w(V(w)∧w=y))))
Linking physical objects to QED tokens.
Physical objects are linked to QED tokens by providing a description of the item in a database entry. Descriptions can contain relevant data about the item including a physical description, SKU, codes, images etc.
For items that have a unique serial number that number can be added to the item's description.
It is not necessary for an item to have a unique serial number to have a QED token associated with it. For example, each pair of sneakers among 5000 or so identical pairs produced can have its own token associated with it.
Nothing needs to be attached or denoted on a physical item for a QED token to be created for an item.
Transferring tokens
There is no cost to either party when transferring a token.
Tokens can be transferred via two methods.
The holder of a token can print a QR code. When that QR code is scanned the scanner will receive the token. If the scanner does not have an account on the blockchain where the token is located, they will be asked to download, and app register an account and then they will receive the token.
The holder of a token can send the token directly to another party through the app. If the other party does not have an account on the blockchain where the token is located, they will receive a message or an email to download the app, register and account, and they will receive the token.
Counterfeiting items and tokens.
Blockchain tokens cannot be counterfeited. Each token on a blockchain is unique. An individual could buy a genuine item with a token, keep the genuine item and transfer a counterfeit item with a genuine token. Each time they chose to sell a counterfeit they would need to obtain a genuine example of that item to obtain a token. Should the counterfeit item be discovered it is easy to trace the history of the item through the blockchain and determine who the counterfeiter was.
QED token vs. NFTs. and crypto currencies.
While all are blockchain tokens there are some important differences in the nature of the blockchain they use in the purposes they are put to.
QED tokens use Hyper-ledger-fabric, a blockchain protocol that allows token transfers to occur without payment by either sender or receiver of a token. Users of QED tokens do not need to hold crypto currencies for transactions to occur. For NFTs, and Crypto currencies, a transaction fee in crypto is paid when buying or selling those tokens.
In common use NFTs are receipts for digital items, usually images. Transferring an NFT transfers the ownership of the digital item.
QED tokens are not designed to have value unto themselves. QED tokens are designed to enhance the value of physical items by providing proof of the authenticity of such items. QED tokens are not designed to trade independent of the item they are authenticating.
QED tokens can be used for non-physical items such as digital images or memberships, as is common with NFTs, but is primarily designed to be used to prove the authenticity of physical items.
Smart Contracts and Chaincode[1]
QED Blockchain utilizes Hyperledger Fabric’s Chaincode, a type of smart contract, to automate business processes. Chaincode runs on peer nodes and is executed when specific predefined conditions are met.
Benefits include:
Automation of Processes: Automatically executing contracts or workflows when conditions are satisfied.
Tamper-Proof: Once deployed, smart contracts are immutable, ensuring reliable and consistent behavior.
Secure and Transparent: Smart contracts run within the blockchain network, providing transparency and reducing the risk of fraud.
Applications of smart contracts range from automated supply chain management to asset transfers and settlement systems.
What is Private Blockchain[2]
Private Blockchain for Enterprises Blockchain technology has become increasingly popular in recent years. It is widely known for its decentralized nature and ability to provide a secure and transparent transaction platform. However, public blockchains like Ethereum and Bitcoin are not ideal for businesses as they lack control over who can access their sensitive data. This is where private blockchains come in.
A private blockchain is a permissioned blockchain where only selected participants are allowed to join the network. All participants are verified, and each participant has their own copy of the ledger. This means that only authorized users can access the data, and the data cannot be altered without the consensus of the network.
3. Hyperledger Fabric Overview
3.1 Key Features
Permissioned Network: Only authorized participants can access the network, ensuring data privacy and security.
Modular Architecture: Allows customization of consensus mechanisms, membership services, and data storage.
Smart Contracts: Chaincode enables the implementation of business logic on the blockchain.
Channels: Private sub-networks within the Fabric to facilitate confidential transactions.
3.2 Benefits of Hyperledger fabric over other Blockchain[3]
Hyperledger Fabric stands out from other blockchain platforms for several key reasons, especially in enterprise contexts. Here’s a breakdown of why it's considered better in certain use cases:
Permissioned Network (Privacy and Access Control)
Hyperledger Fabric is designed for permissioned networks, meaning that participants are known and trusted. This makes it suitable for businesses or enterprises that require controlled access to their blockchain.
In contrast, many other blockchain platforms like Bitcoin or Ethereum are public blockchains, where anyone can participate anonymously, which can raise concerns for organizations dealing with sensitive data.
Modular Architecture
Fabric has a modular architecture that allows you to plug and play different components like consensus mechanisms, databases, membership services, and smart contracts.
This contrasts with platforms like Ethereum, which rely on specific consensus mechanisms (e.g., Proof of Work or Proof of Stake) and have more rigid structures.
Customizable Consensus Mechanisms
Hyperledger Fabric allows the use of pluggable consensus algorithms, meaning organizations can choose a consensus protocol that best suits their performance and security needs (e.g., Raft, Kafka).
Public blockchains like Ethereum generally have a single consensus protocol that everyone must follow, limiting flexibility in adapting the blockchain to specific enterprise needs.
Channels for Data Privacy
Hyperledger Fabric supports channels, which allow subsets of participants to conduct confidential transactions that are not visible to everyone on the network. This is crucial for enterprise use cases that involve sensitive business data.
In contrast, most public blockchains broadcast all transactions to every node, limiting privacy.
Smart Contract Flexibility (Chaincode)
In Fabric, smart contracts (chaincode) can be written in general-purpose programming languages such as Go, Node.js, and Java, making it easier to find developers with the necessary skill set.
Many other blockchain platforms use specialized languages (e.g., Ethereum uses Solidity), which can require additional training for developers and limit flexibility.
Performance and Scalability
Hyperledger Fabric separates the processes of transaction endorsement, transaction ordering, and transaction validation, optimizing for performance and scalability.
In contrast, blockchains like Ethereum rely on a single process (e.g., miners) to handle all of these functions, which can introduce bottlenecks and limit throughput, especially when the network is congested.
No Native Cryptocurrency
Fabric does not require a native cryptocurrency to operate, making it more suited for enterprise use cases where tokenization may not be necessary or desired.
Many public blockchains are tied to cryptocurrencies (like Ether on Ethereum), which can introduce regulatory and volatility issues for businesses.
Integration with Existing Systems
Hyperledger Fabric is designed with integration in mind. It can be integrated into existing enterprise systems, such as enterprise resource planning (ERP) tools, customer relationship management (CRM) software, and even off-chain databases (e.g., AWS RDS for Postgres, as in your QED Blockchain project).
Other blockchains might not have the same level of integration flexibility due to their public, decentralized nature.
Governance and Collaboration Hyperledger Fabric is governed by The Linux Foundation, with contributions from major tech companies like IBM, Intel, and SAP. This collaboration ensures that Fabric remains enterprise-focused and evolves based on industry needs.
Many public blockchains are governed by decentralized communities, which can lead to slower decision-making processes and make it harder for businesses to influence the development roadmap.
Regulatory Compliance
The permissioned nature of Fabric allows for more straightforward compliance with regulatory frameworks like GDPR and HIPAA, where data privacy and control are crucial.
Public blockchains, due to their openness, can pose challenges in meeting stringent regulatory requirements.
Amazon EKS
Amazon EKS offers several unique benefits for running Kubernetes in the cloud:
Managed Control Plane: EKS automates control plane management, ensuring high availability across multiple AWS Availability Zones.
AWS Integration: Seamlessly integrates with AWS services like VPC, IAM, and CloudWatch, simplifying infrastructure management.
Security: Provides automatic patching, data encryption, and private cluster support for enhanced security.
Scalability: Supports auto-scaling with Cluster Autoscaler and Managed Node Groups, allowing dynamic scaling based on workload demand.
Open-Source Compatibility: EKS runs standard Kubernetes, ensuring full compatibility with other environments.
Serverless with Fargate: EKS integrates with AWS Fargate for serverless Kubernetes, eliminating the need to manage servers.
Cost Efficiency: Pay-as-you-go pricing ensures you only pay for what you use, with auto-scaling reducing unnecessary costs.
Observability: Native integration with CloudWatch, plus support for Prometheus and Grafana for enhanced monitoring.
These features make EKS a secure, scalable, and cost-effective option for Kubernetes in the cloud.
Amazon RDS for PostgreSQL offers several key benefits:[4]
Managed Service: Automates database maintenance, backups, and patching, reducing manual overhead.
High Availability: Multi-AZ deployments and read replicas provide improved uptime and performance.
Scalability: Easily scale compute and storage resources with vertical scaling and storage auto-scaling.
Security: Supports encryption, IAM integration, VPC isolation, and automatic security updates.
Performance: Optimized for high throughput with provisioned IOPS, and integrated monitoring via CloudWatch.
Cost Efficiency: Pay-as-you-go pricing with the option for reserved instances for long-term savings.
PostgreSQL Extensions: Supports popular PostgreSQL extensions like PostGIS.
Compliance: Meets various regulatory compliance standards like HIPAA and GDPR.
These features make RDS PostgreSQL a secure, scalable, and cost-effective database solution.
NestJS[5] benefits for building scalable server-side applications:
Modular Architecture: Promotes clean code organization and scalability through reusable modules.
TypeScript Support: Provides strong typing, better tooling, and fewer runtime errors, while also supporting JavaScript.
Dependency Injection: Built-in DI system helps create decoupled, maintainable components.
Express/Fastify Integration: Works with Express or Fastify, providing flexibility and familiarity for API development.
Microservices Support: Enables microservices architecture with support for multiple transport layers like HTTP, WebSockets, and message brokers.
Rich Features: Offers out-of-the-box features like routing, validation, middleware, and guards, reducing boilerplate code.
Extensible: Easy integration with third-party libraries and built-in support for GraphQL, REST APIs, and WebSockets.
Testability: Emphasizes testing with built-in tools for unit and integration tests.
Active Ecosystem: Strong community support and enterprise adoption make it a robust choice for large-scale applications.
These features make NestJS a powerful, flexible framework for scalable server-side applications.
React.js[6] benefits for building user interfaces and web applications:
Component-Based Architecture: Encourages reusable, modular components that simplify code organization and maintenance.
Virtual DOM: React uses a virtual DOM for efficient updates, improving app performance by minimizing direct DOM manipulation.
Declarative Syntax: Makes it easy to build interactive UIs by focusing on what the UI should look like, rather than how to manipulate the DOM.
One-Way Data Binding: Ensures a predictable data flow, making it easier to debug and understand application logic.
Rich Ecosystem: React has a vast library of tools, components, and extensions, along with support for libraries like Redux for state management.
Strong Community Support: React has a large, active community with extensive resources, tutorials, and third-party integrations.
JSX Syntax: Combines HTML with JavaScript, making it intuitive to build UI components and manage logic in a single file.
Cross-Platform Development: React Native extends React’s capabilities to mobile development, enabling developers to build native mobile apps using the same framework.
These features make React.js a popular, efficient, and flexible choice for building modern web applications.
Node and Network Architecture
QED Blockchain employs a robust and scalable architecture based on the following components:
Peer Nodes: Execute transactions, maintain ledgers, and participate in the consensus process. Each organization deploys peer nodes to validate and endorse transactions.
Orderer Nodes: Manage the ordering of transactions using the Raft consensus protocol, ensuring transaction consistency and integrity.
Certificate Authority (CA): Issues and manages digital certificates for identity management and network authentication using a PKI system.
Each organization in the network can deploy its own nodes, which collaborate to maintain the shared blockchain ledger. With peer nodes load-balanced and multiple orderer nodes providing crash fault tolerance, the QED Blockchain network is designed for resilience and scalability.
QED Blockchain Architecture Diagram:
3.3 Use Cases
Hyperledger Fabric can be applied in various scenarios, including:
Supply chain tracking
Identity management
Asset tokenization
Financial transactions
QED application aims to provide Identity Management and Asset Tokenization along with maintaining the lineage of asset. The application certifies assets authenticity and enhances visibility into the lifecycle throughout the supply chain helping to prove the provenance and origin of assets.
Supply Chain Provenance
Product authenticity: QED can help verify the authenticity of products, reducing the prevalence of counterfeit goods in the market.
Sustainability and ethical sourcing: QED can help verify that products are sustainably and ethically sourced, enabling consumers to make more informed purchasing decisions.
Authenticity
QED can play a crucial role in ensuring authenticity in the digital realm, especially in the face of growing threats from AI-generated content, deep fakes, and other manipulations of information. Here are a few ways QED can be used to address these challenges:
Product Authenticity
Counterfeit goods: QED can help verify the authenticity of products, reducing the prevalence of counterfeit goods in the market and protecting both consumers and brands from fraud.
Provenance: QED can be used to trace the origin and supply chain of products, ensuring their authenticity and enabling consumers to make more informed purchasing decisions.
Secondary Markets
QED Vault gives creators of items visibility into secondary buyers of items, servicing and modifications, and other pertinent data that helps understand where an item goes after it leaves the creator’s confines.
When an item with a QED token is traded in the secondary market, the item’s producer can track the item’s lineage and transfer of ownership. Moreover, rules can be set on the timeframes and other considerations for transfer as desired. Examples include terms of warranty, special pricing, etc.
Consider that many manufacturers of luxury goods limit access to their most coveted products. For example, you cannot walk into a Hermes store and purchase a Birkin bag. Those bags are reserved for ‘power’ customers, those who buy a lot of other Hermes products.
Such bags can be resold for more than the purchase price. Such bags are often counterfeited. Providing a QED token with a bag increases the value to all parties in a secondary transaction. Authenticity transferable and auditable by a prospective buyer enhances confidence for the transaction parties.
QED tokens also greatly benefit the producer of such goods. They can see who is buying and reselling their items. This opens more efficacious direct marketing opportunities with lower cost per sale and improved lifetime value of a customer.
In the example of the Hermes handbag, a patron could try to build their status as a customer through buying and reselling, even at small loss, some Hermes goods. This would qualify the patron to then purchase items with more prestige and higher secondary prices, such as Birkin bags, that can be sold at a profit.
Manufacturers, armed with insights derived from token histories, can discern genuine customers from opportunistic resellers and allocate access to exclusive products accordingly. In essence, by offering customers a seamless means of authenticating their items at the time of sale, producers stand to gain profound insights into the behaviors and preferences of secondary market consumers, fostering a more informed and strategic approach to customer engagement.
QED tokens and illegal uses
Given the nature of blockchain, providing a record of each transaction, QED tokens are poorly suited to be used for illegal purposes. When something illegitimate is introduced into the blockchain it is possible to trace such an item back to the person who introduced it.
4. Application Architecture
4.1 High-Level Architecture
The application consists of the following components:
Client Application: User interface for interaction with the blockchain.
Fabric Network: Composed of peers, orderers, and channels.
Asset Registry: A ledger maintaining details of each tokenized asset.
Chaincode: Smart contracts that define the rules for token creation, transfer, and ownership management.
Database: For storing non-blockchain data (PostgreSQL).
Identity Management: Controls user access and permissions.
REST API: NestJS
Front End: Reactjs
4.2 Component Interaction
Clients interact with the Fabric network via SDKs (GO).
Chaincode handles business logic and state changes.
The ordering service manages the transaction order and consensus.
5. Implementation Details
5.1 Setting Up the Fabric Network
Prerequisites: Docker, Docker Compose, Go, Node.js.
Network Configuration: Define the network topology, including peers and orderers in a YAML file.
Chaincode Development: Write chaincode in Go or Node.js to implement business logic.
Deployment: Use the Hyperledger Fabric CLI or SDK to deploy the network and chaincode.
5.2 Smart Contract Design
Data Structures: Define structures representing assets or entities.
Functions: Implement functions for creating, updating, and querying data.
Access Control: Implement access control to restrict certain operations based on user roles.
6. Security Considerations
6.1 Data Privacy
Encryption: Data in transit and at rest is encrypted to protect sensitive information.
Access Control: Use role-based access control to enforce permissions on chaincode.
6.2 Network Security
Identity Management: Leverage certificate authorities (CAs) to issue digital certificates for users and nodes.
Audit Logging: Maintain logs of all transactions for compliance and monitoring.
7. Benefits
7.1 Enhanced Trust
By providing a transparent and immutable ledger, the application fosters trust among participants.
7.2 Improved Efficiency
Automating processes through smart contracts reduces the need for intermediaries, thereby streamlining operations.
7.3 Cost Reduction
Lower operational costs due to increased efficiency and reduced fraud.
8. Conclusion
The implementation of a Hyperledger Fabric-based application can significantly enhance the operational capabilities of tokenizing real world assets and tracking the lineage. Through this whitepaper, we have outlined the technical aspects and benefits of deploying such a solution. Future work will focus on scaling the application and exploring additional use cases within the Hyperledger ecosystem.
9. References
10. Appendices
10.1 Glossary of Terms
Blockchain: A distributed ledger technology.
Chaincode: Smart contracts in Hyperledger Fabric.
Peer: A node in the blockchain network that stores the ledger.
Orderer: A node that manages transaction ordering.
10.2 Technical Specifications
Programming Languages: Reactjs, NestJS, Go
Onchain Database (In hyperledger fabric): LevelDB, CouchDB
Offchain Database: PostgreSQL
Document Storage: S3 Bucket
ORM: Prisma
Deployment Tools: Kubernetes (AWS EKS).
This whitepaper provides a comprehensive overview of a QED application, detailing its architecture, implementation, and potential benefits. It serves as a foundational document for stakeholders interested in exploring blockchain solutions by creating tokens for real world assets and tracking its propagation to current owner.
Last updated