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
.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.09% комиссии (9 BPS)
}
}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 16 built-in opcodes for DeFi operations (0xE0-0xEF), enabling DEX, liquidity pools, lending and staking 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.09% fee (9 BPS) 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
4 native opcodes for zk-STARKs, Groth16, Bulletproofs, 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 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
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 gasNative AMM token swap using constant product formula (x*y=k). 0.3% swap fee built-in.
ADD_LIQUIDITY40,000 gasAdd liquidity to decentralized pools with automatic LP token minting.
FLASH_LOAN50,000 gasUncollateralized flash loans with atomic rollback. 0.09% protocol fee (9 BPS).
PQ_VERIFY_DILITHIUM10,000 gasPost-quantum signature verification using NIST-approved Dilithium3 (Level 3 security).
ZK_VERIFY50,000 gasVerify zk-STARK proofs for private transactions. FRI-based verification.
ORACLE_PRICE100 gasGet TWAP prices from decentralized oracle network. 30-min window, 5% max deviation.
CROSS_SHARD_CALL100,000 gasExecute cross-shard contract calls with 2-phase commit protocol.
NEURAL_PREDICT5,000 gasGet 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
