This document provides detailed technical specifications for all mining algorithms supported by Glyph Miner.
Glyph Miner supports multiple proof-of-work algorithms designed for different use cases and hardware optimizations:
- SHA256d: Legacy compatibility algorithm
- Blake3: High-performance GPU algorithm
- KangarooTwelve: Balanced CPU/GPU algorithm
- Argon2id-Light: Memory-hard leveling algorithm
- RandomX-Light: CPU-optimized algorithm
Type: Double SHA-256 hash Category: Legacy GPU Memory Usage: ~1 KB Recommended Difficulty: 500,000+
hash = SHA256(SHA256(data))
- WGSL shader for GPU acceleration
- 128-byte work buffer
- 4-byte nonce space
- Target comparison in little-endian
- RTX 4090: ~1.5 GH/s
- CPU: ~50 MH/s
- Power: ~200W (GPU)
- Efficiency: 7.5 MH/W
- Legacy contract compatibility
- Testing and development
- Low-power mining
Type: Cryptographic hash function Category: High-performance GPU Memory Usage: ~1 KB Recommended Difficulty: 2,500,000+
hash = Blake3(data || nonce)
- WGSL shader with parallel compression
- 64-byte state buffer
- SIMD-optimized operations
- Constant-time implementation
- RTX 4090: ~7.5 GH/s
- CPU: ~200 MH/s
- Power: ~250W (GPU)
- Efficiency: 30 MH/W
- Primary mining algorithm
- Maximum GPU performance
- Energy-efficient mining
Type: Keccak-based sponge function Category: Balanced CPU/GPU Memory Usage: ~200 B Recommended Difficulty: 50,000+
hash = KangarooTwelve(data || nonce, 32)
- WGSL shader with Keccak permutation
- 200-byte internal state
- 12-round permutation
- Parallel absorption
- RTX 4090: ~4.0 GH/s
- CPU: ~150 MH/s
- Power: ~220W (GPU)
- Efficiency: 18 MH/W
- CPU/GPU balance
- Mobile device mining
- Moderate hardware requirements
Type: Memory-hard function Category: Memory-hard GPU Memory Usage: 64-512 MB Recommended Difficulty: 10,000+
hash = Argon2id(data || nonce, t=3, m=1024, p=4)
- WGSL shader with BLAKE2b compression
- 1024 Argon2 blocks (1MB each)
- 3-pass iteration
- 4-lane parallelism
- Memory Size: 64-512 MB (auto-optimized)
- Time Cost: 3 iterations
- Parallelism: 4 lanes
- Hash Length: 32 bytes
- RTX 4090: ~50 MH/s
- CPU: ~5 MH/s
- Power: ~300W (GPU)
- Efficiency: 0.17 MH/W
- Anti-ASIC protection
- GPU leveling
- Memory-hard mining
// Automatic memory parameter optimization
const optimized = optimizeMemoryParameters(gpuInfo, 'argon2light');
// Returns: { memoryBlocks, timeCost, parallelism, warnings }Type: RandomX variant Category: CPU-optimized Memory Usage: 256 KB Recommended Difficulty: 25,000+
hash = RandomX(data || nonce, light=true)
- JavaScript virtual machine
- 256 KB scratchpad
- Simplified instruction set
- Blake2b mixing functions
- Registers: 8 general-purpose (R0-R7)
- Memory: 256 KB scratchpad
- Program: 256 instructions
- Iterations: 3 passes
- High-end CPU: ~50 KH/s
- Mid-range CPU: ~25 KH/s
- Power: ~65W (CPU)
- Efficiency: 0.77 KH/W
- CPU-only mining
- Anti-GPU protection
- Low-power devices
// Core RandomX instructions
const RandomXInstruction = {
IADD_RS: 0x00, // Add register to register
IADD_M: 0x01, // Add memory to register
ISUB_R: 0x02, // Subtract register
IMUL_R: 0x04, // Multiply register
IXOR_R: 0x20, // XOR register
CSTORE: 0x80, // Store to memory
HALT: 0xB5, // Stop execution
};| Algorithm | Hash Rate (RTX 4090) | Memory | Power | Efficiency | Best For |
|---|---|---|---|---|---|
| SHA256d | 1.5 GH/s | 1 KB | 200W | 7.5 MH/W | Legacy |
| Blake3 | 7.5 GH/s | 1 KB | 250W | 30 MH/W | Performance |
| K12 | 4.0 GH/s | 200 B | 220W | 18 MH/W | Balance |
| Argon2id-Light | 50 MH/s | 256 MB | 300W | 0.17 MH/W | Leveling |
| RandomX-Light | N/A | 256 KB | 65W | 0.77 KH/W | CPU |
All GPU algorithms use WebGPU Shading Language (WGSL) for maximum performance:
// Example Blake3 shader structure
@compute @workgroup_size(128)
fn main(@builtin(global_invocation_id) global_id: vec3<u32>) {
let idx = global_id.x;
let nonce = base_nonce + idx;
// Perform Blake3 hashing
var hash = blake3_hash(data, nonce);
// Check target difficulty
if (hash <= target) {
results[atomicAdd(&result_count, 1)] = vec4<u32>(nonce, hash);
}
}Each algorithm has specific buffer requirements:
interface BufferRequirements {
midstate: number; // Work data buffer (u32s)
target: number; // Target difficulty (u32s)
results: number; // Result buffer (vec4<u32>s)
memory?: number; // Working memory (blocks)
}const gpuInfo = await getGPUMemoryInfo(adapter);
// Returns: { totalMemoryMB, availableMemoryMB, vendor, model }const memoryCheck = checkMemoryCompatibility(gpuInfo, requirements);
// Returns: { compatible, recommended, warnings, errors }const optimized = optimizeMemoryParameters(gpuInfo, algorithm);
// Returns: { memoryBlocks, timeCost, parallelism, warnings }- Blake3: 128-bit security against collisions
- K12: 128-bit security against collisions
- SHA256d: 128-bit security against collisions
- Argon2id-Light: 128-bit security against collisions
- RandomX-Light: 128-bit security against collisions
All algorithms provide at least 128-bit pre-image resistance.
- Constant-time implementations where possible
- Memory access patterns randomized (RandomX)
- GPU shader optimizations prevent timing attacks
- Workgroup Size: 128 threads optimal for most GPUs
- Memory Layout: Aligned to 256-byte boundaries
- Shader Compilation: Pre-compiled for target hardware
- Thread Count: Use all available cores
- Memory Allocation: Large contiguous blocks
- Instruction Cache: Hot loop optimization
function selectOptimalAlgorithm(hardware: HardwareInfo): AlgorithmId {
if (hardware.gpuVRAM > 4096) return 'argon2light';
if (hardware.gpuPerformance > 'high') return 'blake3';
if (hardware.cpuCores > 8) return 'randomx-light';
return 'k12';
}- Lyra2REv3: Memory-hard with reduced iterations
- Eaglesong: Efficient for embedded devices
- X11: Chain of 11 hash functions
- Quantum-resistant algorithms
- Zero-knowledge proof integration
- Adaptive difficulty algorithms