Skip to content
VIA Labs

// CROSS-CHAIN COMMUNICATION

130+ Networks NPM Version Discord

The future of Web3 is unified and borderless

We enable true cross-chain innovation and private off-chain to on-chain connectivity


VIA Protocol allows developers to build applications that seamlessly operate across multiple blockchains and access private off chain data providing a unified experience for users regardless of their network from web2 to web3, large or small, public or private.


// Cross-Chain Native Tokens

Move custom tokens between chains without wrapping or bridges. One contract, multiple chains, native representation.

// Bridge tokens to another chain
function bridge(uint _destChainId, address _recipient, uint _amount) external {
    _burn(msg.sender, _amount);
    _sendMessage(_destChainId, abi.encode(_recipient, _amount));
    emit TokensBridged(msg.sender, _destChainId, _recipient, _amount);
}

// Process incoming tokens from another chain
function _processMessage(uint _sourceChainId, uint, bytes calldata _data) internal override {
    (address _recipient, uint _amount) = abi.decode(_data, (address, uint));
    _mint(_recipient, _amount);
    emit TokensReceived(_sourceChainId, _recipient, _amount);
}

// Cross-Chain NFTs

Seamless NFT transfers with metadata between networks. Preserve provenance and history across blockchain ecosystems.

// Bridge NFT to another chain
function bridge(uint _destChainId, address _recipient, uint _nftId) external {
    // Store metadata before burning
    NFTMetadata memory metadata = _tokenMetadata[_nftId];
    _burn(_nftId);
    _sendMessage(_destChainId, abi.encode(_recipient, _nftId, metadata));
    emit NFTBridged(msg.sender, _nftId, _destChainId, _recipient);
}

// Process incoming NFT from another chain
function _processMessage(uint _sourceChainId, uint, bytes calldata _data) internal override {
    (address _recipient, uint _nftId, NFTMetadata memory metadata) = 
        abi.decode(_data, (address, uint, NFTMetadata));
    
    // Mint the NFT on this chain with original metadata
    _mint(_recipient, _nftId);
    _tokenMetadata[_nftId] = metadata;
    
    emit NFTReceived(_recipient, _nftId, _sourceChainId);
}

// Private Oracles

Connect contracts to off-chain private data sources and APIs with secure oracles. Bring real-world data on-chain without compromising security.

// Request data from private oracle
function requestWeather(string memory _zipcode) external returns (uint) {
    uint requestId = nextRequestId++;
    bytes memory featureData = abi.encode(requestId, _zipcode);
    _sendMessageWithFeature(
        block.chainid,
        "",
        1,  // Feature ID for Private Oracle
        featureData
    );
    emit WeatherRequested(requestId, msg.sender, _zipcode);
    return requestId;
}

// Process incoming data from oracle
function _processMessageWithFeature(
    uint, uint, bytes memory, uint32, bytes memory, bytes memory _featureResponse
) internal override {
    // Decode the feature response
    (uint requestId, string memory temperature, string memory conditions, string memory location) = 
        abi.decode(_featureResponse, (uint, string, string, string));
    
    // Store the weather data
    weatherRequests[requestId].temperature = temperature;
    weatherRequests[requestId].conditions = conditions;
    weatherRequests[requestId].location = location;
    weatherRequests[requestId].timestamp = block.timestamp;
    weatherRequests[requestId].fulfilled = true;
    
    emit WeatherReceived(requestId, temperature, conditions, location);
}

Technical Architecture

VIA Protocol's architecture is built on three core components:

1. MessageClient

The MessageClient is a Solidity contract that provides a simple interface for cross-chain communication. It abstracts away the complexity of cross-chain messaging, allowing developers to focus on their application logic.

// Send a message to another chain
_sendMessage(destChainId, abi.encode(data));

// Process incoming messages
function _processMessage(uint _sourceChainId, uint, bytes calldata _data) internal virtual override {
    // Decode and process the message
    (address recipient, uint amount) = abi.decode(_data, (address, uint));
    // Your logic here
}

2. Decentralized Validator Network

Our protocol is secured by a decentralized network of validators that ensure transaction integrity and provide multi-layer consensus. This network:

  • Validates cross-chain messages
  • Ensures message delivery
  • Prevents double-spending
  • Maintains network security

3. Private Oracles

Private Oracles allows for extensible functionality beyond basic messaging:

  • Private Datasources: Connect smart contracts to off-chain databases or APIs
  • Custom Logic: Implement complex cross-chain business logic
  • Real World Reach: Communicate with real world devices through IoT APIs or embedded systems integrations

Getting Started

Jump right in with our quickstart repositories:

Create and deploy a cross-chain native ERC20 token in minutes.

git clone https://github.com/VIALabs-io/quickstart-token.git
cd quickstart-token
npm install
node scripts/deploy.js

Build a cross-chain native NFT collection with metadata preservation.

git clone https://github.com/VIALabs-io/quickstart-nft.git
cd quickstart-nft
npm install
node scripts/deploy.js

Connect your contracts to off-chain data sources.

git clone https://github.com/VIALabs-io/quickstart-oracle.git
cd quickstart-oracle
npm install
node scripts/deploy.js

🔗 Resources


Start Building Cross-Chain Today

Contact us at [email protected] for collaborations and partnerships

Pinned Loading

  1. contracts Public

    JavaScript 3 1

  2. client-stream-example Public

    TypeScript 1 1

Repositories

Showing 10 of 12 repositories
  • npm-registry Public
    JavaScript 0 0 0 0 Updated Apr 15, 2025
  • JavaScript 0 0 0 0 Updated Apr 10, 2025
  • CSS 1 0 0 0 Updated Apr 9, 2025
  • .github Public
    0 0 0 0 Updated Mar 31, 2025
  • JavaScript 0 1 0 0 Updated Mar 31, 2025
  • JavaScript 0 0 0 0 Updated Mar 31, 2025
  • node-project Public
    TypeScript 2 2 0 0 Updated Dec 15, 2024
  • node-core Public
    TypeScript 1 3 0 0 Updated Dec 15, 2024
  • contracts Public
    JavaScript 3 1 0 0 Updated Oct 30, 2024
  • npm-contracts Public
    Solidity 0 1 0 1 Updated Oct 27, 2024

People

This organization has no public members. You must be a member to see who’s a part of this organization.