learn-blockchain-with-phoebe / Practitioner session 7 of 10
Learn Blockchain with Phoebe · Practitioner session 7 of 10

Signatures and identity

Block 2 of the Harbourgate register says consignment 41 was inspected and the seal was intact. Six sessions of machinery establish that those words have not changed since they were written. Not one of them establishes who typed them. A buyer holding a perfect copy of the register can tell you the entry is untouched and cannot tell you whether it came from the inspector, from the night supervisor, or from a script somebody left running. Tonight is that gap, the machinery sold to close it, and the honest accounting of what closing it actually buys.

🟠 Working depth Engineers and data people Anyone designing a write path 45 min
0-4 · Welcome 4-16 · Two guarantees 16-28 · What a signature says 28-45 · Build-along and Q&A
Part 0

The question the register has never once answered

Leader session 5 put it in one line: a valid block is a well formed block, and permission is settled before the chain sees anything. That line is easy to nod at and hard to act on, because the machinery that settles it is not in the engine, not in the register, and not in anything measured so far. Tonight makes the gap concrete, then walks the usual answer to it slowly enough that the new question it creates is visible before anybody buys it.

Live = presented in the 45 minutes Self-study = the full depth, after class 🔍 Every diagram zooms

★ What you walk out with tonight. Two guarantees held apart in your head, with different names and different machinery: integrity is has this changed, authenticity is who put it there. One sentence for what a valid signature establishes, narrow enough to survive a hostile reading. And the four questions that arrive the moment a signature checks out, none of which is a question about hashing.

What the bench cannot do, said first. The engine on these pages has a real SHA-256, a real chain, real mining and real Merkle proofs. It has no signature functions at all. Nothing on this page signs anything or checks a signature, and no box below pretends otherwise. The parts that can be run are run, the parts that cannot are walked on paper and labelled as such.

Self-studyThe words that will keep coming back4 min▶
  • Integrity. Has this record changed since it was written. Answered by recomputing hashes, which is every session so far.
  • Authenticity. Who put this record there. A different question, answered by different machinery, bought separately.
  • Private key. The half one party holds and never sends. Used to produce a signature. Never shown, and never typed into a page like this one.
  • Public key. The half everybody holds. Used to check a signature. Holding it lets you check and does not let you sign.
  • Signature. A value produced from an entry and a private key, that fits that entry and that public key and no others.
  • Shared secret. One value both sides hold. Good for a check between two parties who already trust each other, and not a signature. Part 3 shows why, live.
  • Key management. Issuing, holding, rotating and withdrawing key material, and binding a public key to a person. A discipline of its own, covered in the security and access control courses rather than here.
  • Oracle. Whatever puts a statement about the world into the register. Leader session 5's term, and it comes back tonight wearing different clothes.
Part 1 · covers the two guarantees

Has this changed, and who put it there

11 min live

These are routinely spoken as one property called security, and they come apart the moment anything goes wrong. A register can pass every check in session 3 and still be a flawless record of entries written by somebody who had no business writing them. Nothing detects that, because nothing is looking for it.

Two questions that get spoken as one Everything measured so far answers the left one. Nothing measured so far touches the right one. INTEGRITY Has this record changed since it was written? Machinery: a hash over the whole block, and a link to the block before it. ANSWERED BY THE REGISTER ITSELF, BY ANYONE HOLDING A COPY. AUTHENTICITY Who put this record there? Machinery: something only one holder could have produced, that anyone can check. NOT ANSWERED BY THE REGISTER. NO HASH RECORDS WHO TYPED THE ENTRY. A register can verify perfectly and be entirely anonymous. Two guarantees, two machineries, two budgets. The second one is never a consequence of the first.
🔍 Click to zoom - the left panel is the whole of sessions 1 to 6. The right panel has not been touched once.
LiveWhy this gap is where real systems fail4 min▶

Attacks on the left hand column are difficult, visible and rare. An attacker has to edit a record and then rebuild every hash above it, and session 5 counted what that costs. Attacks on the right hand column are none of those things. Somebody writes an entry they were not supposed to write, using credentials that work, and every check in the building returns clean because the entry is genuinely unaltered since it was created.

That is the shape of most incidents worth the name. Not arithmetic defeated, but a write path used by the wrong hands. The register records the outcome faithfully and reports no problems, which is exactly what it was built to do.

LiveWhat a clean verify actually rules out3 min▶

Run CHAIN.verify() on the six block register and it returns ok. Say precisely what that rules out: any edit to any of the five hashed fields of any block, after the block was hashed. That is a real and narrow claim, and it is the whole of it.

It does not rule out an entry written by the wrong party, an entry written at a convenient time, an entry written by an automated job nobody remembers configuring, or an entry that everybody agrees is untrue. None of those leaves a mark a recomputation can find.

Part 2 · covers the signature

What a signature says, in plain terms

10 min live

A signature is a value produced from two things: the entry, and something one party holds and nobody else does. It is checked using a different value, one that is published and holds no power to produce anything. The asymmetry between those two values is the entire product. Everything else about it is detail belonging to a course where key material is the subject.

One value produces. A different value checks. PRODUCING SIDE · one holder CHECKING SIDE · anyone at all The writer's private key Held by one party. Never sent, never shown. The writer's public key Published. Checking needs nothing else. The entry, and a signature over it The signature depends on the entry and on the private key. Change either and it no longer fits. Does this signature fit this entry? Yes or no. No partial credit, no near miss, and no need to hold the private key to ask. the entry and its signature cross the private key never does What a valid signature establishes, exactly: the holder of that private key produced this entry, and the entry has not been altered since. Anybody can establish that. Nobody needs the private key to do it, and that is the whole of the product.
🔍 Click to zoom - the dashed line is the only thing that matters. Everything that crosses it is public, and the thing that does not cross it is what the claim rests on.
LiveRead the claim once more, slowly4 min▶

The holder of that private key produced this entry. Not the inspector. Not a person. The holder. Every word that a reasonable listener would supply for free is missing on purpose, and each missing word is somebody's job to supply by other means.

It is worth saying the sentence out loud with the register in front of you, because the hostile version of the same sentence is what you will hear in a dispute, and it is the same sentence.

LiveWhy this pairs so naturally with a chain3 min▶

The two guarantees compose well. Signing binds an entry to a key holder at the moment of writing. Hashing binds every entry to every entry after it, so the signed entry cannot be quietly swapped for a different one later. Neither does the other's work and the pair covers more than either alone.

What the pair still does not cover is everything in part 4, and the reason that part exists is that the composition is so tidy that people stop reading at this point.

Part 3 · covers the two sets

Who can produce one, and who can check one

10 min live

Here is the part the engine can actually run. A shared value held by both sides gives a check that works and is not a signature, and the difference is visible without any signature machinery at all. Count the people who can produce a valid tag, count the people who can check one, and compare the two counts.

Two sets. Compare their size. THE ARRANGEMENT WHO CAN PRODUCE A VALID TAG WHO CAN CHECK ONE A shared placeholder Both sides hold the same value and use it the same way Everyone holding the placeholder Everyone holding the placeholder The same set. A checker who can check can also forge. A signature One private key produces, one published public key checks Exactly one holder Everybody, forever Different sets. That difference is the entire point. Row one runs live below. Row two does not run anywhere on this page. The engine here has a hash and no signature functions, so row two is walked on paper and labelled as paper.
🔍 Click to zoom - the only difference between the rows is whether the checking value and the producing value are the same value.
Live CHAIN.sha256 only, running in this page. Row one of the table above, built for real.

tag = sha256( shared value + "|" + entry )

...

...

...

...
LivePress the first button and read what it means4 min▶

The checker holding the same value recomputes the tag and it matches. That looks like a successful check and it is one, in a narrow sense: the entry has not been altered since the tag was made, by anybody who does not hold the shared value. What it does not establish is who made the tag, because the checker just made an identical one themselves, from nothing but the entry and a value they already had.

So the check answers integrity between two parties and answers authenticity not at all. Give the shared value to a third party so they can check, and you have given them the ability to write. There is no arrangement of that value that avoids it.

LivePress the second button and read that too3 min▶

A checker holding a different value gets a completely unrelated digest, which is the avalanche property from session 1 doing its ordinary work. They cannot forge a tag, and they also cannot check one. The ability to check and the ability to forge arrived and departed together.

That is the sentence to keep. A signature is the arrangement in which those two abilities are separated, and separating them is the thing being bought.

Self-studyNever a real value in a box like that3 min▶

The field above holds the word placeholder because a teaching page is exactly the sort of place real key material ends up and never leaves. Screenshots get circulated, pages get forked, a value typed once for a demonstration gets copied into a script, and eighteen months later it is in production and nobody remembers where it came from.

The rule is simpler than any policy: a value that matters is never typed into anything that renders. Where such values do live, how they get there and how they are taken away is the subject of learn-cyber-security-with-phoebe and learn-data-access-control-with-phoebe.

Part 4 · covers what it shifts

The signature checks out, and now what

9 min live

A working signature does not remove the trust problem. It relocates it, from the register to a key and from a key to whoever holds it. That is a real improvement, because the new location is a place with a named owner and an operating procedure, and it is an improvement only if somebody actually owns it.

One question answered, three opened The signature checks out Arithmetic, and it is not in dispute. Whose key is it? Who says this public key belongs to that inspector, and who maintains it? Who holds it now? One person, a team, a running job? Has it ever been copied anywhere? Still authorised? On the day somebody leaves, how long does their key keep working? NOT ONE OF THOSE IS A QUESTION ABOUT HASHING. They are key management: issuing, binding, holding, rotating and withdrawing. That discipline is the subject of learn-cyber-security-with-phoebe and learn-data-access-control-with-phoebe, and no register design substitutes for it. A signature moves the problem into their hands. It does not remove it, and it does not answer it here.
🔍 Click to zoom - the first box is arithmetic and nobody argues with it. The other three are operations, and that is where the argument always is.

Put that against the Harbourgate entry everybody has been reading since session 1, and the shape of leader session 5's oracle problem shows up again in a place people do not expect it.

A signed Harbourgate block 2, read three ways Consignment 41 inspected, seal intact PROVED The holder of the inspector's private key produced this entry, and the entry has not changed since. ASSUMED That key was in the inspector's hands and nobody else's at that moment. An operational claim, not an arithmetic one. NOT PROVED That anybody opened the container and looked at the seal. The oracle problem from leader session 5, in a new place. Trust moved from a register to a person. None was created.
🔍 Click to zoom - the middle row is the one that gets read as if it were the top row, and the bottom row is the one the dispute will actually be about.
LiveWhat signing does buy at Harbourgate4 min▶

Do not read the diagram as a reason not to sign. Before signing, an entry in the register is an anonymous sentence, and the argument about who wrote it is an argument about access logs held by the party being accused. After signing, the entry is pinned to a specific key holder at the time of writing, and that pin survives in every copy of the register held by anybody.

What that changes in a dispute is real. It moves the argument from what happened on our system to a named party explaining their own key. That is a much better argument to be having, and it is worth paying for.

LiveThe failure mode to design against3 min▶

The middle row hardens over time until people forget it is an assumption. Eighteen months in, a signed entry is spoken about as though the inspector personally attested to it, and the procedure for what happens when a key holder says that was not me has never been written, because nobody believed the situation could arise.

Write that procedure before go live. Who investigates, what evidence exists besides the signature, what the register says about entries already accepted under that key, and who decides. It is a short document and it is never written afterwards in time.

Self-studyWhere the disagreement really is4 min▶

One camp holds that a key must be bound to a named, credentialled person, because accountability is the point. An entry signed by a key nobody can attach to a human being is an entry nobody can be asked about, and a register full of those is an elaborate way of recording that something was written by something. On this view the binding is not an inconvenience around the edge of the design, it is the design.

The other camp holds that the binding quietly reintroduces exactly what the arrangement was built to remove. Somebody has to run the list that says this key is that person, somebody has to be trusted to keep it right, and that somebody is an administrator with a new title. Better, on this view, to treat a key as a capability rather than an identity, hold the accountability in the contract and the operating procedure, and keep the register out of the business of knowing who anybody is.

Both are held by serious practitioners and they build different systems. Notice that they do not disagree about any arithmetic; they disagree about where an organisation would rather carry its trust, and that is a question about your own operation.

Part 5 · build-along

Run what runs, walk what does not

14 min hands on

Console open on this page. The first line is the important one, because it tells you what the engine can and cannot do before you build any expectation on top of it.

ConsoleObject.keys(CHAIN) CHAIN.selfTest().ok var ENTRY = "Consignment 41 inspected, seal intact"; var SHARED = "placeholder"; var tag = CHAIN.sha256(SHARED + "|" + ENTRY); tag === CHAIN.sha256(SHARED + "|" + ENTRY) tag === CHAIN.sha256("another placeholder" + "|" + ENTRY) tag === CHAIN.sha256(SHARED + "|" + ENTRY + " and the door was locked")

List what the engine actually has

Run Object.keys(CHAIN) and read the list. There is a hash, a chain, mining, tampering, reforging and Merkle work. There is nothing that signs and nothing that checks a signature. Say out loud why a page that invented one would be worse than a page that admits the gap.

Make a tag and check it with the same value

Produce the tag, then recompute it. It matches. Now write down the full list of people who could have produced that tag, and compare it with the list of people who could have checked it. The two lists are the same list.

Break it twice

Recompute with a different shared value, then with the original value and one extra clause on the entry. Both return false, for two different reasons. Name each reason in one sentence.

Walk the signature check on paper

No code for this one. Take the same entry and say, step by step, what changes when the checking value is a published value that cannot produce anything. Stop at the point where you would need a function the engine does not have, and note where you stopped.

Write the two sentences

One sentence a signed Harbourgate entry supports, and one sentence it does not support that somebody will say anyway. Keep both. The second one is the more useful of the pair.

Find the four questions in your own write path

For a system you run, answer the three operational questions from part 4 on paper: who binds the public key to the person, who holds the private key today, and how fast permission is withdrawn. Any you cannot answer is the finding.

The habit to keep. When somebody says a record is signed, ask what the signature establishes and then wait through the pause. The useful answer names a key holder. The answer to worry about names a person, because the gap between those two is exactly where a dispute will end up.

Check yourself

Three questions

A buyer recomputes every hash and every link in the Harbourgate register and finds no problems. What does that establish about who wrote block 2?

Integrity and authenticity are separate guarantees. A block hash is taken over the whole assembled block, and the identity of the writer is not one of the things in it. An entry written by the wrong hands verifies exactly as cleanly as one written by the right hands.

Two parties hold the same shared value and use it to tag entries. A tag checks out. Who could have produced it?

Checking means recomputing, and recomputing means producing. The ability to check and the ability to forge arrive together and leave together, which is exactly what the live box demonstrates. A signature is the arrangement that separates them, by making the checking value different from the producing value.

A signed inspection entry verifies against the inspector's public key. What has been established?

The claim names a key holder, not a person and not an event. Whether the key was where it should have been is an operational assumption owned by key management, and whether anybody opened the container is the oracle problem from leader session 5, untouched by any signature.

Before session 8

Homework

Twenty minutes, on a write path that already exists near you.

Separate your two columns

For one record store you rely on, write two headings: what proves this has not changed, and what proves who put it there. Fill both. If the second column is empty or says access control, write down what a reader of that store can actually establish on their own.

Write the that-was-not-me procedure

Assume a key holder denies an entry signed with their key. Write the first three steps of what happens next, and who takes them. Bring it to session 8, which asks a related question about entries that were accepted and then were not.

Covered tonight

What this session covers

✓Integrity and authenticity as separate guaranteesHas this changed, and who put it there. Different machinery, bought separately.
✓What a signature establishes, in plain termsThe holder of a private key produced this, checkable by anyone holding the public key.
✓Why a shared value is not a signatureBuilt live with sha256: the set that can check equals the set that can forge.
✓What a signed Harbourgate entry does not proveProved, assumed and not proved, kept apart. The oracle problem in a new place.
◐Which history a signed entry ends up inNamed tonight. A signed entry can leave the accepted history without being invalid. Session 8.
◐Correcting a signed entry that was wrong when writtenNamed tonight. Appending is the only mechanism, from leader session 5.
○Key management: issuing, binding, holding, rotating, withdrawingNamed in a clause and handed on. learn-cyber-security-with-phoebe and learn-data-access-control-with-phoebe.
○Algorithms, key sizes and the arithmetic inside a signatureNot needed for any decision on this page, and covered where key material is the subject.
○Any cryptocurrency, price or marketA separate subject in the crypto course, and nothing here is investment advice.
Take this with you

Cheat sheet

The one sentence. The chain proves a record has not changed. It says nothing about who wrote it.
Two guarantees. Integrity is has this changed. Authenticity is who put it there. Separate machinery, separate budget.
A signature. The holder of a private key produced this entry, and it has not changed since. That is the claim, in full.
The asymmetry. One value produces, a different published value checks. Checking never needs the private key.
A shared value. Whoever can check can also forge. Useful, and not a signature.
What it shifts. Whose key, who holds it now, are they still authorised. All key management, all elsewhere.
Harbourgate. A signed inspection proves a key signed it. Not that anybody looked at the seal.
The rule for pages like this. A value that matters is never typed into anything that renders. Use the word placeholder.