Mysterium Network Integration: Decentralized VPN, SDK, API

Integration with Mysterium Network A specific scenario: you are building an application that needs a decentralized VPN or residential proxy — without a single provider, without KYC on users, with crypto payment. For example, you need to scrape data from sites that block datacenter IPs, or ensure

Blockchain Development Services

Frequently Asked Questions

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1450
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1308
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    1003
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1269
  • image_logo-advance_0.webp
    B2B Advance company logo design
    717
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    1008

Integration with Mysterium Network

A specific scenario: you are building an application that needs a decentralized VPN or residential proxy — without a single provider, without KYC on users, with crypto payment. For example, you need to scrape data from sites that block datacenter IPs, or ensure privacy for mobile app users without collecting personal data. Mysterium Network is a p2p network of ~13,000 nodes, operating on Proof-of-Traffic. Each participant can sell unused traffic for MYST tokens. For a developer, the task is not just "connect to a VPN", but to embed Mysterium into your application as a programmable transport layer.

We have been integrating decentralized networks for over five years and have completed more than 50 projects, several specifically on Mysterium. In one case, a client saved up to 90% compared to standard residential proxy rates.

How Mysterium Handles Payments

Mysterium uses payment channels via the Hermes contract on Polygon. This is off-chain micropayments with periodic settlement. Programmatic top-up is a direct MYST transfer via ethers.js. Below is an example of creating a payment channel:

const channelAddress = await api.paymentOrderGetChannelAddress(identity.id); const order = await api.paymentOrderCreate(identity.id, { mystAmount: "10.0", payCurrency: "USD", gateway: "coingate", country: "US", callerData: "{}", }); console.log("Payment URL:", order.publicGatewayData.paymentUrl); 

Wireguard is the transport protocol on which the Mysterium network is built. It provides minimal latency and high throughput.

Mysterium Architecture: Under the Hood

Mysterium operates on top of several protocols. Here is their comparison:

Protocol Purpose When to Use
Wireguard Core VPN (UDP, fast) High bandwidth, modern clients
OpenVPN Legacy, compatibility Old devices, specific configurations
NATS Discovery and signaling Node discovery, signal passing
Hermes Payment settlement on Polygon Off-chain micropayments

The key component for developers is the SDK mysterium-vpn-js (TypeScript) and the node REST API (tequilapi).

How to Connect via SDK

The SDK allows you to manage the node and sessions programmatically. Example of basic startup:

import { TequilapiClientFactory, NodeHttpTransport } from "mysterium-vpn-js"; const factory = new TequilapiClientFactory( "http://127.0.0.1:4050", 5000 ); const api = factory.build(NodeHttpTransport()); const nodeInfo = await api.healthCheck(); console.log("Node version:", nodeInfo.version); const proposals = await api.findProposals({ serviceType: "wireguard", qualityMin: 0.9, locationCountry: "DE", }); 

Session Creation, Management, and Monitoring

const identities = await api.identityList(); if (identities.length === 0) { const identity = await api.identityCreate("your_passphrase"); await api.identityRegister(identity.id, { token: undefined }); } const identity = identities[0]; const status = await api.identityStatus(identity.id); if (status.registrationStatus !== "Registered") { throw new Error("Identity not registered"); } const connection = await api.connectionCreate({ consumerId: identity.id, providerId: proposals[0].providerId, serviceType: "wireguard", connectOptions: { dnsOption: "auto" } }); console.log("Session ID:", connection.sessionId); const stats = await api.connectionStatistics(); console.log({ bytesSent: stats.bytesSent, bytesReceived: stats.bytesReceived, tokensSpent: stats.tokensSpent, duration: stats.duration }); const location = await api.connectionLocation(); console.log("Exit IP:", location.ip, "Country:", location.country); await api.connectionCancel(); 

Why Use a Custom Discovery?

By default, a Mysterium node uses the centralized Discovery service of Mysterium Foundation. For enterprise or private networks, you need self-hosted NATS:

version: '3.8' services: nats: image: nats:2.9-alpine ports: - "4222:4222" - "8222:8222" command: "--jetstream --cluster_name mysterium-private" discovery: image: mysteriumnetwork/discovery:latest environment: - NATS_URL=nats://nats:4222 - BROKER_ADDRESS=nats://nats:4222 depends_on: - nats 

Nodes are configured with --discovery.address pointing to your NATS. This gives you full control over the provider list and connection quality.

Common Mistake: Lack of Fallback

Mysterium does not guarantee stable bandwidth. For critical applications, incorporate a fallback provider. We implement switching logic based on response time and errors. Testing during integration reveals up to 30% of nodes with poor performance — we exclude them from the pool.

Cost Comparison: Mysterium vs. Traditional Residential Proxies

Parameter Mysterium Oxylabs/Brightdata
Price per GB Up to 90% cheaper High
KYC Not required Required
Bandwidth 10–100 Mbps 100–1000 Mbps
Available geolocations ~130 countries ~150 countries

Mysterium is significantly cheaper than traditional residential proxies, providing substantial savings for large-scale scraping.

Typical Use Cases

  • Decentralized proxy for web scraping — Replace rotating residential proxies with Mysterium. Reliability varies, so we incorporate fallback.
  • Privacy-preserving API calls — A mobile application hides the user's IP through Mysterium.
  • Geo-distributed testing — Test from different geolocations without renting VPS.

Limitations: Mysterium does not guarantee bandwidth or uptime. For latency-sensitive applications, a fallback is required. Our integration includes provider switching logic.

What We Deliver in the Integration: Deliverables

  • SDK integration module for Mysterium into your code (TypeScript/JavaScript).
  • Setup and launch of a test node with a payment channel on Polygon.
  • Implementation of self-hosted Discovery on NATS (optional).
  • Automatic MYST balance top-up and cost monitoring.
  • Documentation for API, configuration, and troubleshooting.
  • Team training (2–3 hour workshop).
  • One month of post-release support.

How We Help with Integration: Step-by-Step Algorithm

  1. Analyze your scenario and architecture.
  2. Set up and launch a test Mysterium node.
  3. Integrate the SDK into your application.
  4. Implement the payment layer via Polygon (MYST balance, top-up, monitoring).
  5. Optionally: deploy a custom Discovery service (NATS).
  6. Prepare operational documentation and troubleshooting.
  7. Provide post-release support.

A typical integration takes from 2 weeks; full custom work up to 10 weeks. Get a consultation — contact us to discuss your project and get a free estimate of the work scope.