🛰️ RPC Documentation

Overview of the JSON-RPC API methods specific to VIA.

VIA JSON-RPC API

VIA Network is a ZK Stack based blockchain implementation, providing EVM-compatible rollup features with additional multi-network support, including Bitcoin integration. This document outlines the RPC namespaces and methods available on VIA Network.

Compatibility Notes

  • All endpoints work identically to ZKsync, for more details ZKsync ZKS RPC API.

  • Some methods not relevant to VIA Network may return empty responses (e.g., features not currently supported by VIA network).

via_getBridgeAddress

Returns the L1 Bitcoin bridge address.

Parameters

  • None

Returns

  • A single string value representing the bridge address.

Example Request

curl -X POST https://testnet.via.onvia.org \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc":"2.0","method":"via_getBridgeAddress","params":[],"id":1}'

Example Response

{
    "jsonrpc":"2.0",
    "result":"tb1ppsy8j80jtns42rkpdsfcv25qfschqejxmk6datkvu236eekr4fms06wnz0",
    "id":1
}

via_getBitcoinNetwork

Returns the Bitcoin network (Mainnet, Testnet, Regtest).

Parameters

  • None

Returns

  • A single string value representing the network id.

Example Request

curl -X POST https://testnet.via.onvia.org \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc":"2.0","method":"via_getBitcoinNetwork","params":[],"id":1}'

Example Response

{
    "jsonrpc":"2.0",
    "result":"testnet",
    "id":1
}

Last updated