QVM - Quantum Virtual Machine
QSN native virtual machine with built-in DeFi primitives, post-quantum cryptography, and native .q language. 75,000+ TPS, 94 opcodes, Solidity, FunC, and Tact support.
QVM Performance
.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
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.3% комиссии
}
}Programming Language Support
.q
NATIVENative QVM language with first-class DeFi and post-quantum crypto support
QRC20QRC721QRC1155QRC4626Solidity
COMPATIBLEFull compatibility with Ethereum Solidity contracts. dApp migration without code changes.
- Hardhat, Truffle, Remix
- OpenZeppelin libraries
- MetaMask integration
FunC
SUPPORTEDTON blockchain FunC language for high-performance contracts
Tact
SUPPORTEDModern TON language with improved security and readability
Native DeFi Primitives
QVM has 8 built-in opcodes for DeFi operations (0xE0-0xE7), enabling DEX, liquidity pools, and lending protocols without external dependencies
0xE0 DEFI_SWAPUses constant product formula (x*y=k) for trustless token swaps. Automatic price and slippage calculation.
0xE1 ADD_LIQUIDITYAdds liquidity to pool with automatic share calculation and LP token minting. Impermanent loss protection.
0xE3 FLASH_LOANInstant loans without collateral with automatic rollback on non-repayment. 0.3% fee built-in at protocol level.
0xE6 ORACLE_PRICEGet real-time asset prices from decentralized oracle network. Manipulation protection with median values.
Additional DeFi Opcodes
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
Sign/Verify
5000-10000 gas
Falcon-512
Fast signatures
3000-6000 gas
SPHINCS+
Max security
50000-100000 gas
Kyber1024
KEM Encryption
2000-3000 gas
Zero-Knowledge Proofs
3 native opcodes (0xD0-0xD2) for zk-STARK proofs and Merkle tree verification
0xD0 ZK_PROVEGenerate zk-STARK proof for private transactions. Prove knowledge without revealing the secret.
0xD1 ZK_VERIFYVerify zk-STARK proof. Fast verification without access to original data.
0xD2 MERKLE_VERIFYVerify Merkle proof for efficient data inclusion verification.
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% compatible0x01 ECRECOVERRecover address from ECDSA signature (secp256k1). Uses k256 cryptographic library for full Ethereum compatibility.
- Ethereum signature verification
- Ethereum ↔ QSN bridges
- MetaMask integration
- Cross-chain swaps with ERC20
Bitcoin
100% compatibleRIPEMD-160RIPEMD-160 hash function used in Bitcoin for address creation. Implemented via ripemd library for full compatibility.
- 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 94 QVM Opcodes
Complete Opcodes Reference
View all 94 QVM opcodes in terminal format: 71 EVM-compatible + 23 exclusive for DeFi, post-quantum crypto, and zero-knowledge
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_SWAP5000 gasNative AMM token swap using constant product formula (x*y=k). Zero external dependencies.
ADD_LIQUIDITY10000 gasAdd liquidity to decentralized pools with automatic LP token minting.
FLASH_LOAN1000+ gasUncollateralized flash loans with atomic rollback. 0.3% protocol fee.
PQ_SIGN_DILITHIUM5000 gasPost-quantum digital signatures using NIST-approved Dilithium3 algorithm.
ZK_PROVE50000+ gasGenerate zero-knowledge proofs (zk-STARKs) for private transactions.
ORACLE_PRICE1000 gasGet real-time asset prices from decentralized oracle network.
Start Building on QVM
Use .q language or Solidity to build DeFi applications with native primitives and post-quantum security
