Add 2 files
Browse filesFiles changed (2)
- README.md+7-5
- index.html+1285-19
12345678910---title: Mytry11emoji: 🐠colorFrom: purplecolorTo: indigosdk: staticpinned: false---Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference123456789101112---title: mytry11emoji: 🐳colorFrom: yellowcolorTo: redsdk: staticpinned: falsetags:- deepsite---Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
12345678910111213141516171819<!doctype html><html><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width" /><title>My static Space</title><link rel="stylesheet" href="style.css" /></head><body><div class="card"><h1>Welcome to your static Space!</h1><p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p><p>Also don't forget to check the<a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.</p></div></body></html>1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>KWE Blockchain Explorer</title><script src="https://cdn.tailwindcss.com"></script><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"><style>@keyframes pulse {0% { transform: scale(1); }50% { transform: scale(1.05); }100% { transform: scale(1); }}.block-animate {animation: pulse 0.5s ease-in-out;}.gradient-bg {background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);}.block-shadow {box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);}.scrollbar-hide::-webkit-scrollbar {display: none;}.scrollbar-hide {-ms-overflow-style: none;scrollbar-width: none;}.tab-active {border-bottom: 2px solid #48bb78;color: #48bb78;}.peer-status-connected {border-left: 4px solid #48bb78;}.peer-status-disconnected {border-left: 4px solid #e53e3e;}.highlight-box {background: rgba(72, 187, 120, 0.1);border-left: 4px solid #48bb78;}.accordion-content {max-height: 0;overflow: hidden;transition: max-height 0.3s ease-out;}</style></head><body class="gradient-bg min-h-screen text-gray-100"><div class="container mx-auto px-4 py-8"><!-- Header --><header class="flex flex-col md:flex-row justify-between items-center mb-8"><div class="flex items-center mb-4 md:mb-0"><i class="fas fa-cube text-green-400 text-3xl mr-3"></i><h1 class="text-3xl font-bold bg-clip-text text-transparent bg-gradient-to-r from-green-400 to-blue-500">KWE Blockchain Explorer</h1></div><div class="flex items-center space-x-4"><div class="bg-gray-800 rounded-lg px-4 py-2 flex items-center"><i class="fas fa-coins text-yellow-400 mr-2"></i><span id="blockCount" class="font-mono">0</span><span class="ml-1">blocks</span></div><button id="addBlockBtn" class="bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-lg flex items-center transition-colors"><i class="fas fa-plus mr-2"></i>Add Block</button><button id="walletBtn" class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg flex items-center transition-colors"><i class="fas fa-wallet mr-2"></i>Wallet</button><button id="networkBtn" class="bg-purple-600 hover:bg-purple-700 text-white px-4 py-2 rounded-lg flex items-center transition-colors"><i class="fas fa-network-wired mr-2"></i>Network</button></div></header><!-- Main Content Tabs --><div class="flex border-b border-gray-700 mb-6"><button id="explorerTab" class="tab-active py-2 px-4 font-medium">Block Explorer</button><button id="walletTab" class="py-2 px-4 font-medium text-gray-400 hover:text-white">Wallet</button><button id="networkTab" class="py-2 px-4 font-medium text-gray-400 hover:text-white">Network</button><button id="howItWorksTab" class="py-2 px-4 font-medium text-gray-400 hover:text-white">How It Works</button></div><!-- Explorer View --><div id="explorerView"><div class="mb-8 bg-gray-800 rounded-xl p-6 shadow-lg"><h2 class="text-xl font-semibold mb-4 text-green-400 flex items-center"><i class="fas fa-info-circle mr-2"></i>Blockchain Information</h2><div class="grid grid-cols-1 md:grid-cols-3 gap-4"><div class="bg-gray-700 p-4 rounded-lg"><h3 class="text-sm text-gray-400 mb-1">Consensus</h3><p class="text-lg font-mono">Proof-of-Stake (v3)</p></div><div class="bg-gray-700 p-4 rounded-lg"><h3 class="text-sm text-gray-400 mb-1">Address Prefix</h3><p class="text-lg font-mono">KWE</p></div><div class="bg-gray-700 p-4 rounded-lg"><h3 class="text-sm text-gray-400 mb-1">Decimals</h3><p class="text-lg font-mono">8</p></div></div></div><div class="mb-8"><h2 class="text-xl font-semibold mb-4 text-green-400 flex items-center"><i class="fas fa-project-diagram mr-2"></i>Blockchain Visualization</h2><div class="relative"><div class="absolute left-6 top-0 bottom-0 w-1 bg-green-500 opacity-20 rounded-full"></div><div id="blockchainContainer" class="space-y-6 pl-12"><!-- Blocks will be added here dynamically --><div class="text-center py-8 text-gray-500" id="emptyState"><i class="fas fa-cubes text-4xl mb-4"></i><p>No blocks in the chain yet. Click "Add Block" to start.</p></div></div></div></div><div class="bg-gray-800 rounded-xl p-6 shadow-lg"><h2 class="text-xl font-semibold mb-4 text-green-400 flex items-center"><i class="fas fa-chart-line mr-2"></i>Network Statistics</h2><div class="grid grid-cols-1 md:grid-cols-4 gap-4"><div class="bg-gray-700 p-4 rounded-lg"><h3 class="text-sm text-gray-400 mb-1">Block Time</h3><p class="text-lg font-mono">~5s</p></div><div class="bg-gray-700 p-4 rounded-lg"><h3 class="text-sm text-gray-400 mb-1">Staked Tokens</h3><p class="text-lg font-mono" id="stakedTokens">0.00000000 KWE</p></div><div class="bg-gray-700 p-4 rounded-lg"><h3 class="text-sm text-gray-400 mb-1">Validators</h3><p class="text-lg font-mono" id="validatorCount">0</p></div><div class="bg-gray-700 p-4 rounded-lg"><h3 class="text-sm text-gray-400 mb-1">Energy Efficiency</h3><p class="text-lg font-mono">0.05 kWh/tx</p></div></div></div></div><!-- Wallet View (hidden by default) --><div id="walletView" class="hidden"><div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-8"><div class="bg-gray-800 rounded-xl p-6 shadow-lg col-span-1"><h2 class="text-xl font-semibold mb-4 text-blue-400 flex items-center"><i class="fas fa-wallet mr-2"></i>My Wallet</h2><div class="mb-6 p-4 bg-gray-700 rounded-lg"><h3 class="text-sm text-gray-400 mb-1">Address</h3><p id="walletAddress" class="text-sm font-mono truncate"></p></div><div class="mb-6 p-4 bg-gray-700 rounded-lg"><h3 class="text-sm text-gray-400 mb-1">Balance</h3><p id="walletBalance" class="text-2xl font-mono text-green-400">0.00000000 KWE</p></div><div class="p-4 bg-gray-700 rounded-lg"><h3 class="text-sm text-gray-400 mb-1">Staked Amount</h3><p id="walletStaked" class="text-2xl font-mono text-yellow-400">0.00000000 KWE</p></div></div><div class="bg-gray-800 rounded-xl p-6 shadow-lg col-span-2"><div class="flex justify-between items-center mb-6"><h2 class="text-xl font-semibold text-blue-400 flex items-center"><i class="fas fa-exchange-alt mr-2"></i>Transactions</h2><div class="flex space-x-3"><button id="sendBtn" class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg flex items-center transition-colors"><i class="fas fa-paper-plane mr-2"></i>Send</button><button id="stakeBtn" class="bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-lg flex items-center transition-colors"><i class="fas fa-coins mr-2"></i>Stake</button></div></div><div id="walletTransactions" class="space-y-3"><div class="text-center py-8 text-gray-500"><i class="fas fa-exchange-alt text-4xl mb-4"></i><p>No transactions yet</p></div></div></div></div><!-- Send Transaction Modal --><div id="sendModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden"><div class="bg-gray-800 rounded-xl p-6 w-full max-w-md"><div class="flex justify-between items-center mb-4"><h3 class="text-xl font-semibold text-blue-400">Send KWE</h3><button id="closeSendModal" class="text-gray-400 hover:text-white"><i class="fas fa-times"></i></button></div><div class="space-y-4"><div><label class="block text-sm text-gray-400 mb-1">Recipient Address</label><input id="recipientAddress" type="text" class="w-full bg-gray-700 rounded-lg px-4 py-2 text-white focus:outline-none focus:ring-2 focus:ring-blue-500"></div><div><label class="block text-sm text-gray-400 mb-1">Amount (KWE)</label><input id="sendAmount" type="text" class="w-full bg-gray-700 rounded-lg px-4 py-2 text-white focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="0.00000000"></div><div><label class="block text-sm text-gray-400 mb-1">Memo (Optional)</label><input id="sendMemo" type="text" class="w-full bg-gray-700 rounded-lg px-4 py-2 text-white focus:outline-none focus:ring-2 focus:ring-blue-500"></div><div class="pt-2"><button id="confirmSendBtn" class="w-full bg-blue-600 hover:bg-blue-700 text-white px-4 py-3 rounded-lg transition-colors">Send Transaction</button></div></div></div></div><!-- Stake Tokens Modal --><div id="stakeModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden"><div class="bg-gray-800 rounded-xl p-6 w-full max-w-md"><div class="flex justify-between items-center mb-4"><h3 class="text-xl font-semibold text-green-400">Stake KWE</h3><button id="closeStakeModal" class="text-gray-400 hover:text-white"><i class="fas fa-times"></i></button></div><div class="space-y-4"><div><label class="block text-sm text-gray-400 mb-1">Validator</label><select id="selectValidator" class="w-full bg-gray-700 rounded-lg px-4 py-2 text-white focus:outline-none focus:ring-2 focus:ring-green-500"><option value="GreenNode">GreenNode</option><option value="EcoStaker">EcoStaker</option><option value="SustainableChain">SustainableChain</option></select></div><div><label class="block text-sm text-gray-400 mb-1">Amount to Stake (KWE)</label><input id="stakeAmount" type="text" class="w-full bg-gray-700 rounded-lg px-4 py-2 text-white focus:outline-none focus:ring-2 focus:ring-green-500" placeholder="0.00000000"><p class="text-xs text-gray-400 mt-1">Minimum stake: 1000.00000000 KWE</p></div><div class="pt-2"><button id="confirmStakeBtn" class="w-full bg-green-600 hover:bg-green-700 text-white px-4 py-3 rounded-lg transition-colors">Stake Tokens</button></div></div></div></div></div><!-- Network View (hidden by default) --><div id="networkView" class="hidden"><div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-8"><div class="bg-gray-800 rounded-xl p-6 shadow-lg"><div class="flex justify-between items-center mb-6"><h2 class="text-xl font-semibold text-purple-400 flex items-center"><i class="fas fa-network-wired mr-2"></i>Peer Management</h2><button id="addPeerBtn" class="bg-purple-600 hover:bg-purple-700 text-white px-4 py-2 rounded-lg flex items-center transition-colors"><i class="fas fa-plus mr-2"></i>Add Peer</button></div><div id="peerStats" class="space-y-2 mb-6"><div class="flex justify-between p-3 bg-gray-700 rounded-lg"><span class="text-gray-400">Total Peers:</span><span id="totalPeers" class="font-mono">0</span></div><div class="flex justify-between p-3 bg-gray-700 rounded-lg"><span class="text-gray-400">Connected:</span><span id="connectedPeers" class="font-mono">0</span></div></div><div class="p-3 bg-gray-700 rounded-lg mb-4">[...]</div></div></div><div class="bg-gray-800 rounded-xl p-6 shadow-lg md:col-span-2"><h2 class="text-xl font-semibold mb-4 text-purple-400 flex items-center"><i class="fas fa-list mr-2"></i>Connected Peers</h2><div id="peerList" class="space-y-3"><div class="text-center py-8 text-gray-500"><i class="fas fa-network-wired text-4xl mb-4"></i><p>No peers connected</p></div></div></div></div><!-- Add Peer Modal --><div id="addPeerModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden"><div class="bg-gray-800 rounded-xl p-6 w-full max-w-md"><div class="flex justify-between items-center mb-4"><h3 class="text-xl font-semibold text-purple-400">Add New Peer</h3><button id="closePeerModal" class="text-gray-400 hover:text-white"><i class="fas fa-times"></i></button></div><div class="space-y-4"><div><label class="block text-sm text-gray-400 mb-1">Peer Address</label><input id="peerAddress" type="text" class="w-full bg-gray-700 rounded-lg px-4 py-2 text-white focus:outline-none focus:ring-2 focus:ring-purple-500" placeholder="ip:port or domain"></div><div><label class="block text-sm text-gray-400 mb-1">Peer Name (Optional)</label><input id="peerName" type="text" class="w-full bg-gray-700 rounded-lg px-4 py-2 text-white focus:outline-none focus:ring-2 focus:ring-purple-500"></div><div class="pt-2"><button id="confirmAddPeerBtn" class="w-full bg-purple-600 hover:bg-purple-700 text-white px-4 py-3 rounded-lg transition-colors">Connect to Peer</button></div></div></div></div></div><!-- How It Works View --><div id="howItWorksView" class="hidden"><div class="bg-gray-800 rounded-xl p-6 shadow-lg mb-8"><h2 class="text-2xl font-bold mb-6 text-green-400 flex items-center"><i class="fas fa-question-circle mr-3"></i>How KWE Blockchain Works</h2><div class="space-y-8"><!-- Blockchain Basics --><div><div class="flex items-center justify-between cursor-pointer" onclick="toggleAccordion('basicsContent')"><h3 class="text-xl font-semibold text-blue-400 flex items-center"><i class="fas fa-cube mr-2"></i>Blockchain Technology Basics</h3><i class="fas fa-chevron-down transition-transform" id="basicsChevron"></i></div><div id="basicsContent" class="accordion-content mt-4 pl-2"><p class="mb-4">KWE Blockchain is a decentralized, distributed ledger that records transactions across a network of computers in a secure and immutable way. Each block in the chain contains multiple transactions and is linked to the previous block through cryptographic hashes.</p><div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-4"><div class="highlight-box p-4 rounded-lg"><h4 class="font-semibold text-green-400 mb-2"><i class="fas fa-lock mr-2"></i>Security Features</h4><ul class="list-disc list-inside space-y-1"><li>Cryptographic hashing (SHA-256)</li><li>Digital signatures for transaction verification</li><li>Decentralized consensus mechanism</li><li>Immutable ledger</li></ul></div><div class="highlight-box p-4 rounded-lg"><h4 class="font-semibold text-green-400 mb-2"><i class="fas fa-leaf mr-2"></i>Eco-Friendly Design</h4><ul class="list-disc list-inside space-y-1"><li>Proof-of-Stake consumes 99% less energy than PoW</li><li>Carbon-neutral transaction processing</li><li>Energy-efficient node requirements</li><li>Supports green energy initiatives</li></ul></div></div></div></div><!-- Consensus Mechanism --><div><div class="flex items-center justify-between cursor-pointer" onclick="toggleAccordion('consensusContent')"><h3 class="text-xl font-semibold text-purple-400 flex items-center"><i class="fas fa-project-diagram mr-2"></i>Proof-of-Stake Consensus Mechanism</h3><i class="fas fa-chevron-down transition-transform" id="consensusChevron"></i></div><div id="consensusContent" class="accordion-content mt-4 pl-2"><p class="mb-4">KWE uses an advanced Proof-of-Stake (PoS) consensus mechanism where validators are chosen to create new blocks based on the amount of KWE tokens they have staked and their reputation in the network.</p><h4 class="font-semibold mt-4 mb-2">How Block Creation Works:</h4><ol class="list-decimal list-inside space-y-2"><li>Validators lock up (stake) KWE tokens as collateral</li><li>The algorithm randomly selects a validator based on their stake</li><li>Selected validator creates and proposes the next block</li><li>Other validators verify and approve the block</li><li>Block is added to the chain and validator receives rewards</li></ol><div class="grid grid-cols-1 md:grid-cols-2 gap-4 mt-4"><div class="bg-gray-700 p-4 rounded-lg"><h4 class="font-semibold mb-2">Benefits of PoS:</h4><ul class="list-disc list-inside space-y-1"><li>Energy efficiency</li><li>Faster transaction finality</li><li>Better scalability</li><li>Rewards for participation</li></ul></div><div class="bg-gray-700 p-4 rounded-lg"><h4 class="font-semibold mb-2">Slashing Conditions:</h4><ul class="list-disc list-inside space-y-1"><li>Double signing blocks</li><li>Downtime exceeding 5%</li><li>Malicious behavior</li></ul></div></div></div></div><!-- Wallets Section --><div><div class="flex items-center justify-between cursor-pointer" onclick="toggleAccordion('walletsContent')"><h3 class="text-xl font-semibold text-yellow-400 flex items-center"><i class="fas fa-wallet mr-2"></i>KWE Wallets & Transactions</h3><i class="fas fa-chevron-down transition-transform" id="walletsChevron"></i></div><div id="walletsContent" class="accordion-content mt-4 pl-2"><p class="mb-4">KWE wallets allow users to securely store, send, receive, and stake KWE tokens. Each wallet is protected by private keys that should be stored securely.</p><div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-4"><div class="highlight-box p-4 rounded-lg"><div class="flex items-center mb-2"><i class="fas fa-key text-yellow-400 mr-2"></i><h4 class="font-semibold">Wallet Address Format</h4></div><p class="text-sm">KWE addresses start with "KWE" followed by 28 alphanumeric characters (Base58 encoding). Example: <code class="bg-gray-700 px-1">KWE5f8abc1234def5678ghi90jklm2345nopq6789rst</code></p></div><div class="highlight-box p-4 rounded-lg"><div class="flex items-center mb-2"><i class="fas fa-exchange-alt text-blue-400 mr-2"></i><h4 class="font-semibold">Transaction Lifecycle</h4></div><ol class="list-decimal list-inside text-sm space-y-1"><li>Created and signed with private key</li><li>Broadcast to network</li><li>Validated by nodes</li><li>Included in a block (1-5 seconds)</li><li>Confirmed (final after 6 blocks)</li></ol></div></div><h4 class="font-semibold mt-4 mb-2">Transaction Fees:</h4><p class="mb-4">KWE implements dynamic transaction fees based on network congestion, typically averaging:</p><div class="grid grid-cols-3 gap-4 text-center mb-4"><div class="bg-gray-700 p-3 rounded-lg"><div class="text-xs text-gray-400 mb-1">Simple Transfer</div><div class="font-mono">0.001 KWE</div></div><div class="bg-gray-700 p-3 rounded-lg"><div class="text-xs text-gray-400 mb-1">Smart Contract</div><div class="font-mono">0.01 KWE</div></div><div class="bg-gray-700 p-3 rounded-lg"><div class="text-xs text-gray-400 mb-1">Cross-Chain</div><div class="font-mono">0.1 KWE</div></div></div></div></div><!-- Validator Section --><div><div class="flex items-center justify-between cursor-pointer" onclick="toggleAccordion('validatorContent')"><h3 class="text-xl font-semibold text-green-400 flex items-center"><i class="fas fa-shield-alt mr-2"></i>Becoming a Validator</h3><i class="fas fa-chevron-down transition-transform" id="validatorChevron"></i></div><div id="validatorContent" class="accordion-content mt-4 pl-2"><p class="mb-4">Validators are network participants who propose and validate new blocks. Becoming a validator requires meeting specific requirements and maintaining network security.</p><h4 class="font-semibold mt-4 mb-2">Requirements:</h4><div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-4"><div class="bg-gray-700 p-4 rounded-lg"><div class="flex items-center mb-2"><i class="fas fa-coins text-yellow-400 mr-2"></i><h4>Staking Requirements</h4></div><ul class="list-disc list-inside space-y-1"><li>Minimum 10,000 KWE self-stake</li><li>Additional delegation possible</li><li>21-day unbonding period</li><li>95% uptime requirement</li></ul></div><div class="bg-gray-700 p-4 rounded-lg"><div class="flex items-center mb-2"><i class="fas fa-server text-blue-400 mr-2"></i><h4>Technical Requirements</h4></div><ul class="list-disc list-inside space-y-1"><li>Dedicated server (4+ cores, 16GB+ RAM)</li><li>SSD storage (500GB+ recommended)</li><li>Stable internet connection</li><li>Running official KWE node software</li></ul></div></div><h4 class="font-semibold mt-4 mb-2">Validator Economics:</h4><div class="grid grid-cols-1 md:grid-cols-3 gap-4 mb-4"><div class="bg-green-900 bg-opacity-30 p-3 rounded-lg"><div class="text-xs text-green-400 mb-1">Block Reward</div><div class="font-mono text-green-400">5.000000 KWE</div></div><div class="bg-green-900 bg-opacity-30 p-3 rounded-lg"><div class="text-xs text-green-400 mb-1">Validator Commission</div><div class="font-mono text-green-400">0-20%</div></div><div class="bg-green-900 bg-opacity-30 p-3 rounded-lg"><div class="text-xs text-green-400 mb-1">Annual Yield</div><div class="font-mono text-green-400">8-12%</div></div></div><div class="highlight-box p-4 rounded-lg"><h4 class="font-semibold text-green-400 mb-2"><i class="fas fa-route mr-2"></i>Becoming a Validator: Step-by-Step</h4><ol class="list-decimal list-inside space-y-2"><li>Acquire sufficient KWE tokens (min 10,000)</li><li>Set up server with required specifications</li><li>Install KWE node software and sync blockchain</li><li>Create validator identity and configure commission rate</li><li>Delegate your KWE tokens to yourself</li><li>Wait to be elected to active validator set</li><li>Maintain high uptime and good participation</li></ol></div></div></div><!-- Economy Section --><div><div class="flex items-center justify-between cursor-pointer" onclick="toggleAccordion('economyContent')"><h3 class="text-xl font-semibold text-indigo-400 flex items-center"><i class="fas fa-chart-pie mr-2"></i>KWE Token Economy</h3><i class="fas fa-chevron-down transition-transform" id="economyChevron"></i></div><div id="economyContent" class="accordion-content mt-4 pl-2"><div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-6"><div><h4 class="font-semibold mb-2">Token Distribution</h4><div class="bg-gray-700 rounded-lg p-4"><div class="space-y-3"><div class="flex justify-between items-center"><span class="text-sm">Community Staking Rewards</span><span class="font-mono">45%</span></div><div class="flex justify-between items-center"><span class="text-sm">Foundation</span><span class="font-mono">20%</span></div><div class="flex justify-between items-center"><span class="text-sm">Early Backers</span><span class="font-mono">15%</span></div><div class="flex justify-between items-center"><span class="text-sm">Team & Advisors</span><span class="font-mono">10%</span></div><div class="flex justify-between items-center"><span class="text-sm">Ecosystem Development</span><span class="font-mono">10%</span></div></div></div></div><div><h4 class="font-semibold mb-2">Inflation Model</h4><div class="bg-gray-700 rounded-lg p-4"><div class="space-y-3"><div class="flex justify-between items-center"><span class="text-sm">Initial Supply</span><span class="font-mono">1,000,000,000 KWE</span></div><div class="flex justify-between items-center"><span class="text-sm">Annual Inflation</span><span class="font-mono">5-8% (dynamic)</span></div><div class="flex justify-between items-center"><span class="text-sm">Target Staking Ratio</span><span class="font-mono">66%</span></div><div class="flex justify-between items-center"><span class="text-sm">Current Circulating Supply</span><span class="font-mono" id="circSupply">450,000,000 KWE</span></div></div></div></div></div><h4 class="font-semibold mb-2">Token Utility:</h4><div class="grid grid-cols-1 md:grid-cols-4 gap-3 mb-6"><div class="bg-gray-700 p-3 rounded-lg text-center"><i class="fas fa-coins text-yellow-400 text-2xl mb-2"></i><h5 class="font-medium">Staking</h5><p class="text-xs text-gray-400">Secure network & earn rewards</p></div><div class="bg-gray-700 p-3 rounded-lg text-center"><i class="fas fa-gavel text-purple-400 text-2xl mb-2"></i><h5 class="font-medium">Governance</h5><p class="text-xs text-gray-400">Vote on protocol changes</p></div><div class="bg-gray-700 p-3 rounded-lg text-center"><i class="fas fa-hand-holding-usd text-green-400 text-2xl mb-2"></i><h5 class="font-medium">Payments</h5><p class="text-xs text-gray-400">Low-fee transactions</p></div><div class="bg-gray-700 p-3 rounded-lg text-center"><i class="fas fa-fire-alt text-red-400 text-2xl mb-2"></i><h5 class="font-medium">Gas Fees</h5><p class="text-xs text-gray-400">Power smart contracts</p></div></div><h4 class="font-semibold mb-2">Value Capture:</h4><div class="grid grid-cols-1 md:grid-cols-3 gap-4"><div class="highlight-box p-4 rounded-lg"><h5 class="font-semibold mb-1"><i class="fas fa-network-wired mr-2 text-green-400"></i>Network Security</h5><p class="text-sm">More staked tokens → higher security → greater trust and adoption</p></div><div class="highlight-box p-4 rounded-lg"><h5 class="font-semibold mb-1"><i class="fas fa-exchange-alt mr-2 text-blue-400"></i>Transaction Volume</h5><p class="text-sm">Increased usage → higher demand for KWE → appreciation</p></div><div class="highlight-box p-4 rounded-lg"><h5 class="font-semibold mb-1"><i class="fas fa-code-branch mr-2 text-purple-400"></i>Ecosystem Growth</h5><p class="text-sm">More dApps and services → increased utility → higher valuation</p></div></div></div></div></div></div></div></div><script>// Configurationconst config = {addressPrefix: "KWE",decimals: 8,blockReward: 5.00000000,minStake: 1000.00000000,validators: [{ name: "GreenNode", stake: 50000.00000000 },{ name: "EcoStaker", stake: 35000.00000000 },{ name: "SustainableChain", stake: 42000.00000000 }],currentSupply: 450000000,inflationRate: 0.07 // 7%};// Statelet blockchain = [];let blockId = 0;let totalStaked = 0;let walletBalance = 1000.00000000; // Initial wallet balancelet walletStaked = 0.00000000;let walletAddress = '';let walletTransactions = [];let peers = [];let nodeId = '';let uptimeSeconds = 0;let uptimeInterval;// Accordion statelet accordionState = {basics: false,consensus: false,wallets: false,validator: false,economy: false};// DOM Elementsconst blockchainContainer = document.getElementById('blockchainContainer');const addBlockBtn = document.getElementById('addBlockBtn');const blockCount = document.getElementById('blockCount');const stakedTokens = document.getElementById('stakedTokens');const validatorCount = document.getElementById('validatorCount');const emptyState = document.getElementById('emptyState');const circSupply = document.getElementById('circSupply');// Viewsconst explorerView = document.getElementById('explorerView');const walletView = document.getElementById('walletView');const networkView = document.getElementById('networkView');const howItWorksView = document.getElementById('howItWorksView');// Tabsconst explorerTab = document.getElementById('explorerTab');const walletTab = document.getElementById('walletTab');const networkTab = document.getElementById('networkTab');const howItWorksTab = document.getElementById('howItWorksTab');// Wallet elementsconst walletBtn = document.getElementById('walletBtn');const walletAddressEl = document.getElementById('walletAddress');const walletBalanceEl = document.getElementById('walletBalance');const walletStakedEl = document.getElementById('walletStaked');const walletTransactionsEl = document.getElementById('walletTransactions');// Send transaction elementsconst sendBtn = document.getElementById('sendBtn');const sendModal = document.getElementById('sendModal');const closeSendModal = document.getElementById('closeSendModal');const recipientAddress = document.getElementById('recipientAddress');const sendAmount = document.getElementById('sendAmount');const sendMemo = document.getElementById('sendMemo');const confirmSendBtn = document.getElementById('confirmSendBtn');// Stake elementsconst stakeBtn = document.getElementById('stakeBtn');const stakeModal = document.getElementById('stakeModal');const closeStakeModal = document.getElementById('closeStakeModal');const selectValidator = document.getElementById('selectValidator');const stakeAmount = document.getElementById('stakeAmount');const confirmStakeBtn = document.getElementById('confirmStakeBtn');// Network elementsconst networkBtn = document.getElementById('networkBtn');const addPeerBtn = document.getElementById('addPeerBtn');const totalPeersEl = document.getElementById('totalPeers');const connectedPeersEl = document.getElementById('connectedPeers');const nodeIdEl = document.getElementById('nodeId');const connectionStatusEl = document.getElementById('connectionStatus');const connectionTimeEl = document.getElementById('connectionTime');const peerListEl = document.getElementById('peerList');// Peer modal elementsconst addPeerModal = document.getElementById('addPeerModal');const closePeerModal = document.getElementById('closePeerModal');const peerAddress = document.getElementById('peerAddress');const peerName = document.getElementById('peerName');const confirmAddPeerBtn = document.getElementById('confirmAddPeerBtn');// Accordion togglesfunction toggleAccordion(section) {const content = document.getElementById(section);const chevron = document.getElementById(section.replace('Content', 'Chevron'));if (content.style.maxHeight && content.style.maxHeight !== '0px') {content.style.maxHeight = '0px';chevron.classList.remove('rotate-180');} else {content.style.maxHeight = content.scrollHeight + 'px';chevron.classList.add('rotate-180');}}// Open all accordion sections for how it worksfunction openAllAccordions() {document.querySelectorAll('.accordion-content').forEach(el => {el.style.maxHeight = el.scrollHeight + 'px';});document.querySelectorAll('.accordion-content + i').forEach(chevron => {chevron.classList.add('rotate-180');});}// Initializefunction init() {// Generate wallet address if not existsif (!walletAddress) {walletAddress = generateKWEAddress();walletAddressEl.textContent = walletAddress;}// Generate node ID if not existsif (!nodeId) {nodeId = generateNodeId();nodeIdEl.textContent = nodeId;}// Initialize circulating supplycircSupply.textContent = `${config.currentSupply.toLocaleString()} KWE`;// Start uptime counterstartUptimeCounter();updateStats();updateWallet();updatePeerStats();addBlockBtn.addEventListener('click', addBlock);// Setup tab switchingsetupTabs();// Setup wallet modalssetupWalletModals();// Setup network modalssetupNetworkModals();// Open all accordions on how it works viewhowItWorksTab.addEventListener('click', openAllAccordions);}function setupTabs() {explorerTab.addEventListener('click', () => {explorerView.classList.remove('hidden');walletView.classList.add('hidden');networkView.classList.add('hidden');howItWorksView.classList.add('hidden');explorerTab.classList.add('tab-active');walletTab.classList.remove('tab-active');networkTab.classList.remove('tab-active');howItWorksTab.classList.remove('tab-active');});walletTab.addEventListener('click', () => {explorerView.classList.add('hidden');walletView.classList.remove('hidden');networkView.classList.add('hidden');howItWorksView.classList.add('hidden');explorerTab.classList.remove('tab-active');walletTab.classList.add('tab-active');networkTab.classList.remove('tab-active');howItWorksTab.classList.remove('tab-active');updateWallet();});networkTab.addEventListener('click', () => {explorerView.classList.add('hidden');walletView.classList.add('hidden');networkView.classList.remove('hidden');howItWorksView.classList.add('hidden');explorerTab.classList.remove('tab-active');walletTab.classList.remove('tab-active');networkTab.classList.add('tab-active');howItWorksTab.classList.remove('tab-active');updatePeerStats();});howItWorksTab.addEventListener('click', () => {explorerView.classList.add('hidden');walletView.classList.add('hidden');networkView.classList.add('hidden');howItWorksView.classList.remove('hidden');explorerTab.classList.remove('tab-active');walletTab.classList.remove('tab-active');networkTab.classList.remove('tab-active');howItWorksTab.classList.add('tab-active');});walletBtn.addEventListener('click', () => {explorerView.classList.add('hidden');walletView.classList.remove('hidden');networkView.classList.add('hidden');howItWorksView.classList.add('hidden');explorerTab.classList.remove('tab-active');walletTab.classList.add('tab-active');networkTab.classList.remove('tab-active');howItWorksTab.classList.remove('tab-active');updateWallet();});networkBtn.addEventListener('click', () => {explorerView.classList.add('hidden');walletView.classList.add('hidden');networkView.classList.remove('hidden');howItWorksView.classList.add('hidden');explorerTab.classList.remove('tab-active');walletTab.classList.remove('tab-active');networkTab.classList.add('tab-active');howItWorksTab.classList.remove('tab-active');updatePeerStats();});}function setupWalletModals() {// Send modalsendBtn.addEventListener('click', () => {sendModal.classList.remove('hidden');});closeSendModal.addEventListener('click', () => {sendModal.classList.add('hidden');});confirmSendBtn.addEventListener('click', () => {const amount = parseFloat(sendAmount.value);if (isNaN(amount) || amount <= 0) {alert('Please enter a valid amount');return;}if (amount > walletBalance) {alert('Insufficient balance');return;}const tx = {from: walletAddress,to: recipientAddress.value,amount: amount,memo: sendMemo.value || "Transaction",timestamp: new Date().toISOString(),status: "pending"};// In a real app, this would be sent to the networkwalletTransactions.unshift(tx);walletBalance -= amount;sendModal.classList.add('hidden');updateWallet();// Simulate confirmation after a delaysetTimeout(() => {tx.status = "confirmed";updateWallet();// Update circulating supply with simulated inflationif (Math.random() < 0.3) {config.currentSupply = Math.floor(config.currentSupply * (1 + config.inflationRate/365));circSupply.textContent = `${config.currentSupply.toLocaleString()} KWE`;}}, 3000);});// Stake modalstakeBtn.addEventListener('click', () => {stakeModal.classList.remove('hidden');});closeStakeModal.addEventListener('click', () => {stakeModal.classList.add('hidden');});confirmStakeBtn.addEventListener('click', () => {const amount = parseFloat(stakeAmount.value);if (isNaN(amount) || amount < config.minStake) {alert(`Please enter a valid amount (minimum ${formatAmount(config.minStake)} KWE)`);return;}if (amount > walletBalance) {alert('Insufficient balance');return;}const validator = selectValidator.value;// In a real app, this would be sent to the networkwalletBalance -= amount;walletStaked += amount;totalStaked += amount;// Add to transactionswalletTransactions.unshift({from: walletAddress,to: validator,amount: amount,memo: `Stake to ${validator}`,timestamp: new Date().toISOString(),status: "confirmed"});stakeModal.classList.add('hidden');updateWallet();updateStats();});}function setupNetworkModals() {// Add peer modaladdPeerBtn.addEventListener('click', () => {addPeerModal.classList.remove('hidden');});closePeerModal.addEventListener('click', () => {addPeerModal.classList.add('hidden');});confirmAddPeerBtn.addEventListener('click', () => {const address = peerAddress.value.trim();const name = peerName.value.trim() || address;if (!address) {alert('Please enter a peer address');return;}// Simulate connecting to peerpeers.push({id: generateNodeId(),address: address,name: name,status: Math.random() > 0.3 ? "connected" : "disconnected", // 70% chance of successlatency: Math.floor(Math.random() * 100) + 50 // random latency 50-150ms});addPeerModal.classList.add('hidden');updatePeerStats();// Clear formpeerAddress.value = '';peerName.value = '';});}function startUptimeCounter() {uptimeInterval = setInterval(() => {uptimeSeconds++;const hours = Math.floor(uptimeSeconds / 3600);const minutes = Math.floor((uptimeSeconds % 3600) / 60);const seconds = uptimeSeconds % 60;connectionTimeEl.textContent = `${hours}h ${minutes}m ${seconds}s`;}, 1000);}function generateNodeId() {const chars = '0123456789abcdef';let nodeId = '0x';for (let i = 0; i < 40; i++) {nodeId += chars.charAt(Math.floor(Math.random() * chars.length));}return nodeId;}// Generate a random KWE addressfunction generateKWEAddress() {const chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';let address = config.addressPrefix;for (let i = 0; i < 28; i++) {address += chars.charAt(Math.floor(Math.random() * chars.length));}return address;}// Format number with 8 decimalsfunction formatAmount(amount) {return amount.toFixed(config.decimals);}// Select a random validator based on their stakefunction selectRandomValidator() {const totalStake = config.validators.reduce((sum, validator) => sum + validator.stake, 0);let random = Math.random() * totalStake;for (const validator of config.validators) {if (random < validator.stake) {return validator;}random -= validator.stake;}return config.validators[0]; // fallback}// Calculate hash for a blockfunction calculateHash(block) {// Simplified hash calculation for demo purposesconst str = `${block.id}${block.timestamp}${block.previousHash}${block.validator}`;let hash = 0;for (let i = 0; i < str.length; i++) {const char = str.charCodeAt(i);hash = ((hash << 5) - hash) + char;hash |= 0; // Convert to 32bit integer}return `0000${Math.abs(hash).toString(16)}`.slice(-64);}// Add a new block to the blockchainfunction addBlock() {blockId++;const now = new Date();const timestamp = now.toISOString();const previousHash = blockchain.length > 0? blockchain[blockchain.length - 1].hash: "0".repeat(64);const validator = selectRandomValidator();const block = {id: blockId,timestamp,previousHash,validator: validator.name,transactions: [{from: "network",to: validator.name,amount: config.blockReward,memo: "Block reward"}]};block.hash = calculateHash(block);blockchain.push(block);// Update total staked (random fluctuation for demo)totalStaked = config.validators.reduce((sum, v) => sum + v.stake, 0);totalStaked += Math.random() * 1000 - 500; // random fluctuationrenderBlock(block);updateStats();// Remove empty state if it's the first blockif (blockId === 1) {emptyState.style.display = 'none';}}// Render a block to the DOMfunction renderBlock(block) {const blockElement = document.createElement('div');blockElement.className = 'block-animate bg-gray-800 rounded-xl p-6 block-shadow border-l-4 border-green-500';blockElement.innerHTML = `<div class="flex flex-col md:flex-row md:justify-between md:items-center mb-4"><div class="flex items-center mb-2 md:mb-0"><i class="fas fa-cube text-green-400 mr-2"></i><h3 class="text-lg font-semibold">Block #${block.id}</h3></div><div class="text-sm text-gray-400 font-mono">${block.timestamp}</div></div><div class="grid grid-cols-1 md:grid-cols-3 gap-4 mb-4"><div class="bg-gray-700 p-3 rounded-lg"><h4 class="text-xs text-gray-400 mb-1">Previous Hash</h4><p class="text-xs font-mono truncate">${block.previousHash}</p></div><div class="bg-gray-700 p-3 rounded-lg"><h4 class="text-xs text-gray-400 mb-1">Current Hash</h4><p class="text-xs font-mono truncate">${block.hash}</p></div><div class="bg-gray-700 p-3 rounded-lg"><h4 class="text-xs text-gray-400 mb-1">Validator</h4><p class="text-sm font-mono">${block.validator}</p></div></div><div class="mb-4"><h4 class="text-sm font-semibold mb-2 text-green-400">Transactions (${block.transactions.length})</h4><div class="space-y-2">${block.transactions.map(tx => `<div class="bg-gray-700 p-3 rounded-lg flex justify-between items-center"><div><div class="text-xs text-gray-400">${tx.from} → ${tx.to}</div><div class="text-xs">${tx.memo}</div></div><div class="text-green-400 font-mono">${formatAmount(tx.amount)} KWE</div></div>`).join('')}</div></div><div class="flex justify-between items-center text-xs text-gray-500"><div><i class="fas fa-bolt mr-1 text-yellow-400"></i><span>Proof-of-Stake</span></div><div><i class="fas fa-leaf mr-1 text-green-400"></i><span>Energy Efficient</span></div></div>`;blockchainContainer.insertBefore(blockElement, blockchainContainer.firstChild);}// Update wallet viewfunction updateWallet() {walletBalanceEl.textContent = `${formatAmount(walletBalance)} KWE`;walletStakedEl.textContent = `${formatAmount(walletStaked)} KWE`;if (walletTransactions.length > 0) {walletTransactionsEl.innerHTML = walletTransactions.map(tx => `<div class="bg-gray-700 p-3 rounded-lg flex justify-between items-center ${tx.status === 'confirmed' ? 'border-l-4 border-green-500' : 'border-l-4 border-yellow-500'}"><div><div class="flex items-center"><div class="text-xs text-gray-400">${tx.from} �� ${tx.to}</div>${tx.status === 'pending' ?'<span class="ml-2 text-xs bg-yellow-600 text-white px-2 py-0.5 rounded">Pending</span>' :'<span class="ml-2 text-xs bg-green-600 text-white px-2 py-0.5 rounded">Confirmed</span>'}</div><div class="text-xs truncate">${tx.memo}</div><div class="text-xs text-gray-500">${new Date(tx.timestamp).toLocaleString()}</div></div><div class="text-right"><div class="${tx.status === 'confirmed' ? 'text-green-400' : 'text-yellow-400'} font-mono">${formatAmount(tx.amount)} KWE</div></div></div>`).join('');} else {walletTransactionsEl.innerHTML = `<div class="text-center py-8 text-gray-500"><i class="fas fa-exchange-alt text-4xl mb-4"></i><p>No transactions yet</p></div>`;}}// Update peer statsfunction updatePeerStats() {totalPeersEl.textContent = peers.length;const connected = peers.filter(p => p.status === 'connected').length;connectedPeersEl.textContent = connected;if (peers.length > 0) {peerListEl.innerHTML = peers.map(peer => `<div class="bg-gray-700 p-4 rounded-lg flex justify-between items-center ${peer.status === 'connected' ? 'peer-status-connected' : 'peer-status-disconnected'}"><div><div class="font-medium">${peer.name}</div><div class="text-xs text-gray-400 font-mono">${peer.address}</div><div class="text-xs text-gray-400 mt-1">Node ID: ${peer.id}</div></div><div class="text-right"><div class="text-sm ${peer.status === 'connected' ? 'text-green-400' : 'text-red-400'}">${peer.status === 'connected' ? 'Connected' : 'Disconnected'}</div>${peer.status === 'connected' ? `<div class="text-xs">Latency: ${peer.latency}ms</div>` : ''}</div></div>`).join('');} else {peerListEl.innerHTML = `<div class="text-center py-8 text-gray-500"><i class="fas fa-network-wired text-4xl mb-4"></i><p>No peers connected</p></div>`;}}// Update statisticsfunction updateStats() {blockCount.textContent = blockId;stakedTokens.textContent = `${formatAmount(totalStaked)} KWE`;validatorCount.textContent = config.validators.length;}// Initialize the appinit();</script><p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - <a href="https://enzostvs-deepsite.hf.space?remix=DeadRyan/mytry11" style="color: #fff;text-decoration: underline;" target="_blank" >🧬 Remix</a></p></body></html>
README.md+7-5
index.html+1285-19