QVM - Quantum Virtual Machine

QSN native virtual machine with 180+ built-in opcodes, DeFi primitives, post-quantum cryptography, and Neural AI integration. 200,000+ TPS, BlockSTM parallel execution, Solidity, FunC, and Tact support.

QVM Performance

200,000+
Sustained TPS
~3s
Finality
180+
Opcodes
50-60%
Gas Reduction

.q Language - Native Smart Contract Language

.q is the native QVM language with first-class DeFi support, automatic overflow protection, and built-in post-quantum cryptographic primitives

First-class DeFi support (16 native opcodes)
Automatic overflow protection (checked arithmetic)
Native AMM, lending, and flash loan functions
Post-quantum cryptography built-in (Dilithium3, Kyber1024)
Zero-knowledge proof integration (zk-STARKs, Groth16)
Deterministic execution (NeuralScalar I64F64)
Cross-shard atomic operations

Example: QRC20 Token in .q

contract MyToken : QRC20 {
  string public name = "My Token";
  string public symbol = "MTK";
  uint256 public totalSupply = 1000000;

  // Автоматическая защита от переполнения
  function transfer(address to, uint256 amount) public returns (bool) {
    require(balances[msg.sender] >= amount, "Insufficient balance");

    balances[msg.sender] -= amount;  // Safe math встроен
    balances[to] += amount;

    emit Transfer(msg.sender, to, amount);
    return true;
  }

  // Нативная поддержка постквантовых подписей
  function transferPQ(address to, uint256 amount, bytes pqSignature) public {
    require(PQ_VERIFY_DILITHIUM(msg.sender, pqSignature), "Invalid PQ signature");
    transfer(to, amount);
  }
}

Example: DEX Contract with Native Primitives

contract SimpleDEX {
  mapping(address => uint256) public liquidityETH;
  mapping(address => uint256) public liquidityToken;

  // Использование нативного опкода DEFI_SWAP (0xE0)
  function swap(address tokenIn, uint256 amountIn) public returns (uint256) {
    // AMM формула x*y=k встроена в опкод
    uint256 amountOut = DEFI_SWAP(tokenIn, amountIn);

    emit Swap(msg.sender, tokenIn, amountIn, amountOut);
    return amountOut;
  }

  // Использование ADD_LIQUIDITY (0xE1)
  function addLiquidity(uint256 amountETH, uint256 amountToken) public {
    uint256 lpTokens = ADD_LIQUIDITY(amountETH, amountToken);

    liquidityETH[msg.sender] += amountETH;
    liquidityToken[msg.sender] += amountToken;

    emit LiquidityAdded(msg.sender, lpTokens);
  }

  // Использование ORACLE_PRICE (0xE6) для получения цены
  function getPrice(address token) public view returns (uint256) {
    return ORACLE_PRICE(token);
  }

  // Flash loan с нативным опкодом FLASH_LOAN (0xE3)
  function flashLoan(uint256 amount) public {
    FLASH_LOAN(amount, address(this));
    // Логика flash loan
    // Автоматически проверяется возврат + 0.09% комиссии (9 BPS)
  }
}

Programming Language Support

.q

NATIVE

Native QVM language with first-class DeFi and post-quantum crypto support

Standards:
QRC20QRC721QRC1155QRC4626

Solidity

COMPATIBLE

Full compatibility with Ethereum Solidity contracts. dApp migration without code changes.

  • Hardhat, Truffle, Remix
  • OpenZeppelin libraries
  • MetaMask integration

FunC

SUPPORTED

TON blockchain FunC language for high-performance contracts

Tact

SUPPORTED

Modern TON language with improved security and readability

Native DeFi Primitives

QVM has 16 built-in opcodes for DeFi operations (0xE0-0xEF), enabling DEX, liquidity pools, lending and staking protocols without external dependencies

0xE0 DEFI_SWAP
Native AMM token swap
5000 gas

Uses constant product formula (x*y=k) for trustless token swaps. Automatic price and slippage calculation.

0xE1 ADD_LIQUIDITY
Add liquidity to pool
10000 gas

Adds liquidity to pool with automatic share calculation and LP token minting. Impermanent loss protection.

0xE3 FLASH_LOAN
Uncollateralized flash loan
1000+ gas

Instant loans without collateral with automatic rollback on non-repayment. 0.09% fee (9 BPS) built-in at protocol level.

0xE6 ORACLE_PRICE
Decentralized price oracle
1000 gas

Get real-time asset prices from decentralized oracle network. Manipulation protection with median values.

Additional DeFi Opcodes

0xE2 REMOVE_LIQUIDITY - Remove liquidity
0xE4 COMPOUND - Compound interest
0xE5 CALC_APY - Calculate APY
0xE7 SQRT - Square root for AMM

Post-Quantum Cryptography in QVM

12 built-in opcodes (0xC0-0xCB) for post-quantum signatures and encryption. NIST-standard Dilithium3, Falcon-512, SPHINCS+, Kyber1024.

Dilithium3

0xC0, 0xC1
NIST Standard

Sign/Verify
5000-10000 gas

Falcon-512

0xC2, 0xC3
Fast

Fast signatures
3000-6000 gas

SPHINCS+

0xC4, 0xC5
Max Security

Max security
50000-100000 gas

Kyber1024

0xC6, 0xC7
Encryption

KEM Encryption
2000-3000 gas

Zero-Knowledge Proofs

4 native opcodes for zk-STARKs, Groth16, Bulletproofs, and Merkle tree verification

0xD0 ZK_PROVE

Generate zk-STARK proof for private transactions. Prove knowledge without revealing the secret.

50000+ gas
0xD1 ZK_VERIFY

Verify zk-STARK proof. Fast verification without access to original data.

100000+ gas
0xD2 MERKLE_VERIFY

Verify Merkle proof for efficient data inclusion verification.

500 gas

Cross-Chain Compatibility

The Only VM with 100% Ethereum AND Bitcoin Compatibility

QVM supports native opcodes for both major blockchains, enabling seamless integration through bridges

Ethereum

100% compatible
0x01 ECRECOVER

Recover address from ECDSA signature (secp256k1). Uses k256 cryptographic library for full Ethereum compatibility.

Use cases:
  • Ethereum signature verification
  • Ethereum ↔ QSN bridges
  • MetaMask integration
  • Cross-chain swaps with ERC20

Bitcoin

100% compatible
RIPEMD-160

RIPEMD-160 hash function used in Bitcoin for address creation. Implemented via ripemd library for full compatibility.

Use cases:
  • Bitcoin address generation
  • Bitcoin ↔ QSN bridges
  • Wrapped BTC tokens
  • Cross-chain BTC swaps

Dual Compatibility Benefits

  • Seamless bridges between Ethereum, Bitcoin, and QSN without trusted intermediaries
  • Native signature verification for both networks at VM level without external libraries
  • Ability to create DeFi protocols with liquidity from 3 major networks
  • Low fees for cross-chain transactions thanks to native support

All 180+ QVM Opcodes

Complete Opcodes Reference

View all 180+ QVM opcodes in terminal format: 92 EVM + 37+ QVM exclusive for DeFi, post-quantum crypto, Neural AI, and zero-knowledge

92
EVM Compatible
37+
QVM Exclusive
16
DeFi Opcodes
12
Post-Quantum

QVM Token Standards

QRC20

Fungible token standard, ERC20-compatible. Extended functionality with post-quantum signatures.

QRC721

NFT standard for unique tokens. Metadata and royalty support.

QRC1155

Multi-token standard for games and collections. Batch operations for gas savings.

QRC4626

Tokenized vault standard for DeFi. Compatible with lending protocols.

Featured Opcodes

DEFI_SWAP30,000 gas

Native AMM token swap using constant product formula (x*y=k). 0.3% swap fee built-in.

ADD_LIQUIDITY40,000 gas

Add liquidity to decentralized pools with automatic LP token minting.

FLASH_LOAN50,000 gas

Uncollateralized flash loans with atomic rollback. 0.09% protocol fee (9 BPS).

PQ_VERIFY_DILITHIUM10,000 gas

Post-quantum signature verification using NIST-approved Dilithium3 (Level 3 security).

ZK_VERIFY50,000 gas

Verify zk-STARK proofs for private transactions. FRI-based verification.

ORACLE_PRICE100 gas

Get TWAP prices from decentralized oracle network. 30-min window, 5% max deviation.

CROSS_SHARD_CALL100,000 gas

Execute cross-shard contract calls with 2-phase commit protocol.

NEURAL_PREDICT5,000 gas

Get AI predictions from BlockchainBrain for gas, load, and risk analysis.

Start Building on QVM

Use .q language or Solidity to build DeFi applications with native primitives and post-quantum security