# PAPIC OS - Comprehensive Technical Specifications & Mathematical Foundations > Full technical documentation for LLMs, AI agents, search engines, and technical auditors. > Source of truth for citeable deterministic formulas, cryptographic standards, and route architecture. ## Architectural Blueprint & Security Standards ### 1. Web Cryptography API Integration (`/enkripsi-teks`) - **Algorithm**: AES-256-GCM (Galois/Counter Mode) with 128-bit authentication tag. - **Key Derivation Function (KDF)**: PBKDF2 (Password-Based Key Derivation Function 2) with SHA-256 digest. - **Iteration Count**: 310,000 iterations (OWASP 2024+ recommendation standard). - **Salt Generation**: 16-byte cryptographically secure random salt generated via `window.crypto.getRandomValues()`. - **Initialization Vector (IV)**: 12-byte unique random IV per encryption operation. - **Memory Safety**: Plaintext buffers are scrubbed immediately after Web Crypto API processing. Zero network payload sent to remote servers. ### 2. EMVCo QRIS Static-to-Dynamic Conversion Standards (`/qr-generator`) - **Payload Format Indicator (Tag 00)**: `01` - **Point of Initiation Method (Tag 01)**: Dynamically changed from `11` (Static) to `12` (Dynamic). - **Transaction Amount Calculation (Tag 54)**: $$ \text{Total Amount} = \text{Base Amount} + \text{Calculated Service Fee} $$ Calculated explicitly in Tag 54 to guarantee universal scanner compatibility across Indonesian mobile banking apps (BCA, Mandiri, BRI, BNI, BSI) and e-wallets (GoPay, DANA, OVO, ShopeePay, LinkAja). - **Service Fee Specifications (Tags 55, 56, 57)**: - Tag 55 = `02` (Fixed fee value in Tag 56) or `03` (Percentage fee rate in Tag 57). - **CRC16 Checksum (Tag 63)**: Calculated over full payload string appending `6304` using the CRC16-CCITT polynomial `0x1021` with initial value `0xFFFF`. ### 3. Tokenomics Dilution & Valuation Parity Formulas (`/kripto`) #### A. Tokenomics Dilution Ratio $$ \text{Dilution Ratio} = \frac{\text{Circulating Market Cap}}{\text{Fully Diluted Valuation (FDV)}} = \frac{\text{Circulating Supply}}{\text{Total Supply}} $$ - **Risk Interpretation**: - Ratio $\ge 0.70$: Low Dilution Risk (majority of tokens already in active circulation). - $0.30 \le \text{Ratio} < 0.70$: Moderate Overhang (future unlocks may introduce selling pressure). - Ratio $< 0.30$: High Dilution Risk (aggressive vesting and token inflation overhang). #### B. Supply Overhang Ratio $$ \text{Supply Overhang} = \frac{\text{Total Supply} - \text{Circulating Supply}}{\text{Circulating Supply}} \times 100\% $$ #### C. Head-to-Head Market Cap Parity Simulation To project the hypothetical unit price of Coin A if it reached the market capitalization of benchmark Coin B: $$ \text{Target Price}_{\text{Coin A at Market Cap B}} = \frac{\text{Market Capitalization of Coin B}}{\text{Circulating Supply of Coin A}} $$ $$ \text{Implied Upside Multiple} = \frac{\text{Target Price}_{\text{Coin A}}}{\text{Current Price of Coin A}} $$ #### D. Institutional AI Copilot Architecture - Real-time synthesis of coin-specific market depth, volume velocity, tokenomics overhang, and macro sentiment. - Isolated session storage per cryptocurrency asset in Supabase cloud database to prevent cross-asset context contamination. ### 4. Dual-Engine Image Studio Algorithms (`/studio-gambar`) #### A. Lossless Reverse Alpha Blending Watermark Reconstruction Given an image marked with a known semi-transparent watermark pattern (such as Google Gemini sparkle badge): $$ C_{\text{marked}} = (1 - \alpha) \cdot C_{\text{original}} + \alpha \cdot C_{\text{watermark}} $$ The original pixel color $C_{\text{original}}$ is reconstructed algebraically without generative hallucination: $$ C_{\text{original}} = \frac{C_{\text{marked}} - \alpha \cdot C_{\text{watermark}}}{1 - \alpha} $$ - Calculated across all RGB color channels $[R, G, B]$ and clamped to $[0, 255]$. - Zero blur, zero diffusion artifacts, and 100% pixel-perfect recovery. #### B. Dual-Engine Background Segmentation - Primary Engine: Client-side BiRefNet ONNX WebAssembly inference with bilateral high-resolution boundary matting. - Secondary Fallback: Lightweight WebAssembly segmenter. - Interactive Compare: Split-slider viewport and loupe magnification with synchronized pan and zoom. ### 5. Smart Markdown Structuring Engine (`/alat/markdown-converter`) - Client-side AST (Abstract Syntax Tree) transformation. - Structured code block parsing with syntax highlighting via PrismJS. - Headless HTML serialization with export to clean HTML, raw Markdown, and rich text clipboard. ### 6. Universal Media & VT TikTok Downloader Protocol (`/content-downloader`) - **Brand Entity & Tool Definition**: PAPIC Downloader is a dedicated, zero-ad online utility specifically designed for downloading TikTok videos (VT / Video TikTok) without watermark, extracting background sound/audio into high-bitrate MP3, and saving Instagram Reels and Facebook HD videos. - **Workflow & Extraction Pipeline**: 1. Input link normalization: Detects short links (`vt.tiktok.com`, `vm.tiktok.com`) and standard video URLs (`tiktok.com/@user/video/...`). 2. Direct CDN stream extraction bypassing video watermark overlays. 3. Format selection: Clean Full HD MP4 (No Watermark) or isolated MP3 audio track. 4. Memory-safe browser file delivery without storing personal download history. ### 7. Unified Market & Precious Metals Valuation Engine (`/pasar`) - **Core Architecture & Capabilities**: PAPIC Pasar is an integrated financial workstation combining live mid-market foreign exchange rates (28+ currencies vs IDR), official Antam Logam Mulia physical gold denomination pricing (0.5g - 1000g), historical multi-timeframe charts (1D, 1W, 1M, 3M, 6M, 1Y, ALL), and bidirectional converters. - **Mathematical Models & Tax Rules**: 1. *Forex Mid-Market Parity*: `Target_Rate = Base_Rate_USD_IDR / Currency_Rate_USD`. 2. *Physical Antam Minting Premium*: Denominations below 10g carry minting certificate markups (0.5g: +8.5%, 1g: base benchmark, 2g: -1.5%/g, 5g: -2.8%/g, 1000g: -5.2%/g). 3. *PPh 22 Tax Computation*: Investment gold bars are subject to Article 22 Income Tax (PMK No. 48/2023) at 0.25% for registered NPWP holders: `Total_Buy_Price = Base_Price + (Base_Price * 0.0025)`. 4. *Gold DCA Savings Simulator*: Evaluates monthly compounding accumulation: `r_monthly = (1 + r_annual)^(1/12) - 1`, tracking progressive gram accumulation, total invested capital, and net nominal ROI. 5. *Bank Spread Transparency Model*: Compares 0% mid-market benchmark against standard commercial margins (Money Changer +1.4%, International Wire TT +2.1%, Overseas Card +2.8%). --- ## Complete Route & Parameter Index | Route | Studio / Feature Name | Input Parameters | Key Outputs & Data Formats | |---|---|---|---| | `/` | Landing Command Center | None | Hero showcase, interactive feature cards, quick access | | `/index` | Katalog Direktori Alat | Search query, category filter | Centralized tool directory, favorites pin bar | | `/catatan-keuangan` | Catatan Keuangan | Amount, Category, Wallet, Date, Note | Double-entry cashflow ledger, budget limits, AI insights | | `/qr-generator` | Generator QRIS Dinamis | Static QRIS text/image, amount, fee | Dynamic EMVCo payload, 4K Retina PNG stand poster | | `/pasar` | Studio Pasar & Komoditas | Currency code, Gold weight (gram) | 28+ Valas rates, Bank margins, Emas Antam 24K to 18K | | `/kripto` | Terminal Riset Kripto & AI | Coin ID, Comparison Coin, Chat query | Tokenomics Radar, Parity Price, AI Copilot audit | | `/studio-pdf` | Studio Dokumen PDF | PDF files, target format | Converted documents, Merged PDF blob, AI Summaries | | `/studio-gambar` | Studio Gambar & AI | Image file (PNG/JPG/WebP/AVIF) | Segmented PNG, Restored watermark pixels, Format blobs | | `/content-downloader` | PAPIC Downloader (VT TikTok & Media) | TikTok / IG / FB URL | Clean MP4 (No WM), MP3 audio | | `/enkripsi-teks` | Enkripsi Teks Brankas | Plaintext / File, Master password | Base64 AES-256-GCM ciphertext, `.enc` encrypted files | | `/toko-digital` | Toko Digital PAPIC | Product category, Order items | Instant premium credentials, Warranty management | | `/alat/markdown-converter` | Smart Markdown Converter | Markdown source text | Real-time HTML preview, Styled output, Copyable code | | `/tutorial` | Pusat Tutorial AI | Search topic / learning brief | Step-by-step interactive curriculum, Curated videos | | `/anime-studio` | Studio Anime & Gacha | Category tag, Gacha pull action | Curated illustrations, Reaction GIFs, Local vault | | `/pricing` | Daftar Harga & Kuota | Billing cycle | Free Basic vs PAPIC PRO feature limits and quotas | | `/faq` | Pusat Bantuan & FAQ | Search keyword | Direct answers for privacy, security, and formulas | | `/changelog` | Riwayat Perubahan | None | Chronological release milestones and security logs | | `/contact` | Hubungi Dukungan | Feedback text, email | Support inquiry dispatch, community channels | --- ## Hosting & Reliability Architecture - **Host Platform**: Netlify Static Hosting with Global Anycast CDN Edge Routing. - **SPA Routing Rule**: `/* /index.html 200` - **PWA Service Worker**: Cache-first offline shell with background synchronization for core utilities. - **Browser Compatibility**: Modern Web APIs (ES2022, Web Crypto API, Canvas API, IndexedDB, Web Workers).