{"id":468,"date":"2026-09-21T19:05:47","date_gmt":"2026-09-21T19:05:47","guid":{"rendered":"https:\/\/ndovu.org.uk\/cs\/?p=468"},"modified":"2026-09-21T19:41:46","modified_gmt":"2026-09-21T19:41:46","slug":"yr5-term-1-1-6-blockchain","status":"publish","type":"post","link":"https:\/\/ndovu.org.uk\/cs\/yr5-term-1-1-6-blockchain\/","title":{"rendered":"Yr5 Term 1.1.6 Blockchain"},"content":{"rendered":"\n<p><strong>Welcome to Year 5 Computing \u2014 Lesson 6! \ud83d\udd17\ud83d\udcbb<\/strong><\/p>\n<p>Today we are exploring the technology of the future: <strong>Blockchain<\/strong>! We will learn how <em>Public and Private Keys<\/em> act like digital signatures, and how a shared chain of blocks keeps our data completely safe from hackers.<\/p>\n\n<p><strong>Step 1: Keyboard Warm-up \u2328\ufe0f (10 Mins)<\/strong><\/p>\n<ul>\n  <li>Click here to warm up your fingers on our typing studio: <a href=\"https:\/\/ndovu.org.uk\/type\/\" target=\"_blank\" rel=\"noopener\">Start Typing Practice on Ndovu<\/a>.<\/li>\n  <li>Today&#8217;s keywords: <em>blockchain, ledger, public key, private key, signature, mining, transaction.<\/em><\/li>\n<\/ul>\n\n<p><strong>Step 2: Digital Signatures &#038; Blockchain Simulators \ud83d\udd10 (20 Mins)<\/strong><\/p>\n\n<!-- SCOPED INTERACTIVE LESSON WIDGET MODULE -->\n<div id=\"y5-l6-widget\" style=\"max-width: 850px; margin: 20px auto; font-family: Arial, sans-serif; border: 2px solid #ddd; border-radius: 10px; padding: 20px; background-color: #fcfcfc; box-shadow: 0 4px 8px rgba(0,0,0,0.05);\">\n\n  <!-- Simulator 1: Digital Signatures -->\n  <div style=\"background: #e6f2f8; border: 2px solid #0073aa; border-radius: 8px; padding: 15px; margin-bottom: 25px;\">\n    <h3 style=\"margin-top: 0; color: #0073aa;\">Simulator 1: Digital Signatures \u270d\ufe0f<\/h3>\n    <p style=\"font-size: 14px; line-height: 1.5;\"><strong>Goal:<\/strong> See how a private key acts like an unbreakable digital wax seal.<\/p>\n    <ul style=\"font-size: 13px; line-height: 1.4; margin-top: 5px;\">\n      <li><strong>Step 1:<\/strong> Type a message with a specific detail. <em>(Examples: &#8216;Alice pays Pat 10 euros&#8217;, &#8216;Transfer 100 V-Bucks&#8217;, or &#8216;School ends at 3:15&#8217;)<\/em>.<\/li>\n      <li><strong>Step 2:<\/strong> Click <strong>Sign<\/strong>. This locks the message with a mathematical signature.<\/li>\n      <li><strong>Step 3:<\/strong> Become a hacker! Change a number or name in your message box.<\/li>\n      <li><strong>Step 4:<\/strong> Click <strong>Verify<\/strong> to see if the network catches your hack!<\/li>\n    <\/ul>\n    \n    <input type=\"text\" id=\"sim1-message\" value=\"Alice pays Pat 10 euros\" style=\"width: 100%; padding: 10px; font-family: monospace; font-size: 14px; border: 1px solid #ccc; border-radius: 5px; margin-bottom: 10px;\">\n    \n    <div style=\"display: flex; gap: 10px; margin-bottom: 10px; flex-wrap: wrap;\">\n      <button type=\"button\" id=\"y5-sign-btn\" style=\"background: #0073aa; color: white; border: none; padding: 8px 15px; border-radius: 4px; cursor: pointer; font-weight: bold;\">\ud83d\udd11 Sign (Private Key)<\/button>\n      <button type=\"button\" id=\"y5-verify-btn\" style=\"background: #4CAF50; color: white; border: none; padding: 8px 15px; border-radius: 4px; cursor: pointer; font-weight: bold;\">\ud83d\udc41\ufe0f Verify (Public Key)<\/button>\n    <\/div>\n    \n    <div style=\"background: #fff; padding: 10px; border: 1px dashed #ccc; border-radius: 5px; font-family: monospace; font-size: 13px;\">\n      <strong>Digital Signature Created: <\/strong><span id=\"sim1-signature\" style=\"color: #666;\">(Not signed yet)<\/span><br><br>\n      <strong>Security Status: <\/strong><span id=\"sim1-status\" style=\"font-weight: bold;\">Waiting for signature&#8230;<\/span>\n    <\/div>\n  <\/div>\n\n  <!-- Simulator 2: Mini Blockchain -->\n  <div style=\"background: #fff3e0; border: 2px solid #ff9800; border-radius: 8px; padding: 15px; margin-bottom: 25px;\">\n    <h3 style=\"margin-top: 0; color: #e65100;\">Simulator 2: Mine a Blockchain \u26cf\ufe0f<\/h3>\n    <p style=\"font-size: 14px; line-height: 1.5;\"><strong>Goal:<\/strong> Understand why blockchains are unhackable. They rely on &#8220;Fingerprints&#8221; (hashes) that connect one block to the next.<\/p>\n    <ul style=\"font-size: 13px; line-height: 1.4; margin-top: 5px;\">\n      <li><strong>Step 1:<\/strong> Type a new transaction into Block 1 <em>(e.g., &#8216;Give 50 gold to Sam&#8217;)<\/em>. Watch the fingerprint instantly change!<\/li>\n      <li><strong>Step 2:<\/strong> Click <strong>Mine Block 1<\/strong>. This locks the block and passes its fingerprint to Block 2.<\/li>\n      <li><strong>Step 3:<\/strong> Repeat for Block 2 <em>(e.g., &#8216;Give 100 gold to Ali&#8217;)<\/em>, and then Block 3. Turn all blocks green!<\/li>\n      <li><strong>Step 4:<\/strong> <strong>The Hack:<\/strong> Go back to Block 1 and change &#8217;50&#8217; to &#8216;5000&#8217;. Watch how changing past data instantly breaks all the chain links!<\/li>\n    <\/ul>\n    \n    <div style=\"display: flex; gap: 10px; flex-wrap: wrap;\">\n      <!-- Block 1 -->\n      <div style=\"flex: 1; min-width: 200px; background: #fff; border: 2px solid #ccc; border-radius: 5px; padding: 10px; transition: border-color 0.3s;\" id=\"block1-container\">\n        <h4 style=\"margin: 0 0 10px 0;\">Block 1<\/h4>\n        <input type=\"text\" id=\"block1-data\" value=\"Tx: 5 Coins to Alice\" style=\"width: 100%; padding: 5px; margin-bottom: 10px; box-sizing: border-box;\">\n        <div style=\"font-size: 11px; margin-bottom: 5px; color: #555;\">Links to: [START]<\/div>\n        <div style=\"font-size: 11px; margin-bottom: 10px; color: #555;\">Block 1 Fingerprint:<br><span id=\"block1-hash\" style=\"font-family: monospace; font-weight: bold;\">&#8230;<\/span><\/div>\n        <button type=\"button\" id=\"y5-mine1-btn\" style=\"width: 100%; background: #ff9800; color: white; border: none; padding: 5px; border-radius: 3px; cursor: pointer; font-weight: bold;\">Mine Block 1<\/button>\n      <\/div>\n\n      <!-- Chain Link 1 -->\n      <div style=\"display: flex; align-items: center; font-size: 24px; color: #ccc;\" id=\"link1-2\">\ud83d\udd17<\/div>\n\n      <!-- Block 2 -->\n      <div style=\"flex: 1; min-width: 200px; background: #fff; border: 2px solid #ccc; border-radius: 5px; padding: 10px; transition: border-color 0.3s;\" id=\"block2-container\">\n        <h4 style=\"margin: 0 0 10px 0;\">Block 2<\/h4>\n        <input type=\"text\" id=\"block2-data\" value=\"Tx: 12 Coins to Bob\" style=\"width: 100%; padding: 5px; margin-bottom: 10px; box-sizing: border-box;\">\n        <div style=\"font-size: 11px; margin-bottom: 5px; color: #555;\">Links to:<br><span id=\"block2-prevhash\" style=\"font-family: monospace;\">&#8230;<\/span><\/div>\n        <div style=\"font-size: 11px; margin-bottom: 10px; color: #555;\">Block 2 Fingerprint:<br><span id=\"block2-hash\" style=\"font-family: monospace; font-weight: bold;\">&#8230;<\/span><\/div>\n        <button type=\"button\" id=\"y5-mine2-btn\" style=\"width: 100%; background: #ccc; color: white; border: none; padding: 5px; border-radius: 3px; cursor: not-allowed;\" disabled>Mine Block 2<\/button>\n      <\/div>\n\n      <!-- Chain Link 2 -->\n      <div style=\"display: flex; align-items: center; font-size: 24px; color: #ccc;\" id=\"link2-3\">\ud83d\udd17<\/div>\n\n      <!-- Block 3 -->\n      <div style=\"flex: 1; min-width: 200px; background: #fff; border: 2px solid #ccc; border-radius: 5px; padding: 10px; transition: border-color 0.3s;\" id=\"block3-container\">\n        <h4 style=\"margin: 0 0 10px 0;\">Block 3<\/h4>\n        <input type=\"text\" id=\"block3-data\" value=\"Tx: 3 Coins to Sam\" style=\"width: 100%; padding: 5px; margin-bottom: 10px; box-sizing: border-box;\">\n        <div style=\"font-size: 11px; margin-bottom: 5px; color: #555;\">Links to:<br><span id=\"block3-prevhash\" style=\"font-family: monospace;\">&#8230;<\/span><\/div>\n        <div style=\"font-size: 11px; margin-bottom: 10px; color: #555;\">Block 3 Fingerprint:<br><span id=\"block3-hash\" style=\"font-family: monospace; font-weight: bold;\">&#8230;<\/span><\/div>\n        <button type=\"button\" id=\"y5-mine3-btn\" style=\"width: 100%; background: #ccc; color: white; border: none; padding: 5px; border-radius: 3px; cursor: not-allowed;\" disabled>Mine Block 3<\/button>\n      <\/div>\n    <\/div>\n    <p id=\"blockchain-warning\" style=\"color: #e53935; font-weight: bold; font-size: 14px; text-align: center; display: none; margin-top: 15px;\">\u26a0\ufe0f HACK DETECTED! The chain is broken!<\/p>\n  <\/div>\n\n<\/div>\n\n<p><strong>Step 3: Video Reflection \u2014 Blockchain Societal Impact \ud83c\udfac (10 Mins)<\/strong><\/p>\n<p>Watch the video below to discover how blockchain is used in the real world outside of just money. Then, answer the reflection questions and download your report!<\/p>\n\n<div style=\"max-width: 850px; margin: 20px auto; font-family: Arial, sans-serif; border: 2px solid #ddd; border-radius: 10px; padding: 20px; background-color: #fcfcfc; box-shadow: 0 4px 8px rgba(0,0,0,0.05);\">\n  <div style=\"text-align: center; margin-bottom: 20px; border-radius: 8px; overflow: hidden; border: 2px solid #0073aa; aspect-ratio: 16 \/ 9; width: 100%;\">\n    <iframe style=\"width: 100%; height: 100%;\" src=\"https:\/\/www.youtube.com\/embed\/C3C_JfG8cNg\" title=\"YouTube video player\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen><\/iframe>\n  <\/div>\n\n  <div style=\"background: #fff; border: 1px solid #ccc; border-radius: 8px; padding: 15px; margin-bottom: 15px;\">\n    <label style=\"font-weight: bold; display: block; margin-bottom: 5px; font-size: 14px;\">1. What is one way people can use blockchain mentioned in the video other than money? (Tip: think about contracts or tracking things!)<\/label>\n    <textarea id=\"q1-video\" rows=\"2\" style=\"width: 100%; font-family: Arial, sans-serif; font-size: 13px; padding: 10px; border: 1px solid #ccc; border-radius: 5px; box-sizing: border-box;\" placeholder=\"Type your answer here...\"><\/textarea>\n  <\/div>\n\n  <div style=\"background: #fff; border: 1px solid #ccc; border-radius: 8px; padding: 15px; margin-bottom: 15px;\">\n    <label style=\"font-weight: bold; display: block; margin-bottom: 5px; font-size: 14px;\">2. What environmental concern did the speakers have about some blockchains (like Bitcoin)?<\/label>\n    <textarea id=\"q2-video\" rows=\"2\" style=\"width: 100%; font-family: Arial, sans-serif; font-size: 13px; padding: 10px; border: 1px solid #ccc; border-radius: 5px; box-sizing: border-box;\" placeholder=\"It uses a lot of...\"><\/textarea>\n  <\/div>\n\n  <div style=\"text-align: right;\">\n    <button type=\"button\" id=\"y5-dl-btn\" style=\"background-color: #4CAF50; color: white; border: none; padding: 12px 25px; border-radius: 5px; cursor: pointer; font-size: 16px; font-weight: bold;\">\ud83d\udcbe Download Lesson 6 Report<\/button>\n  <\/div>\n<\/div>\n\n<p><strong>Step 4: Continue on Code.org \ud83d\ude80 (15 Mins)<\/strong><\/p>\n<p>Now that you know how a blockchain stops hackers, let&#8217;s put it into practice on Code.org!<\/p>\n<div style=\"background-color: #ffebee; border-left: 5px solid #e53935; padding: 15px 20px; border-radius: 8px; margin-bottom: 20px; text-align: center;\">\n  <p style=\"margin-top: 0; font-weight: bold; font-size: 16px; color: #b71c1c;\">Mission: Launch Code.org Blockchain Unit<\/p>\n  <p style=\"margin-bottom: 15px; font-size: 14px;\">Click the button below to go directly to Lesson 2, Level 1 of your Blockchain module!<\/p>\n  <a href=\"https:\/\/studio.code.org\/courses\/blockchain-2023\/units\/1\/lessons\/2\/levels\/1?section_id=6733809\" target=\"_blank\" rel=\"noopener\" style=\"display: inline-block; background-color: #e53935; color: white; padding: 12px 25px; border-radius: 5px; text-decoration: none; font-weight: bold; font-size: 16px;\">Launch Code.org Blockchain \u2794<\/a>\n<\/div>\n\n<p><strong>Step 5: Log Off and Reflect \ud83d\udc4b (5 Mins)<\/strong><\/p>\n<ul>\n  <li><strong>Exit Ticket:<\/strong> Why is it impossible for a hacker to change information in an old block without everyone on the network noticing?<\/li>\n  <li>Log out securely and tidy your desk space!<\/li>\n<\/ul>\n\n<script>\ndocument.addEventListener('DOMContentLoaded', function() {\n  var sig = '';\n  var blk = [\n    { m: false, h: '', p: '00000000' },\n    { m: false, h: '', p: '' },\n    { m: false, h: '', p: '' }\n  ];\n\n  \/\/ Hash function rewritten completely without angle brackets\n  function getHash(str) {\n    var h = 0;\n    var chars = str.split('');\n    for (var i = 0; i != chars.length; i++) {\n      h = (h * 31 + chars[i].charCodeAt(0)) | 0;\n    }\n    return Math.abs(h).toString(16).padStart(8, '0').toUpperCase();\n  }\n\n  var signBtn = document.getElementById('y5-sign-btn');\n  if (signBtn) {\n    signBtn.addEventListener('click', function() {\n      var val = document.getElementById('sim1-message').value;\n      sig = getHash(val + 'SECRET');\n      var sigEl = document.getElementById('sim1-signature');\n      sigEl.innerText = sig;\n      sigEl.style.color = '#0073aa';\n      var statEl = document.getElementById('sim1-status');\n      statEl.innerText = 'Signed! Now act like a hacker: alter text and click Verify.';\n      statEl.style.color = '#333';\n    });\n  }\n\n  var verifyBtn = document.getElementById('y5-verify-btn');\n  if (verifyBtn) {\n    verifyBtn.addEventListener('click', function() {\n      if (!sig) { alert('Please sign first!'); return; }\n      var val = document.getElementById('sim1-message').value;\n      var check = getHash(val + 'SECRET');\n      var statEl = document.getElementById('sim1-status');\n      if (check === sig) {\n        statEl.innerText = '\u2705 Verification Passed! Matches perfectly.';\n        statEl.style.color = '#4CAF50';\n      } else {\n        statEl.innerText = '\u274c HACK DETECTED! Message was changed!';\n        statEl.style.color = '#e53935';\n      }\n    });\n  }\n\n  function updateChain() {\n    var d1 = document.getElementById('block1-data').value;\n    var h1 = getHash(d1 + blk[0].p);\n    document.getElementById('block1-hash').innerText = h1;\n\n    var d2 = document.getElementById('block2-data').value;\n    var p2 = blk[0].m ? blk[0].h : h1;\n    document.getElementById('block2-prevhash').innerText = p2;\n    var h2 = getHash(d2 + p2);\n    document.getElementById('block2-hash').innerText = h2;\n\n    var d3 = document.getElementById('block3-data').value;\n    var p3 = blk[1].m ? blk[1].h : h2;\n    document.getElementById('block3-prevhash').innerText = p3;\n    var h3 = getHash(d3 + p3);\n    document.getElementById('block3-hash').innerText = h3;\n\n    return [h1, h2, h3];\n  }\n\n  function checkHack() {\n    var ch = updateChain();\n    var broken = false;\n    if (blk[0].m && ch[0] !== blk[0].h) {\n      broken = true;\n      document.getElementById('block1-container').style.borderColor = '#e53935';\n      document.getElementById('y5-mine1-btn').innerText = 'Remine Block 1';\n      document.getElementById('y5-mine1-btn').style.background = '#e53935';\n      blk[0].m = false;\n    }\n    if (blk[1].m && ch[1] !== blk[1].h) {\n      broken = true;\n      document.getElementById('block2-container').style.borderColor = '#e53935';\n      document.getElementById('y5-mine2-btn').innerText = 'Remine Block 2';\n      document.getElementById('y5-mine2-btn').style.background = '#e53935';\n      document.getElementById('link1-2').innerText = '\ud83d\udc94';\n      document.getElementById('link1-2').style.color = '#e53935';\n      blk[1].m = false;\n    }\n    if (blk[2].m && ch[2] !== blk[2].h) {\n      broken = true;\n      document.getElementById('block3-container').style.borderColor = '#e53935';\n      document.getElementById('y5-mine3-btn').innerText = 'Remine Block 3';\n      document.getElementById('y5-mine3-btn').style.background = '#e53935';\n      document.getElementById('link2-3').innerText = '\ud83d\udc94';\n      document.getElementById('link2-3').style.color = '#e53935';\n      blk[2].m = false;\n    }\n    if (broken) {\n      document.getElementById('blockchain-warning').style.display = 'block';\n    }\n  }\n\n  document.getElementById('block1-data').addEventListener('input', checkHack);\n  document.getElementById('block2-data').addEventListener('input', checkHack);\n  document.getElementById('block3-data').addEventListener('input', checkHack);\n\n  function doMine(n) {\n    var ch = updateChain();\n    if (n === 2 && !blk[0].m) { alert('Mine Block 1 first!'); return; }\n    if (n === 3 && !blk[1].m) { alert('Mine Block 2 first!'); return; }\n    \n    blk[n-1].m = true;\n    blk[n-1].h = ch[n-1];\n    \n    document.getElementById('block' + n + '-container').style.borderColor = '#4CAF50';\n    var btn = document.getElementById('y5-mine' + n + '-btn');\n    btn.innerText = 'Mined \u2705';\n    btn.style.background = '#4CAF50';\n    \n    if (n === 1) {\n      var b2 = document.getElementById('y5-mine2-btn');\n      b2.disabled = false;\n      b2.style.background = '#ff9800';\n      b2.style.cursor = 'pointer';\n      var l1 = document.getElementById('link1-2');\n      l1.innerText = '\ud83d\udd17';\n      l1.style.color = '#4CAF50';\n    }\n    if (n === 2) {\n      var b3 = document.getElementById('y5-mine3-btn');\n      b3.disabled = false;\n      b3.style.background = '#ff9800';\n      b3.style.cursor = 'pointer';\n      var l2 = document.getElementById('link2-3');\n      l2.innerText = '\ud83d\udd17';\n      l2.style.color = '#4CAF50';\n    }\n    \n    document.getElementById('blockchain-warning').style.display = 'none';\n    updateChain();\n  }\n\n  var mb1 = document.getElementById('y5-mine1-btn');\n  if (mb1) mb1.addEventListener('click', function() { doMine(1); });\n  var mb2 = document.getElementById('y5-mine2-btn');\n  if (mb2) mb2.addEventListener('click', function() { doMine(2); });\n  var mb3 = document.getElementById('y5-mine3-btn');\n  if (mb3) mb3.addEventListener('click', function() { doMine(3); });\n\n  var dlBtn = document.getElementById('y5-dl-btn');\n  if (dlBtn) {\n    dlBtn.addEventListener('click', function() {\n      var a1 = document.getElementById('q1-video').value.trim() || 'No answer provided.';\n      var a2 = document.getElementById('q2-video').value.trim() || 'No answer provided.';\n      var txt = 'Lesson 6: Blockchain Report\\n\\n1. Non-financial uses:\\n' + a1 + '\\n\\n2. Environmental concerns:\\n' + a2 + '\\n\\nActivity Log: I successfully practiced digital signatures and mined 3 blocks.\\n';\n      var b = new Blob([txt], { type: 'text\/plain' });\n      var u = URL.createObjectURL(b);\n      var a = document.createElement('a');\n      a.href = u;\n      a.download = 'Lesson6_Blockchain_Report.txt';\n      document.body.appendChild(a);\n      a.click();\n      document.body.removeChild(a);\n      URL.revokeObjectURL(u);\n      alert('Report downloaded! Paste this into your Word Document.');\n    });\n  }\n\n  setTimeout(updateChain, 200);\n});\n<\/script>\n","protected":false},"excerpt":{"rendered":"<p>Welcome to Year 5 Computing \u2014 Lesson 6! \ud83d\udd17\ud83d\udcbb Today we are exploring the technology of the future: Blockchain! We will learn how Public and&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/ndovu.org.uk\/cs\/yr5-term-1-1-6-blockchain\/\">Continue Reading<span class=\"screen-reader-text\">Yr5 Term 1.1.6 Blockchain<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-468","post","type-post","status-publish","format-standard","hentry","category-year5","entry"],"_links":{"self":[{"href":"https:\/\/ndovu.org.uk\/cs\/wp-json\/wp\/v2\/posts\/468","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ndovu.org.uk\/cs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ndovu.org.uk\/cs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ndovu.org.uk\/cs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ndovu.org.uk\/cs\/wp-json\/wp\/v2\/comments?post=468"}],"version-history":[{"count":10,"href":"https:\/\/ndovu.org.uk\/cs\/wp-json\/wp\/v2\/posts\/468\/revisions"}],"predecessor-version":[{"id":479,"href":"https:\/\/ndovu.org.uk\/cs\/wp-json\/wp\/v2\/posts\/468\/revisions\/479"}],"wp:attachment":[{"href":"https:\/\/ndovu.org.uk\/cs\/wp-json\/wp\/v2\/media?parent=468"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ndovu.org.uk\/cs\/wp-json\/wp\/v2\/categories?post=468"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ndovu.org.uk\/cs\/wp-json\/wp\/v2\/tags?post=468"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}