Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
LABS
Guides

Setting Up a Hybrid Blockchain for Public Transparency and Private Business Logic

A developer tutorial for building a supply chain system where public blockchains provide immutable provenance records, while confidential business logic runs on a private sidechain or using ZK proofs.
Chainscore © 2026
introduction
IMPLEMENTATION GUIDE

Introduction to Hybrid Blockchain Architecture for Supply Chains

This guide details the technical architecture for a supply chain system that uses a public blockchain for transparency and a private ledger for confidential business logic.

A hybrid blockchain architecture combines the immutable, trustless nature of a public chain with the privacy and performance of a private, permissioned system. For supply chains, this means anchoring critical, non-sensitive events—like a shipment's departure or customs clearance—on a public ledger such as Ethereum or Polygon. This creates a verifiable, tamper-proof audit trail for regulators and end-consumers. Meanwhile, sensitive business data, including pricing, supplier contracts, and internal quality reports, is managed off-chain in a private database or a permissioned blockchain like Hyperledger Fabric. This separation ensures compliance and transparency without exposing competitive information.

The core technical challenge is securely linking the two systems. This is achieved through cryptographic commit-reveal schemes and data anchoring. A common pattern is to generate a cryptographic hash (e.g., SHA-256) of a batch of private transaction data and post only that hash to the public chain. The hash acts as a digital fingerprint; if the underlying private data is later altered, the hash will not match, proving tampering. Tools like IPFS (InterPlanetary File System) can store the encrypted private data, with the content identifier (CID) referenced on-chain. Oracles, such as Chainlink, can be used to trigger public smart contract events based on verified real-world data from the private system.

Setting up this architecture begins with defining the data segregation policy. Determine which events are public (e.g., ProductShipped, BatchCertified) and which are private (e.g., InvoiceCreated, SupplierScoreUpdated). Next, deploy a smart contract on your chosen public testnet (like Sepolia or Mumbai) to act as your notary. A basic contract might have a function like anchorData(bytes32 _hash) that emits an event logged permanently on-chain. Your private system, built with a framework like Fabric or even a secure API backend, will compute hashes of its private data batches and call this public function, creating an indelible link.

Here is a simplified example of an anchoring smart contract in Solidity:

solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

contract SupplyChainAnchor {
    event DataAnchored(address indexed sender, bytes32 dataHash, uint256 timestamp);

    function anchorHash(bytes32 _dataHash) external {
        emit DataAnchored(msg.sender, _dataHash, block.timestamp);
    }
}

Your off-chain application would use a library like web3.js or ethers.js to interact with this contract. After a private transaction, compute const dataHash = ethers.utils.keccak256(JSON.stringify(privateData)) and send a transaction to anchorHash(dataHash).

For verification, a consumer-facing dApp can provide a seamless experience. A user scanning a QR code on a product could query the public blockchain to fetch the hashes of key events. Your backend can then provide the corresponding private data (or a redacted version) and a cryptographic proof. The dApp recalculates the hash from the provided data and compares it to the on-chain hash; a match proves data integrity. This model is used by projects like IBM Food Trust and VeChain to provide provenance without disclosing entire business networks.

Key operational considerations include managing gas costs on the public chain by batching anchors, ensuring the private system's high availability, and implementing robust key management for transaction signing. The hybrid model future-proofs your supply chain by leveraging public blockchain as a neutral trust layer while maintaining the operational flexibility and confidentiality required for enterprise business logic.

prerequisites
FOUNDATION

Prerequisites and System Requirements

Before building a hybrid blockchain, you must establish a robust technical foundation. This guide outlines the essential hardware, software, and conceptual knowledge required for a secure and functional deployment.

A hybrid blockchain combines a public ledger for transparency with a private network for confidential business logic. The core prerequisite is a clear architectural separation between these layers. You'll need a public chain like Ethereum or Polygon for the immutable, transparent component, and a permissioned framework like Hyperledger Besu or GoQuorum for the private, high-throughput side. Understanding the consensus mechanism for each layer is critical: Proof-of-Stake (PoS) for the public side and a Byzantine Fault Tolerant (BFT) consensus like IBFT for the private network.

Your development environment must support both ecosystems. Essential software includes Node.js (v18+) or Python (3.10+) for tooling, Docker and Docker Compose for containerized node deployment, and a package manager like npm or yarn. You will also need the core blockchain clients: an Ethereum execution client (e.g., Geth, Nethermind) for the public layer and a configured Besu or GoQuorum binary for the private network. Familiarity with smart contract development using Solidity (for EVM chains) and the Truffle Suite or Hardhat framework is mandatory for deploying business logic.

For system requirements, allocate separate infrastructure for each layer. The public chain node can run on a machine with 4+ CPU cores, 8GB RAM, and a 500GB SSD (storage requirements vary by chain). The private network nodes, which handle sensitive transactions, demand higher performance: 8+ CPU cores, 16GB RAM, and a 1TB NVMe SSD per node for optimal throughput. A stable, low-latency network connection is non-negotiable for inter-node communication and bridge operations. All systems should run a modern Linux distribution like Ubuntu 22.04 LTS.

Security prerequisites are paramount. You must manage cryptographic key pairs for node identities and transaction signing. Tools like Hashicorp Vault or a dedicated Hardware Security Module (HSM) are recommended for private key storage. Network security involves configuring firewalls to expose only necessary P2P and RPC ports (e.g., 30303, 8545) and setting up TLS certificates for secure API endpoints. A foundational understanding of public-key infrastructure (PKI) is necessary to establish trust between your private consortium members.

Finally, prepare your toolchain for the bridge or oracle that will connect the two layers. This may involve installing a message relayer like Axelar's General Message Passing SDK or a verification smart contract on the public chain. You should have testnet tokens (e.g., Sepolia ETH) for deployment trials and monitoring tools like Prometheus and Grafana configured to track node health, block production, and cross-chain message latency from day one.

architecture-overview
TUTORIAL

System Architecture: Public Ledger and Private Sidechain

A guide to implementing a hybrid blockchain architecture that combines a public ledger for transparency with a private sidechain for confidential business logic.

A hybrid blockchain architecture separates application logic into two distinct layers. The public ledger, typically a Layer 1 like Ethereum or a public L2, serves as the immutable, transparent anchor for the system. It records final state commitments, handles native token transfers, and provides censorship resistance. The private sidechain is a permissioned network, often built with frameworks like Hyperledger Besu or Polygon Edge, that executes the core business logic. This separation allows you to leverage public blockchain security for critical data while keeping sensitive operations private and scalable.

The core of this design is a bridging mechanism that securely connects the two chains. This is usually implemented as a set of smart contracts on the public ledger and corresponding components on the sidechain. A common pattern uses a state root relay. The sidechain periodically submits a cryptographic hash (a Merkle root) of its entire state to the public ledger contract. This single hash acts as a compact, verifiable proof. Users can then submit Merkle proofs to the public contract to verify the inclusion and validity of specific transactions or data from the private sidechain without exposing the underlying details.

Setting up the private sidechain requires configuring a permissioned consensus mechanism like IBFT 2.0 or Clique PoA. This involves defining a genesis block with a set of validator nodes and setting network parameters. For development, you can use geth in private mode or a dedicated SDK. The key is to implement a cross-chain messaging protocol. When a user initiates an action on the public chain that requires private processing, the bridge contract locks the assets and emits an event. An off-chain relayer or oracle service watches for this event and forwards a message to the sidechain, triggering the private smart contract execution.

Here is a simplified example of a public ledger bridge contract function for depositing funds and initiating a private process:

solidity
function depositToSidechain(uint256 amount, bytes32 privateRecipient) external {
    require(token.transferFrom(msg.sender, address(this), amount), "Transfer failed");
    lockedBalance[privateRecipient] += amount;
    // Emit an event for the sidechain relayer to pick up
    emit DepositInitiated(msg.sender, privateRecipient, amount, block.timestamp);
}

The corresponding sidechain contract would mint a wrapped representation of the asset upon verifying the event proof, enabling private DeFi operations or confidential computation.

This architecture is ideal for enterprise use cases requiring selective transparency. Supply chain solutions can publish final product provenance hashes to the public ledger while keeping detailed supplier data and pricing private. In finance, a trading platform can settle net positions on a public chain for auditability while executing the high-frequency matching logic privately. The main trade-offs involve bridge security—the relayers must be trusted or decentralized—and data availability, as the private chain's data is not publicly verifiable, placing trust in the sidechain validators.

component-selection
HYBRID BLOCKCHAIN

Choosing Your Technology Stack

Selecting the right components to build a blockchain that combines public data transparency with confidential business logic.

step-1-public-layer
HYBRID BLOCKCHAIN FOUNDATION

Step 1: Deploying the Public Transparency Layer

This guide details the initial step of establishing a public blockchain layer to serve as the immutable, transparent ledger for a hybrid architecture.

The public layer is the foundational component of a hybrid blockchain, designed to record immutable proofs of events from private, permissioned networks. It does not store sensitive business data; instead, it publishes cryptographic commitments—such as Merkle roots or zero-knowledge proofs (ZKPs)—that verify the integrity and correct execution of private transactions. This creates a public, verifiable audit trail without exposing confidential information. For example, a supply chain consortium can publish a hash of a shipment's verification data on-chain, proving an event occurred without revealing the shipment's contents or parties involved.

To deploy this layer, you typically select a public blockchain optimized for data availability and low-cost, permanent storage. Networks like Ethereum, Arbitrum, or Polygon are common choices due to their robust security and developer tooling. The core technical component is a smart contract—often called a verifier contract or state commitment contract—deployed to this public chain. This contract's primary function is to receive and store state updates from the private network. A basic Solidity skeleton for such a contract might include a function to accept new root hashes, restricted to calls from a designated relayer address.

Here is a simplified example of a state commitment contract:

solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

contract PublicTransparencyLayer {
    address public immutable relayer;
    bytes32 public latestStateRoot;
    uint256 public blockNumber;

    event StateRootUpdated(bytes32 indexed newRoot, uint256 indexed blockNumber);

    constructor(address _relayer) {
        relayer = _relayer;
    }

    function updateStateRoot(bytes32 _newStateRoot) external {
        require(msg.sender == relayer, "Unauthorized");
        latestStateRoot = _newStateRoot;
        blockNumber = block.number;
        emit StateRootUpdated(_newStateRoot, block.number);
    }
}

This contract stores the latest Merkle root representing the state of the private chain and emits an event for easy off-chain indexing.

The deployment process involves compiling this contract using a tool like Hardhat or Foundry, and deploying it via a script to your chosen public testnet or mainnet. You must fund the deployer address with the native token (e.g., ETH, MATIC) to pay for gas. After deployment, securely note the contract address and the transaction hash—these are essential for the next integration steps. It is critical to properly configure the relayer address in the constructor, as this will be the only entity permitted to submit updates, typically a secure server orchestrating the cross-chain communication.

Finally, the public layer must be connected to the private network. This requires setting up a relayer service or oracle that monitors the private chain. When the private chain produces a new block, this service calculates the new state root, signs the data, and calls the updateStateRoot function on the public contract. This creates a cryptographic link between the private operational data and the public ledger. The cost and frequency of these updates are key design considerations, influencing the choice of public chain based on its transaction fees and finality time.

step-2-private-layer
ARCHITECTURE

Step 2: Setting Up the Private Computation Layer

Configure the confidential execution environment where sensitive business logic runs, isolated from the public chain.

The private computation layer is the secure enclave where your application's proprietary logic executes. This layer does not run on the public blockchain's virtual machine. Instead, it operates in a trusted execution environment (TEE) like Intel SGX or a zero-knowledge virtual machine (zkVM). The primary function is to process private inputs—such as trade details, user identities, or proprietary algorithms—and produce verifiable outputs or proofs without revealing the underlying data. This separation is the core of the hybrid model, enabling compliance and confidentiality.

To set up this layer, you must first choose your confidentiality technology. For a TEE-based approach, you would deploy your smart contract logic inside an SGX enclave using a framework like Ethereum's Enclave or a dedicated confidential blockchain like Secret Network. For a zkVM approach, you write circuits in a language like Circom or Noir that define your computation. The code here is your private business logic: a loan eligibility check, a dark pool trading algorithm, or a medical diagnosis model that must remain secret.

A critical step is defining the interface between the public and private layers. The public smart contract on-chain (e.g., on Ethereum or Polygon) will call into the private layer via a secure verification function. For a zkVM, this means the private layer generates a zero-knowledge proof (ZKP), like a zk-SNARK, attesting to the correct execution of the private logic. The public contract only needs to verify this proof, a cheap and fast operation. For a TEE, the interface is often an attestation that the code is running in a genuine, unmodified enclave.

Here is a simplified conceptual flow using a zk-SNARK circuit written in Circom for a private credit score check:

circom
template PrivateCreditCheck() {
    signal private input creditScore;
    signal private input threshold;
    signal output isApproved;

    // Private logic: approve if score > threshold
    isApproved <-- creditScore > threshold ? 1 : 0;
    isApproved === 1 || isApproved === 0; // Constrain output
}

This circuit remains private. Only the proof of its execution and the public output (isApproved) are posted on-chain.

Finally, you must deploy and orchestrate the private layer's runtime. This often involves running a node or a prover service that is authorized to compute over encrypted data or generate proofs. Services like Aleo's prover network or Aztec's sequencer handle this. Ensure this service is highly available and securely communicates with the public chain's RPC endpoint. The public contract's address must be configured to trust the verifier contract or attestation verifier for your specific private application, completing the bridge between the transparent and confidential layers of your hybrid blockchain.

step-3-bridge-oracle
ARCHITECTURE

Step 3: Building the Cross-Chain Bridge or Oracle

This step details the core infrastructure that connects your private blockchain to the public ledger, enabling selective data verification and interoperability.

A hybrid blockchain architecture requires a secure communication channel between its private, permissioned chain and a public network like Ethereum or Solana. This is achieved by deploying a cross-chain bridge or a decentralized oracle. The bridge facilitates asset and message transfer, while an oracle typically focuses on data attestation. For business logic privacy, you will design a system where sensitive operations remain on the private chain, and only cryptographic proofs or state commitments are published on-chain for public verification.

The core component is a set of relayer nodes or oracle nodes that monitor events on both chains. When a verifiable event occurs on the private chain (e.g., a finalized transaction batch), these nodes generate a zero-knowledge proof (like a zk-SNARK) or a Merkle root of the state. This proof is then submitted to a smart contract on the public chain. The public contract verifies the proof's validity without revealing the underlying private data, thus attesting to the integrity of the off-chain operations.

For implementation, you can use frameworks like Chainlink Functions for oracle-based data posting or build a custom bridge using Axelar or Wormhole's Generic Message Passing. A simpler attestation bridge can be built with an Ethereum Verifier Contract that accepts proofs from a Circom or Halo2 circuit. The private chain client must emit standardized events that the relayer can parse and prove. Key design considerations include the finality mechanism of your private chain and the economic security (staking/slashing) of the relayers.

Here is a conceptual flow for a zk-based attestation bridge:

  1. Private Chain Finalization: A batch of business logic transactions is executed and finalized on the private Tendermint or Hyperledger Besu network.
  2. Proof Generation: A prover service (e.g., using gnark) generates a zk-SNARK proof attesting that the new state root is the correct result of applying the valid, private transactions.
  3. Public Verification: The relayer submits the new state root and the zk-proof to the Verifier.sol contract on Ethereum.
  4. State Update: The public contract verifies the proof in constant time. If valid, it updates its stored commitment to the private chain's state, making it publicly verifiable.

Security is paramount. Avoid centralized relayers which become single points of failure. Implement a validator set with distributed key management. Use time-locks and fraud-proof windows to allow challenges to invalid state transitions. Regularly audit both the proof circuits (e.g., with Veridise) and the bridge contracts. This setup ensures your private business logic remains confidential while leveraging the immutable audit trail and network security of the public blockchain.

ARCHITECTURE

Comparison of Public and Private Layer Options

Key technical and operational differences between common public and private blockchain layers for hybrid design.

Feature / MetricPublic Layer (e.g., Ethereum, Arbitrum)Private Layer (e.g., Hyperledger Besu, Quorum)Hybrid Orchestrator (e.g., Chainlink CCIP, Axelar)

Consensus Mechanism

PoS / PoW (Permissionless)

IBFT / Raft (Permissioned)

External Validator Set

Transaction Finality

~12 sec (Ethereum)

< 1 sec

Varies by bridge (2-30 min)

Transaction Cost

$0.50 - $50+ (variable gas)

$0 (internal token or free)

$0.10 - $5 (bridge fees)

Data Privacy

Fully transparent

Fully private / encrypted

Selective state proofs only

Smart Contract Compatibility

EVM / Solidity

EVM / Solidity, Java

Message passing, not execution

Developer Tooling

Extensive (Hardhat, Foundry)

Enterprise-focused

Bridge SDKs and APIs

Regulatory Compliance

Pseudonymous, complex

Built-in KYC/AML modules

Depends on connected chains

Primary Use Case

Token transfers, DeFi, NFTs

Supply chain, internal records

Cross-chain asset/state transfer

step-4-zk-proofs
ADVANCED PRIVACY

Step 4: Integrating Zero-Knowledge Proofs (Optional)

This optional step enhances your hybrid blockchain by using zero-knowledge proofs (ZKPs) to verify private business logic without revealing sensitive data, enabling public auditability of private operations.

Zero-knowledge proofs allow one party (the prover) to convince another (the verifier) that a statement is true without revealing any information beyond the validity of the statement itself. In a hybrid blockchain context, this is powerful for private smart contracts or off-chain computations. You can generate a ZKP that proves a transaction adheres to business rules—like a credit score check or a proprietary trading algorithm—and then post only the compact proof to the public ledger. This creates a cryptographic guarantee of correct execution, satisfying the need for public transparency and regulatory compliance while keeping the underlying logic and data confidential.

To implement this, you typically separate your application into a private off-chain component and a public on-chain verifier. The private component, often written in a ZK-friendly language like Circom or Noir, defines the constraints of your business logic (the circuit). When a transaction is processed privately, this circuit generates a proof using a proving key. The corresponding verification key and the proof are then submitted to a verifier smart contract on the public chain. Popular libraries like SnarkJS (for Groth16/PLONK) or Halo2 provide the tooling to generate these circuits and handle the proof generation and verification process.

A practical example is a private voting system. Votes are cast and tallied off-chain in a trusted execution environment (TEE) or secure multi-party computation (MPC) setup. Instead of publishing individual votes, the system generates a ZKP asserting that the final tally is correctly computed from valid, signed votes. The public smart contract, upon verifying this proof, can then release funds or trigger an event based on the outcome. This pattern is used by protocols like Aztec for private DeFi and Semaphore for anonymous signaling.

Integration requires careful setup. First, design and compile your ZK circuit. Next, conduct a trusted setup ceremony to generate the proving and verification keys, a critical step for security. Then, deploy the verifier contract—often auto-generated from your circuit—to your public chain. Your off-chain service must be modified to create proofs for each valid private transaction and submit them. Be mindful of gas costs; verifying proofs on-chain, especially on Ethereum Mainnet, can be expensive, though newer proof systems like PLONK and STARKs offer better scalability.

While optional, adding ZKPs significantly strengthens the trust model of a hybrid system. It moves beyond simple data hiding to providing verifiable correctness. However, it introduces complexity in development, auditing of circuit code, and operational overhead. For many business applications, this trade-off is justified by the need for auditable privacy, a key requirement in regulated industries like finance and healthcare where proving compliance without exposing sensitive data is paramount.

HYBRID BLOCKCHAIN SETUP

Frequently Asked Questions

Common technical questions and solutions for developers implementing hybrid blockchains that combine public transparency with private business logic.

A hybrid blockchain is a distributed ledger that combines elements of both public and private blockchains. It typically involves a public mainchain (like Ethereum or Polygon) for final settlement and transparency, and one or more private sidechains or layer-2 networks for executing confidential business logic.

How it works:

  1. Private Execution: Sensitive transactions and smart contract logic are processed off-chain in a permissioned environment (e.g., a Hyperledger Besu network, an Arbitrum Nitro chain with privacy features, or using a ZK-rollup like Aztec).
  2. Public Verification: Only cryptographic proofs (like zero-knowledge proofs) or hashed commitments of the private state are published to the public chain.
  3. Data Availability: Critical data for verification is made available, often via data availability committees or dedicated storage layers, ensuring the system's security without exposing raw private data.

This architecture allows enterprises to comply with regulations (like GDPR) by keeping customer data private, while still leveraging the trustless security and interoperability of a public blockchain for auditability and finality.

conclusion-next-steps
IMPLEMENTATION SUMMARY

Conclusion and Next Steps

This guide has outlined the architectural patterns and practical steps for deploying a hybrid blockchain that separates public data from private business logic.

You have now seen how to architect a system where a public layer, like Ethereum or Polygon, serves as a verifiable data ledger and settlement layer, while private, permissioned chains or state channels handle sensitive business operations. This model provides the transparency and security of public blockchains for critical data—such as transaction finality proofs, asset ownership, or audit trails—while keeping proprietary algorithms, user identities, and internal workflows confidential on a private network. The key is establishing a secure, trust-minimized bridge between the two environments using technologies like zero-knowledge proofs or optimistic verification.

For your next steps, begin by stress-testing your chosen architecture. Deploy a local testnet using frameworks like Hyperledger Besu for the private chain and connect it to a public testnet (e.g., Sepolia). Use a bridge solution like Chainlink CCIP or a custom light client relay to pass state proofs. Monitor for latency, gas costs on the public chain, and the security assumptions of your cross-chain messaging layer. Document the specific data hashes you commit to the public chain and the conditions that trigger a dispute or fraud proof on your private side.

To deepen your expertise, explore advanced privacy techniques. Implement zk-SNARKs using libraries like Circom and snarkjs to generate succinct proofs of valid private state transitions without revealing the underlying data. Alternatively, investigate rollup designs (optimistic or zk-rollups) as a structured pattern for batching and compressing private transactions before settling them on the public layer. Resources like the Ethereum Rollup Research and the zkSync documentation provide excellent starting points for these complex implementations.

Finally, consider the long-term evolution of your system. How will you handle upgrades to the private smart contract logic? Plan for a governance mechanism on the public chain to vote on and authorize upgrades to the bridge contract or verification keys. Establish clear monitoring for the public ledger's activity, as it is your source of truth. The hybrid model is not a set-and-forget solution; it requires active maintenance, auditing of the bridge security, and adaptation to new scaling and privacy primitives as the blockchain ecosystem matures.

How to Build a Hybrid Blockchain for Supply Chain Transparency | ChainScore Guides