Skip to content
03Distributed Ledger StudioPSUT · Blockchain for IoT
Distributed Ledger Studio

Course experiments

59 local laboratory pages, including cross-listed and prerequisite experiments.

Primary course experiments · 31

BC-M01 · Primary · Blockchain for IoT

IoT and blockchain foundations

Investigate how a signed or anchored emissions-monitoring record can be checked by an independent auditor, and why sensor truth remains outside the ledger.

Open experiment →
BC-M02 · Primary · Blockchain for IoT

Hashing, authentication and avalanche

Distinguish a digest from confidentiality and origin authentication. Observe SHA-256 and SHA-512 concepts, digest comparison and avalanche effects using actual SHA-256 computations.

Open experiment →
BC-M03 · Primary · Blockchain for IoT

Decentralization, replication and CAP

Compare a consistency-first replicated store against an availability-first store during a network partition. Explore disintermediation, replication and the CAP trade-off.

Open experiment →
BC-M04 · Primary · Blockchain for IoT

Blockchain domain and membership

Follow proposal, membership validation, hash linkage and replicated commit in public, private and consortium ledger policies.

Open experiment →
BC-M05 · Primary · Blockchain for IoT

Coins, fungible tokens and device NFTs

Track a fungible balance and one unique IoT device certificate; distinguish native gas assets, token ownership and wallet control.

Open experiment →
BC-M06 · Primary · Blockchain for IoT

Blockchain elements: Merkle trees and light clients

Build the eight-transaction binary hash tree shown in the module. Inspect ordered hash inputs, root and logarithmic inclusion proof with a trusted header root.

Open experiment →
BC-M07 · Primary · Blockchain for IoT

Mining, nonce search and double spending

Model a UTXO spend and bounded proof-of-work nonce search using actual SHA-256. Observe change, fee conservation and reuse rejection.

Open experiment →
BC-M08 · Primary · Blockchain for IoT

Consensus algorithms and Byzantine disagreement

Compare observer decisions with conflicting validator messages and inspect a 3-of-4 quorum. Explore a simplified count versus stake-weighted voting rule.

Open experiment →
BC-M09 · Primary · Blockchain for IoT

Smart contracts, lifecycle and gas

Distinguish reads, transactions, gas budget and lifecycle. Calculate fees in Wei/Gwei/ETH with a user-declared gas price.

Open experiment →
BC-M10 · Primary · Blockchain for IoT

Solidity, Remix and access control

Trace owner checks, mapping writes and emitted events. Compile and deploy a real small Solidity registry using Remix VM.

Open experiment →
BC-M11 · Primary · Blockchain for IoT

Blockchain for IoT: food cold-chain traceability

Model sensor identification, gateway transport, off-chain records and ledger commitments in a farm-to-consumer cold chain.

Open experiment →
BC-M12 · Primary · Blockchain for IoT

Ethereum whitepaper: account state transitions

Explore nonce, balance, gas and deterministic transition using a simplified account ledger. Separate the 2014 whitepaper from post-Merge Ethereum.

Open experiment →
BC-M13 · Primary · Blockchain for IoT

Hyperledger: permissioned transactions and world state

Follow identity, endorsement, ordering and validation using the whitepaper enterprise requirements and an explicitly modern Fabric-style execute-order-validate teaching abstraction.

Open experiment →
BC-M14 · Primary · Blockchain for IoT

IoT–blockchain integration research: architecture trade-offs

Compare direct on-chain samples, per-sample gateway digests and gateway batch commitments using identical workloads.

Open experiment →
BC-M15 · Primary · Blockchain for IoT

Historical IOTA 2.0: Mana and access incentives

Investigate the 2023 IOTA 2.0 proposal: exponential Mana decay, token-derived generation and congestion-dependent access burn.

Open experiment →
BC-M16 · Primary · Blockchain for IoT

IoT–blockchain survey: security, privacy and scalability

Evaluate access, integrity, freshness and storage trade-offs across the survey’s security, privacy and trust requirements.

Open experiment →
B01 · Primary · Blockchain foundations

B01 · Hash functions and linked blocks

Construct a SHA-256-linked ledger; detect modified data and explain why hash links alone do not guarantee immutability.

Open experiment →
B02 · Primary · Blockchain foundations

B02 · Merkle trees and inclusion proofs

Construct a four-leaf Merkle tree and verify inclusion against a trusted root.

Open experiment →
B03 · Primary · Blockchain foundations

B03 · Distributed agreement and finality

Compare agreement, split votes and unavailable voters under a fixed four-voter teaching rule.

Open experiment →
B04 · Primary · Blockchain foundations

B04 · Solidity fundamentals with Remix

Compile, deploy and call a simple Solidity state variable and distinguish reads from transactions.

Open experiment →
B05 · Primary · Blockchain foundations

B05 · IoT device registry and access control

Use msg.sender, mappings, custom errors and events to enforce administrative authorization.

Open experiment →
B06 · Primary · Blockchain foundations

B06 · Telemetry commitments and replay resistance

Anchor off-chain telemetry using a bytes32 digest, per-device monotonic sequence and explicit authorization.

Open experiment →
B07 · Primary · Blockchain foundations

B07 · IoT dApp workflow and event evidence

Connect an off-chain sensor payload to a contract invocation, receipt, event and subsequent verification.

Open experiment →
B08 · Primary · Blockchain foundations

B08 · Gas, scalability and experimental design

Compare raw storage and digest storage using actual transaction gas, and distinguish bytes from gas.

Open experiment →
B09 · Primary · Blockchain foundations

B09 · Blockchain privacy and secure IoT design

Demonstrate linkage risks of low-entropy hashes and design a privacy-preserving IoT commitment architecture.

Open experiment →
B10 · Primary · Advanced blockchain

Advanced Solidity: roles and modifiers

Implement owner-only delegation, operator permissions and revocation with explicit custom errors.

Open experiment →
B11 · Primary · Advanced blockchain

Merkle batch commitments

Construct a four-record Merkle tree and verify ordered membership against an independently trusted root.

Open experiment →
B12 · Primary · Advanced blockchain

IoT gateway serialization & integrity

Generate stable UTF-8 telemetry, compute SHA-256 commitments and detect altered measurement bytes.

Open experiment →
B13 · Primary · Advanced blockchain

Transaction receipts and event reconciliation

Model duplicate receipt processing, reverted transactions and missed events; reconcile with independently queried contract state.

Open experiment →
B14 · Primary · Advanced blockchain

Batching and controlled gas experiments

Compare payload byte budgets and design paired EVM gas measurements without substituting byte counts for gas.

Open experiment →
B15 · Primary · Advanced blockchain

Local IoT dApp and contract acceptance

Trace a fictional sensor record into a local EVM transaction, verify receipt and event fields, and test access and replay invariants.

Open experiment →

Cross-listed experiments · 11

CR59 · Cross-listed · Cryptography Engineering

CR59 · Hashing versus encoding and digest families

Encoding changes representation and is reversible without a secret. Hashing maps arbitrary bytes to a fixed-size digest; it is not encryption or sender authentication. MD5 and SHA-1 are historical, collision-broken algorithms, not suitable for new security designs. SHA-256, SHA-512 and SHA3-256 have different digest sizes and constructions. UTF-8 byte length may differ from character count. For abc, hexadecimal is 616263 and Base64 is YWJj. SHA-256 is ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad.

Open experiment →
CR61 · Cross-listed · Cryptography Engineering

CR61 · Truncated hash collision and birthday bound

A collision is two distinct messages with the same digest. Preimage resistance and second-preimage resistance are different properties. For an ideal b-bit digest the approximate 50% collision threshold is sqrt(2 ln 2) × 2^(b/2). This exercise truncates SHA-256 intentionally to 4–16 bits and searches only synthetic classroom strings. It is not a collision attack on full SHA-256. An 8-bit prefix has 256 possibilities; the approximate 50% threshold is 19 samples. The first collision count depends on the selected sequence.

Open experiment →
CR62 · Cross-listed · Cryptography Engineering

CR62 · Hash avalanche: sensor message

A controlled comparison changes one input bit while keeping message length and the hash algorithm fixed. Hamming distance counts differing digest bits; divide by digest width and multiply by 100. The bit index starts at the least significant bit of UTF-8 byte zero. Strong avalanche alone does not prove collision resistance. For a 256-bit digest, a Hamming distance of 128 corresponds to 50%. SHA-512 uses a 512-bit denominator.

Open experiment →
CR65 · Cross-listed · Cryptography Engineering

CR65 · File and firmware integrity

A trusted reference digest can detect a modified local byte sequence. The verifier recomputes SHA-256 over received bytes and compares against that reference. A hash delivered by the same untrusted source is not independent authentication; signed firmware or a trusted authenticated manifest is required. Flipping bit zero of F (0x46) produces G (0x47), changing the firmware digest without changing length.

Open experiment →
CR67 · Cross-listed · Cryptography Engineering

CR67 · HMAC inner and outer construction

SHA-256 uses a 64-byte block. Normalize K to K′ by hashing keys longer than 64 bytes, then zero-padding. Compute inner=H((K′ XOR ipad)||m), tag=H((K′ XOR opad)||inner), where ipad=36 repeated and opad=5c repeated. HMAC authenticates under a shared key; it neither encrypts nor inherently prevents replay. With 20 bytes of 0b and Hi There, RFC 4231 HMAC-SHA256 is b0344c61d8db38535ca8afceaf0bf12b881dc200c9833da726e9376c2e32cff7.

Open experiment →
CR70 · Cross-listed · Cryptography Engineering

CR70 · Digital signatures: ECDSA file verification

A digital signature binds a digest to a private signing key; a trusted public key verifies it. This lab uses P-256 ECDSA with SHA-256 from a vetted library. Signatures contain r and s; Python uses ASN.1 DER while Web Crypto returns raw r||s. Validity depends on trusted keys, not simply the presence of a signature. An original synthetic firmware message verifies with its own public key. A modified message and a different public key must be rejected. Signature bytes can vary between runs.

Open experiment →
CR71 · Cross-listed · Cryptography Engineering

CR71 · ElGamal signature mathematics

Use a prime p, primitive root g and private x; y=g^x mod p. Choose k coprime to p−1. r=g^k mod p and s=k⁻¹(h−xr) mod (p−1). Verify g^h ≡ y^r r^s (mod p). The small example is for arithmetic only; never use these parameters or chosen signing nonces in real systems. For p=19, g=10, x=5, k=5, h=7, compute k inverse modulo 18 and both sides of the verification equation.

Open experiment →
CR72 · Cross-listed · Cryptography Engineering

CR72 · DSA historical signature verification

For this small fixed DSA fixture p=23, q=11, g=4, x=3, k=6, h=9, sign using r=(g^k mod p) mod q and s=k⁻¹(h+xr) mod q. Verify with w=s⁻¹ mod q, u1=hw mod q, u2=rw mod q, v=((g^u1 y^u2 mod p) mod q). A tiny digest domain can admit accidental verification collisions. DSA is historical and not recommended for new signature generation. The fixture is generated from h=9; verification succeeds for that representative. Other representatives must be evaluated by the actual equation, not presumed to fail.

Open experiment →
CR74 · Cross-listed · Cryptography Engineering

CR74 · X.509 certificate fields and local CA

X.509 binds a public key to subject identity via issuer signature; SAN identifies DNS names, validity limits time, key usage constrains purpose. Generate local certificates and verify the issuer signature. Signature verification alone is not full path validation.

Open experiment →
CR75 · Cross-listed · Cryptography Engineering

CR75 · Certificate trust chain and revocation decisions

A valid signature is insufficient: trust anchor, intermediates, validity, hostname and applicable revocation policy all matter. Revocation checking depends on client policy and infrastructure.

Open experiment →
CR85 · Cross-listed · Cryptography Engineering

CR85 · Replay cache, sequence and timestamp checks

Freshness requires receiver state. A nonce cache rejects duplicates; a timestamp window rejects stale messages and assumes clock synchronization. The model assumes tag verification precedes freshness checks.

Open experiment →

Additional prerequisite experiments · 17

CR35 · Prerequisite · Cryptography Engineering

CR35 · Modular clock and residue classes

For positive modulus n, a=qn+r with 0≤r<n. Congruence means equal residues, not equal integers. On the GF(17) clock, 35→1, −7→10 and −11→6. Addition and multiplication reduce after the operation.

Open experiment →
CR36 · Prerequisite · Cryptography Engineering

CR36 · Prime fields and composite rings

A field has additive and multiplicative identities and every nonzero element has a multiplicative inverse. Modulo a composite integer, zero divisors can exist; GF(pⁿ) is not ordinary integer arithmetic modulo pⁿ.

Open experiment →
CR37 · Prerequisite · Cryptography Engineering

CR37 · Modular inverses and division

An inverse x satisfies ax≡1 mod n. Division a/b means a·b⁻¹, defined only when gcd(b,n)=1. The lecture includes 421 mod 1009 and 10 mod 40 (no inverse).

Open experiment →
CR38 · Prerequisite · Cryptography Engineering

CR38 · Extended Euclidean algorithm: three phases

Forward division finds gcd; back-substitution rewrites it as ax+ny. Reduce x modulo n to obtain the inverse if gcd=1. Worked example: 20⁻¹ mod 23 = 15.

Open experiment →
CR41 · Prerequisite · Cryptography Engineering

CR41 · Repeated squaring and operation counts

Binary exponent bits select powers a^(2^i). Repeated squaring reduces every multiplication; the number of steps grows with the exponent bit length.

Open experiment →
CR44 · Prerequisite · Cryptography Engineering

CR44 · Primitive roots and discrete logarithms

The order of g is the first positive exponent giving 1. A primitive root modulo prime p has order p−1. Inversion of exponentiation is the discrete-logarithm problem.

Open experiment →
CR49 · Prerequisite · Cryptography Engineering

CR49 · Diffie–Hellman key agreement

For public prime q and generator g, Alice sends A=gˣᵃ mod q and Bob B=gˣᵇ mod q. Both compute g^(xa·xb) mod q independently. Private exponents stay local; DH alone does not authenticate peers or directly encrypt messages. q=23,g=5,xa=6,xb=15 gives A=8, B=19, B⁶ mod 23=2 and A¹⁵ mod 23=2.

Open experiment →
CR51 · Prerequisite · Cryptography Engineering

CR51 · ElGamal encryption

Recipient publishes Y=gˣ mod q. Sender selects ephemeral k and computes C₁=gᵏ and mask K=Yᵏ mod q; C₂=mK mod q. Recipient computes K=C₁ˣ then m=C₂K⁻¹ mod q. Textbook ElGamal does not authenticate. q=19,g=10,xa=5,m=17,k=6: Y=3, K=7, C₁=11, C₂=5; inverse of 7 mod 19 is 11; recovered=17.

Open experiment →
CR52 · Prerequisite · Cryptography Engineering

CR52 · Elliptic curves over prime fields

For prime p>3 use y²≡x³+ax+b mod p, with 4a³+27b² nonzero modulo p. Enumerate all matching y for each x. The group includes point at infinity O, which has no finite coordinate. Plot discrete points. p=17,a=b=2: (5,1) satisfies 1≡137 mod 17. There are 18 finite points plus infinity, order 19.

Open experiment →
CR53 · Prerequisite · Cryptography Engineering

CR53 · ECC point addition: point addition

For distinct points with unequal x, λ=(y₂−y₁)(x₂−x₁)⁻¹ mod p, x₃=λ²−x₁−x₂ mod p, y₃=λ(x₁−x₃)−y₁ mod p. P plus its inverse gives infinity; equal noninverse points use doubling. GF(17), a=b=2, P=(5,1), Q=(6,3): numerator=2, denominator=1, inverse=1, λ=2; x₃=10,y₃=6.

Open experiment →
CR54 · Prerequisite · Cryptography Engineering

CR54 · ECC doubling and GF(23) worked example

For doubling λ=(3x₁²+a)(2y₁)⁻¹ mod p. Use the coordinate formulas with P=Q. If y=0, doubling gives infinity. Add P to 2P to obtain 3P. GF(17), P=(5,1): numerator=77 mod 17=9, denominator=2, inverse=9, λ=13, 2P=(6,3), 3P=(10,6). GF(23), a=b=1,P=(3,10): 2P=(7,12),3P=(19,5).

Open experiment →
CR55 · Prerequisite · Cryptography Engineering

CR55 · ECC scalar multiplication and point order

Double-and-add reads scalar bits from least significant. Start at infinity, conditionally add the current point, then double the addend. Point order is the smallest positive t with tP=O, not necessarily group order. P=(5,1) over GF(17), a=b=2. 3=11₂: add P and 2P to obtain (10,6). P has order 19.

Open experiment →
CR73 · Prerequisite · Cryptography Engineering

CR73 · Key lifecycle and session-key distribution

Long-term keys authenticate identities; session keys protect one session. A KDC is a trusted intermediary. Rotation, expiration and revocation constrain use. This explicit model checks key validity and freshness before release.

Open experiment →
CR84 · Prerequisite · Cryptography Engineering

CR84 · Challenge-response and mutual authentication

Challenge-response uses a fresh nonce and proof of key possession. Mutual authentication requires two direction-bound proofs to prevent reflection; this synthetic HMAC model verifies separate labels.

Open experiment →
K01 · Prerequisite · Kali & IoT security

K01 · Environment & scope

Verify Kali dependencies and authorized training scope.

Open experiment →
K06 · Prerequisite · Kali & IoT security

K06 · Hashing & HMAC telemetry integrity

Verify SHA-256 and HMAC behavior for original and modified telemetry.

Open experiment →
K09 · Prerequisite · Kali & IoT security

K09 · Privacy-preserving telemetry

Minimize and pseudonymize fictional telemetry; explain residual linkage risk.

Open experiment →