-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
executable file
·646 lines (568 loc) · 24.9 KB
/
index.html
File metadata and controls
executable file
·646 lines (568 loc) · 24.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Interactive Blockchain Demo</title>
<!-- Prism CSS -->
<link
href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism-tomorrow.min.css"
rel="stylesheet"
/>
<link
href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/plugins/toolbar/prism-toolbar.min.css"
rel="stylesheet"
/>
<!-- Custom CSS -->
<link rel="stylesheet" href="style.css" />
</head>
<body>
<h1>Interactive Blockchain Demo</h1>
<div id="explanation">
<h2>How it Works:</h2>
<ol>
<li>
<strong>Data Structure:</strong> While blockchain shares some characteristics with linked lists (using pointers to connect elements), it's fundamentally different. Unlike a simple linked list, blockchain uses cryptographic hashes as links and requires computational work (mining) to add new blocks. This makes it immutable and secure.
</li>
<li>
<strong>Blocks:</strong> The boxes below represent blocks in a chain. The first is the "Genesis Block". Each block is connected to the previous one through a cryptographic hash, creating an immutable chain.
</li>
<li>
<strong>Data:</strong> Each block holds data. You can type anything into the 'Data' text areas. However, once a block is mined, its data cannot be changed without invalidating the entire chain.
</li>
<li>
<strong>Hash:</strong> A unique digital fingerprint (SHA-256) of the block's content (Index, Timestamp, Data, Previous Hash, Nonce). It changes instantly if *any* content changes. This is different from a simple pointer in a linked list - it's a cryptographic proof of the block's content.
</li>
<li>
<strong>Previous Hash:</strong> Links a block to the one before it, creating the 'chain'. Unlike a linked list's pointer, this hash is a cryptographic proof that depends on the previous block's entire content. The Genesis Block has "0".
</li>
<li>
<strong>Nonce & Mining:</strong> To add a block securely (in a real blockchain), it must be 'mined'. Click 'Mine' to find a 'Nonce' (a random number) that makes the block's Hash start with "00" (our simple difficulty rule). This takes computational effort, which is a key difference from simple data structures.
</li>
<li>
<strong>Immutability:</strong> Try changing data in a *mined* block (green background). Notice its hash changes and no longer starts with "00". This breaks the 'Previous Hash' link for the *next* block, invalidating the chain! The chain status below will turn red. This immutability is a core feature that distinguishes blockchain from traditional data structures.
</li>
<li>
<strong>Fixing the Chain:</strong> To make a broken chain valid again, you must re-mine the tampered block *and* all subsequent blocks in order. This is because each block's hash depends on the previous block's content, creating a chain of cryptographic proofs.
</li>
</ol>
<p>
<strong>Goal:</strong> Add blocks, mine them, and try tampering with data to see how the hashes and chain validity change. Notice how this differs from a simple linked list - you can't just modify a pointer to fix a broken chain!
</p>
</div>
<div class="controls">
<button id="add-block-btn">Add New Block</button>
<button
id="export-chain-btn"
data-tooltip="Save your blockchain to a JSON file. Useful for sharing or backing up your work."
>
Export Chain
</button>
<button
id="import-chain-btn"
data-tooltip="Load a previously saved blockchain from a JSON file. This will replace your current chain."
>
Import Chain
</button>
<div id="chain-status">
Chain Status: <span class="valid">VALID</span>
</div>
<div id="chain-stats">
<p>Total Blocks: <span id="total-blocks">0</span></p>
<p>Average Mining Time: <span id="avg-mining-time">0</span> ms</p>
</div>
<div class="difficulty-control">
<label for="difficulty-select">Mining Difficulty:</label>
<select
id="difficulty-select"
data-tooltip="More leading zeros = longer mining time. Each additional zero makes it 16x harder to find a valid hash."
>
<option value="00">Easy (00)</option>
<option value="000">Medium (000)</option>
<option value="0000">Hard (0000)</option>
</select>
<span class="difficulty-info">More zeros = longer mining time</span>
</div>
</div>
<div id="blockchain">
<!-- Blocks will be added here by JavaScript -->
</div>
<div class="mining-math-section">
<h2>The Mathematics Behind Mining</h2>
<p>
Mining in blockchain is essentially a mathematical puzzle that requires
finding a hash that meets certain criteria. Here's how it works:
</p>
<div class="code-examples">
<h3>Code Examples</h3>
<div class="code-tabs">
<button class="tab-button active" data-lang="javascript">
JavaScript
</button>
<button class="tab-button" data-lang="python">Python</button>
<button class="tab-button" data-lang="cpp">C++</button>
<button class="tab-button" data-lang="java">Java</button>
<button class="tab-button" data-lang="ruby">Ruby</button>
<button class="tab-button" data-lang="swift">Swift</button>
<button class="tab-button" data-lang="go">Go</button>
<button class="tab-button" data-lang="rust">Rust</button>
</div>
<div class="code-content active" id="javascript">
<pre class="language-javascript"><code>// JavaScript Mining Implementation using Web Crypto API
// Function to mine a block with a given difficulty
async function mineBlock(data, difficulty) {
let nonce = 0; // Start with nonce = 0
const prefix = '0'.repeat(difficulty); // Create target prefix (e.g., "000")
// Keep trying different nonces until we find a valid hash
while (true) {
const hash = await calculateHash(data + nonce);
// Check if hash meets difficulty requirement
if (hash.startsWith(prefix)) {
return { nonce, hash }; // Found a valid hash!
}
nonce++; // Try next nonce value
}
}
// Helper function to calculate SHA-256 hash using Web Crypto API
async function calculateHash(input) {
// Convert input string to bytes
const encoder = new TextEncoder();
const data = encoder.encode(input);
// Calculate SHA-256 hash
const hashBuffer = await crypto.subtle.digest('SHA-256', data);
// Convert hash buffer to hexadecimal string
return Array.from(new Uint8Array(hashBuffer))
.map(b => b.toString(16).padStart(2, '0'))
.join('');
}
// Example usage with a sample block
const blockData = {
index: 1,
timestamp: Date.now(),
data: "Transaction Data",
previousHash: "0".repeat(64) // Previous hash (64 zeros for example)
};
// Try to mine the block with difficulty 4 (four leading zeros)
const result = await mineBlock(JSON.stringify(blockData), 4);
console.log(`Found nonce: ${result.nonce}, Hash: ${result.hash}`);</code></pre>
</div>
<div class="code-content" id="python">
<pre class="language-python"><code># Python Mining Implementation using hashlib
import hashlib
import json
import time
def calculate_hash(data: str) -> str:
"""Calculate SHA-256 hash of input data."""
return hashlib.sha256(data.encode()).hexdigest()
def mine_block(block_data: dict, difficulty: int) -> tuple[int, str]:
"""Mine a block by finding a hash with required number of leading zeros.
Args:
block_data: Dictionary containing block information
difficulty: Number of leading zeros required
Returns:
Tuple of (nonce, hash) that satisfies the difficulty requirement
"""
prefix = '0' * difficulty # Create target prefix (e.g., "000")
nonce = 0 # Start with nonce = 0
while True:
# Add current nonce to block data
block_data['nonce'] = nonce
# Convert block data to JSON string (sorted to ensure consistent hashing)
block_str = json.dumps(block_data, sort_keys=True)
# Calculate hash of block data with current nonce
hash_result = calculate_hash(block_str)
# Check if hash meets difficulty requirement
if hash_result.startswith(prefix):
return nonce, hash_result # Found a valid hash!
nonce += 1 # Try next nonce value
# Example usage with a sample block
block = {
'index': 1,
'timestamp': time.time(),
'data': "Transaction Data",
'previous_hash': "0" * 64 # Previous hash (64 zeros for example)
}
# Try to mine the block with difficulty 4 (four leading zeros)
nonce, hash_result = mine_block(block, 4)
print(f"Found nonce: {nonce}, Hash: {hash_result}")</code></pre>
</div>
<div class="code-content" id="cpp">
<pre class="language-cpp"><code>// C++ Mining Implementation using OpenSSL
#include <openssl/sha.h>
#include <string>
#include <iomanip>
#include <sstream>
class BlockMiner {
private:
// Helper function to calculate SHA-256 hash using OpenSSL
static std::string calculateHash(const std::string& input) {
unsigned char hash[SHA256_DIGEST_LENGTH];
SHA256_CTX sha256;
SHA256_Init(&sha256);
SHA256_Update(&sha256, input.c_str(), input.length());
SHA256_Final(hash, &sha256);
// Convert hash bytes to hexadecimal string
std::stringstream ss;
for(int i = 0; i < SHA256_DIGEST_LENGTH; i++) {
ss << std::hex << std::setw(2) << std::setfill('0')
<< static_cast<int>(hash[i]);
}
return ss.str();
}
public:
// Mine a block by finding a hash with required number of leading zeros
static std::pair<uint64_t, std::string> mineBlock(
const std::string& data,
int difficulty
) {
std::string prefix(difficulty, '0'); // Create target prefix (e.g., "000")
uint64_t nonce = 0; // Start with nonce = 0
while (true) {
// Combine data and current nonce
std::string input = data + std::to_string(nonce);
std::string hash = calculateHash(input);
// Check if hash meets difficulty requirement
if (hash.substr(0, difficulty) == prefix) {
return {nonce, hash}; // Found a valid hash!
}
nonce++; // Try next nonce value
}
}
};
// Example usage with a sample block
int main() {
// Create sample block data as JSON string
std::string blockData = R"({
"index": 1,
"timestamp": 1234567890,
"data": "Transaction Data",
"previousHash": "0000000000000000000000000000000000000000000000000000000000000000"
})";
// Try to mine the block with difficulty 4 (four leading zeros)
auto [nonce, hash] = BlockMiner::mineBlock(blockData, 4);
std::cout << "Found nonce: " << nonce << ", Hash: " << hash << std::endl;
return 0;
}</code></pre>
</div>
<div class="code-content" id="java">
<pre class="language-java"><code>// Java Mining Implementation using MessageDigest
import java.security.MessageDigest;
import java.nio.charset.StandardCharsets;
public class BlockMiner {
// Helper function to calculate SHA-256 hash
private static String calculateHash(String input) throws Exception {
MessageDigest digest = MessageDigest.getInstance("SHA-256");
byte[] hash = digest.digest(input.getBytes(StandardCharsets.UTF_8));
StringBuilder hexString = new StringBuilder();
for (byte b : hash) {
String hex = Integer.toHexString(0xff & b);
if (hex.length() == 1) hexString.append('0');
hexString.append(hex);
}
return hexString.toString();
}
// Mine a block by finding a hash with required number of leading zeros
public static MiningResult mineBlock(String data, int difficulty) throws Exception {
String prefix = "0".repeat(difficulty); // Create target prefix (e.g., "000")
long nonce = 0; // Start with nonce = 0
while (true) {
// Combine data and current nonce
String input = data + nonce;
String hash = calculateHash(input);
// Check if hash meets difficulty requirement
if (hash.startsWith(prefix)) {
return new MiningResult(nonce, hash); // Found a valid hash!
}
nonce++; // Try next nonce value
}
}
// Example usage with a sample block
public static void main(String[] args) throws Exception {
// Create sample block data as JSON string
String blockData = String.format("{" +
"\"index\": 1," +
"\"timestamp\": %d," +
"\"data\": \"Transaction Data\"," +
"\"previousHash\": \"%s\"" +
"}", System.currentTimeMillis(), "0".repeat(64));
// Try to mine the block with difficulty 4 (four leading zeros)
MiningResult result = mineBlock(blockData, 4);
System.out.printf("Found nonce: %d, Hash: %s%n",
result.nonce, result.hash);
}
// Helper class to hold mining result
static class MiningResult {
final long nonce;
final String hash;
MiningResult(long nonce, String hash) {
this.nonce = nonce;
this.hash = hash;
}
}
}</code></pre>
</div>
<div class="code-content" id="ruby">
<pre class="language-ruby"><code># Ruby Mining Implementation using Digest::SHA256
require 'digest'
require 'json'
class BlockMiner
# Calculate SHA-256 hash of input data
def self.calculate_hash(input)
Digest::SHA256.hexdigest(input)
end
# Mine a block by finding a hash with required number of leading zeros
def self.mine_block(data, difficulty)
prefix = '0' * difficulty # Create target prefix (e.g., "000")
nonce = 0 # Start with nonce = 0
loop do
# Combine data and current nonce
input = data + nonce.to_s
hash = calculate_hash(input)
# Check if hash meets difficulty requirement
return [nonce, hash] if hash.start_with?(prefix) # Found a valid hash!
nonce += 1 # Try next nonce value
end
end
end
# Example usage with a sample block
block_data = {
index: 1,
timestamp: Time.now.to_i,
data: "Transaction Data",
previous_hash: '0' * 64 # Previous hash (64 zeros for example)
}.to_json
# Try to mine the block with difficulty 4 (four leading zeros)
nonce, hash = BlockMiner.mine_block(block_data, 4)
puts "Found nonce: #{nonce}, Hash: #{hash}"</code></pre>
</div>
<div class="code-content" id="swift">
<pre class="language-swift"><code>// Swift Mining Implementation using CryptoKit
import Foundation
import CryptoKit
struct BlockMiner {
// Calculate SHA-256 hash of input string
static func calculateHash(_ input: String) -> String {
let inputData = input.data(using: .utf8)!
let hash = SHA256.hash(data: inputData)
// Convert hash bytes to hexadecimal string
return hash.compactMap { String(format: "%02x", $0) }.joined()
}
// Mine a block by finding a hash with required number of leading zeros
static func mineBlock(data: String, difficulty: Int) -> (nonce: Int, hash: String) {
let prefix = String(repeating: "0", count: difficulty) // Create target prefix
var nonce = 0 // Start with nonce = 0
while true {
// Combine data and current nonce
let input = data + String(nonce)
let hash = calculateHash(input)
// Check if hash meets difficulty requirement
if hash.hasPrefix(prefix) {
return (nonce, hash) // Found a valid hash!
}
nonce += 1 // Try next nonce value
}
}
}
// Example usage with a sample block
let blockData = [
"index": 1,
"timestamp": Date().timeIntervalSince1970,
"data": "Transaction Data",
"previousHash": String(repeating: "0", count: 64) // Previous hash (64 zeros)
] as [String : Any]
// Convert block data to JSON string
let jsonData = try! JSONSerialization.data(withJSONObject: blockData)
let jsonString = String(data: jsonData, encoding: .utf8)!
// Try to mine the block with difficulty 4 (four leading zeros)
let (nonce, hash) = BlockMiner.mineBlock(data: jsonString, difficulty: 4)
print("Found nonce: \(nonce), Hash: \(hash)")</code></pre>
</div>
<div class="code-content" id="go">
<pre class="language-go"><code>// Go Mining Implementation using crypto/sha256
package main
import (
"crypto/sha256"
"encoding/hex"
"encoding/json"
"fmt"
"strings"
"time"
)
// Calculate SHA-256 hash of input string
func calculateHash(input string) string {
hash := sha256.Sum256([]byte(input))
return hex.EncodeToString(hash[:])
}
// Mine a block by finding a hash with required number of leading zeros
func mineBlock(data string, difficulty int) (int, string) {
prefix := strings.Repeat("0", difficulty) // Create target prefix (e.g., "000")
nonce := 0 // Start with nonce = 0
for {
// Combine data and current nonce
input := data + fmt.Sprint(nonce)
hash := calculateHash(input)
// Check if hash meets difficulty requirement
if strings.HasPrefix(hash, prefix) {
return nonce, hash // Found a valid hash!
}
nonce++ // Try next nonce value
}
}
func main() {
// Create sample block data
blockData := struct {
Index int `json:"index"`
Timestamp int64 `json:"timestamp"`
Data string `json:"data"`
PreviousHash string `json:"previousHash"`
}{
Index: 1,
Timestamp: time.Now().Unix(),
Data: "Transaction Data",
PreviousHash: strings.Repeat("0", 64), // Previous hash (64 zeros)
}
// Convert block data to JSON string
jsonData, _ := json.Marshal(blockData)
// Try to mine the block with difficulty 4 (four leading zeros)
nonce, hash := mineBlock(string(jsonData), 4)
fmt.Printf("Found nonce: %d, Hash: %s\n", nonce, hash)
}</code></pre>
</div>
<div class="code-content" id="rust">
<pre class="language-rust"><code>// Rust Mining Implementation using sha2 crate
use sha2::{Sha256, Digest};
use serde::{Serialize, Deserialize};
use std::time::{SystemTime, UNIX_EPOCH};
// Block structure definition
#[derive(Serialize)]
struct Block {
index: u32,
timestamp: u64,
data: String,
previous_hash: String,
}
// Calculate SHA-256 hash of input string
fn calculate_hash(input: &str) -> String {
let mut hasher = Sha256::new();
hasher.update(input.as_bytes());
format!("{:x}", hasher.finalize())
}
// Mine a block by finding a hash with required number of leading zeros
fn mine_block(data: &str, difficulty: usize) -> (u64, String) {
let prefix = "0".repeat(difficulty); // Create target prefix (e.g., "000")
let mut nonce = 0u64; // Start with nonce = 0
loop {
// Combine data and current nonce
let input = format!("{}{}", data, nonce);
let hash = calculate_hash(&input);
// Check if hash meets difficulty requirement
if hash.starts_with(&prefix) {
return (nonce, hash); // Found a valid hash!
}
nonce += 1; // Try next nonce value
}
}
fn main() {
// Create sample block data
let block = Block {
index: 1,
timestamp: SystemTime::now()
.duration_since(UNIX_EPOCH)
.unwrap()
.as_secs(),
data: String::from("Transaction Data"),
previous_hash: "0".repeat(64), // Previous hash (64 zeros)
};
// Convert block data to JSON string
let json_data = serde_json::to_string(&block).unwrap();
// Try to mine the block with difficulty 4 (four leading zeros)
let (nonce, hash) = mine_block(&json_data, 4);
println!("Found nonce: {}, Hash: {}", nonce, hash);
}</code></pre>
</div>
</div>
<div class="math-explanation">
<h3>Understanding the Mathematics of Mining</h3>
<ul>
<li>
<strong>Hash Function (SHA-256):</strong>
<ul>
<li>Produces a 256-bit (64 character) hexadecimal output</li>
<li>Each character can be 0-9 or a-f (16 possibilities)</li>
<li>The output is deterministic but appears random</li>
<li>Small input changes create completely different hashes</li>
</ul>
</li>
<li>
<strong>Mining Probability:</strong>
<ul>
<li>Each character position has 1/16 chance of being any specific value</li>
<li>For difficulty "00" (2 zeros): (1/16)² = 1/256 chance per attempt</li>
<li>For difficulty "000" (3 zeros): (1/16)³ = 1/4,096 chance per attempt</li>
<li>For difficulty "0000" (4 zeros): (1/16)⁴ = 1/65,536 chance per attempt</li>
</ul>
</li>
<li>
<strong>Expected Mining Attempts:</strong>
<ul>
<li>Average attempts needed = 16ⁿ (where n is number of required zeros)</li>
<li>For "00": ~256 attempts on average</li>
<li>For "000": ~4,096 attempts on average</li>
<li>For "0000": ~65,536 attempts on average</li>
</ul>
</li>
<li>
<strong>Real-World Bitcoin Mining:</strong>
<ul>
<li>Bitcoin requires many more leading zeros (currently ~19-20 zeros)</li>
<li>This means approximately 16²⁰ attempts needed!</li>
<li>That's why specialized mining hardware (ASICs) is needed</li>
<li>The network automatically adjusts difficulty to maintain ~10 minute block times</li>
</ul>
</li>
<li>
<strong>Why Mining is Important:</strong>
<ul>
<li>Creates a "Proof of Work" - shows computational effort was spent</li>
<li>Makes it expensive to modify past blocks (would need to re-mine)</li>
<li>Difficulty can be adjusted to control block creation rate</li>
<li>Creates a fair, decentralized way to agree on blockchain state</li>
</ul>
</li>
<li>
<strong>Mining Process Details:</strong>
<ul>
<li>Block data + nonce + previous hash are combined</li>
<li>SHA-256 hash is calculated on this combined data</li>
<li>If hash doesn't start with required zeros, increment nonce</li>
<li>Process repeats until a valid hash is found</li>
<li>This is why mining takes longer with more required zeros</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- Network visualization container -->
<!-- <div id="network-visualization" class="hidden">
<h2>Blockchain Network Visualization</h2>
<canvas id="network-canvas"></canvas>
</div> -->
<!-- Prism JS - Core and plugins -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-core.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/plugins/toolbar/prism-toolbar.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/plugins/copy-to-clipboard/prism-copy-to-clipboard.min.js"></script>
<!-- Prism language components -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-clike.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-javascript.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-python.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-c.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-cpp.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-java.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-ruby.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-swift.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-go.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-rust.min.js"></script>
<!-- Custom JS -->
<script src="script.js"></script>
</body>
</html>