Keys, signatures, blocks, and Guardian Node decisions, computed live in your browser.
AIGuard pairs a hybrid proof-of-work chain with a Guardian Node that checks data payloads, flags anomalous blocks, tunes difficulty, and writes every decision to an auditable log. This page runs a faithful JavaScript port of the prototype kernel. Every key, hash, signature, nonce, and verdict below is computed on your device when you click.
Your identity on the chain is a secp256k1 keypair. The address is the first 40 hex characters of SHA-256 over the public key, exactly as in the prototype's crypto_utils.py.
The private key is 32 random bytes from your browser's secure random generator. The public key is that number multiplied by the secp256k1 generator point, and the address is a short fingerprint of it. Generating a key also starts a fresh local chain with a genesis block, and makes your address the demo treasury: 1,000,000 test tokens, of which 10% (100,000) is locked as Proof-of-Balance stake, just like the prototype's seeding rule.
The private key is hidden by default because real keys should never be shown. This one is a throwaway demo key.
Build a transaction with a data payload, such as a sensor reading, then sign it with your private key.
The kernel signs one string: sender, recipient, amount, nonce, payload, type, and fee joined together. It hashes that string with SHA-256 and signs the hash with ECDSA. Anyone holding your public key can check the signature, and nobody without your private key can forge one.
The Guardian also screens the payload. It scores it against positional and sensor patterns (latitude, longitude, device, temperature, pressure) and rejects anything over the 10 KB educational limit.
Pick an attack. The kernel re-runs its full validity check, Transaction.is_valid(), on the altered copy. Your original stays untouched.
| Field | Original | Tampered |
|---|
Changing any signed field changes the SHA-256 digest completely, so the old signature no longer matches. Flipping a single bit of the signature breaks it too. Swapping in someone else's public key fails earlier, at the address binding check: the kernel requires address(public key) to equal the sender, so a signature cannot be reused under a different identity.
Send transactions to the mempool, then mine a block. The kernel runs its admission checks, the Guardian reviews the block proposal, and proof of work seals it.
| # | Attempt | Verdict | Reason from the kernel |
|---|---|---|---|
| No submissions yet. | |||
This injects three 10,001 byte payloads straight into the proposal (bypassing the mempool, as the prototype's own test does) so the Guardian's block review has something to catch.
The mempool rejects a transaction if its signature or address binding fails, if the sender cannot cover amount plus fee, if the nonce is wrong (so a replayed transaction is refused), or if the Guardian rejects its payload. Each verdict above names the exact check that decided it.
Mining searches for a nonce that makes the block's SHA-256 hash start with as many zeros as the difficulty. Your browser really does that search, so the nonce and hash rate are real. The block reward is 20 tokens; in hybrid mode 40% goes to a Proof-of-Balance validator when another staker exists, otherwise the miner keeps it all. Each block also links to the previous block's hash, so rewriting an old transaction breaks every link after it.
The Guardian never holds keys and never moves funds. It adjusts difficulty within fixed bounds, flags anomalies, and records why. Humans keep final control.
Mine blocks quickly and the Guardian raises difficulty. Leave long gaps and it lowers it. It waits 3 blocks between changes, and an early slow gap can pull the average up for a while.
| Time | Source | Decision | Approved | Rationale | Details |
|---|---|---|---|---|---|
| No decisions yet. Steps 4 and 5 will create some. | |||||
[]
Every Guardian action is a logged decision with a type, a plain-language rationale, the numbers it used, and whether it approved. difficulty_adjust entries come from the live chain when average block time leaves the band around the 3 second target. anomaly_flag entries come from block reviews that found too many invalid payloads. What-if entries come from a separate scratch Guardian, so they never change your chain.
crypto_utils.py, guardian.py, and the chain logic in blockchain_core.py, using the open-source noble secp256k1 and SHA-256 libraries.