WHAT THIS IS
shielded is a place to launch Flap Tax coins on BNB Chain whose tax does not go to a wallet. Each coin's tax goes to its own contract, called a shield, which has no owner and obeys only hash based signatures.
The site has three jobs. It builds the keys for a shield in the creator's browser. It lets the creator sign orders with those keys. And it reads every shield from the chain and shows what it holds, what it has done and how much strength its current key has left.
WHY A WALLET IS THE WEAK PART
Every wallet on BNB Chain is controlled by an elliptic curve key. The address is public, and once a wallet has sent a transaction its public key is public too. A quantum computer large enough to run Shor's algorithm turns a public key into its private key. No such machine exists today. The point of building for it now is that a coin's tax wallet is meant to last as long as the coin does.
Hash functions do not fall the same way. The best known quantum attack on a hash is Grover search, which only halves the exponent: a 256 bit hash keeps 128 bits of strength. Signatures can be built from nothing but hashes. They are larger and each key can only sign a limited number of times, which is why a shield counts its signatures so carefully.
THE KEY FILE
A shield's key is 32 random bytes made by the browser's own random source at the moment the creator presses the button. It is not derived from the wallet. If it were, breaking the wallet would break the shield with it.
The creator saves the key as a file before the shield is deployed. The site never uploads it and never stores it. To sign, the creator loads the file into the tab, the tab signs, and only the signature is sent. There is no recovery. A lost file means a shield that can never be signed for again.
THE PLATE TREE
From the key the browser derives 32 Winternitz one time keys. Each is 67 hash chains of 15 steps. The 32 public keys are hashed pair by pair into a tree, and the single hash at the top is the tree root. The root is written into the shield when it is deployed and never changes.
Each of the 32 keys does exactly one thing in its life: it signs the installation of the plate with the same number. Building the whole tree takes 34,367 hash calls.
PLATES
A plate is the key that signs orders. It is 21 hash trees, each with 4,096 secret leaves, 86,016 secrets in all. The 21 tree tops are hashed together into the plate key, one 32 byte value held by the shield. Building a plate takes 258,028 hash calls, a second or two in a browser.
To sign, the order is hashed into a digest. The digest is cut into 21 numbers of 12 bits. Each number picks one leaf in one tree. The signature is those 21 secrets, each with the 12 sibling hashes that prove it belongs to its tree: 8,736 bytes.
A plate signs 16 times. Then the shield refuses it and waits for the next plate.
STRENGTH
Every signature opens 21 more leaves. A forger does not need the secrets nobody has seen. A forger needs a message whose 21 leaves have all been opened by earlier signatures. The chance that a given message is one of those is the chance of landing on an opened leaf in every one of the 21 trees.
The site shows this number for every shield, live, and shows the number a signature will leave behind before the creator signs it.
| SIGNATURES | LEAVES OPENED | SHARE OF PLATE | BITS | AGAINST GROVER | SHIELDS HERE |
|---|---|---|---|---|---|
| 0 | 0 | 0.000% | 256.0 | 128.0 | |
| 1 | 21 | 0.024% | 252.0 | 126.0 | |
| 2 | 42 | 0.049% | 231.0 | 115.5 | |
| 3 | 63 | 0.073% | 218.7 | 109.4 | |
| 4 | 84 | 0.098% | 210.0 | 105.0 | |
| 5 | 105 | 0.122% | 203.3 | 101.6 | |
| 6 | 126 | 0.146% | 197.7 | 98.9 | |
| 7 | 147 | 0.171% | 193.1 | 96.5 | |
| 8 | 168 | 0.195% | 189.0 | 94.5 | |
| 9 | 189 | 0.220% | 185.5 | 92.7 | |
| 10 | 210 | 0.244% | 182.3 | 91.1 | |
| 11 | 231 | 0.269% | 179.4 | 89.7 | |
| 12 | 252 | 0.293% | 176.8 | 88.4 | |
| 13 | 273 | 0.317% | 174.3 | 87.2 | |
| 14 | 294 | 0.342% | 172.1 | 86.0 | |
| 15 | 315 | 0.366% | 170.0 | 85.0 | |
| 16 | 336 | 0.391% | 168.1 | 84.0 |
SLOTS
A shield has no clock. It does not act every hour or every day. It keeps one running total, the BNB it has ever received, and one fixed number, the step chosen at launch.
Each time the total passes another multiple of the step, one slot opens. A slot is the right to move exactly one step of BNB. Slots are fired in order, oldest first.
ORDERS
An order fills one slot. It is 26 bytes: a tag, the slot number, the action and a payout address. The creator signs it with the plate in service.
Before any order is carried out, the cut is taken from the step and sent to the outer shield.
| ACTION | WHAT IT DOES | RULE |
|---|---|---|
| burn | Buys the coin with the step and destroys what it bought. | Always allowed. |
| deepen | Adds the step to the coin's PancakeSwap pool and destroys the pool share. | Only after the coin has left the Flap curve. |
| release | Pays the step to the address written inside the signed order. | Never twice in a row. |
BINDING
A shield has to exist before its coin does, because the coin needs the shield's address as its tax recipient at launch. So a new shield does not know its coin. Its first signature is the one that tells it: a signature over the coin's address. A shield that has not been bound can receive BNB but cannot send any.
BACKLOG AND EXHAUSTION
If eight slots are open and unsigned, anyone can fire the oldest one with no signature. It is always a burn. This is what happens to the tax of a coin whose creator has gone or lost the key: it buys the coin and destroys it.
When all 32 plates have signed 16 times each, the shield is exhausted. It signs nothing more, and every slot it opens from then on can be fired by anyone as a burn.
STRIKES
A signature that fails the check is a strike. The shield counts it, records the sender and the block, and carries on. Strikes cost the sender gas and cost the shield nothing.
THE OUTER SHIELD
One shield belongs to the pad's own coin. It takes a fixed cut of every order signed on every other shield. The rate lives in the factory contract and is shown on the main page as it stands on chain.
The outer shield has no orders to sign. Each slot it opens can be fired by anyone, and it can only burn.
LAUNCHING A COIN
Build the key and save the file. Choose the step. Deploy the shield: that is the first transaction. Launch the coin with Flap's form, with the shield's address as the recipient wallet: that is the second. Sign the binding: that is the third. From then on the shield fills from the coin's trades and slots open by themselves.
BYTE LAYOUTS
Actions are numbered 1 for burn, 2 for deepen and 3 for release. Plates are numbered from 0 inside the contract and from 1 on this site.
| MESSAGE | BYTES | LAYOUT |
|---|---|---|
| order | 26 | tag 06, slot (4, big endian), action (1), payout address (20) |
| binding | 21 | tag 07, coin address (20) |
| digest input | 54 | tag 05, shield address (20), plate number (1), order or binding hash (32) |
| install message | 54 | tag 15, shield address (20), plate number (1), plate key (32) |
| order signature | 8,736 | for each of 21 trees: the secret (32), then 12 sibling hashes, lowest level first |
| install signature | 2,304 | 67 chain values (32 each), then 5 sibling hashes, lowest level first |
CONTRACT INTERFACE
None of these calls checks who the sender is. A valid signature is the only authority a shield knows.
| CALL | WHO | WHAT IT DOES |
|---|---|---|
| createShield | the creator | deploys a shield with its tree root, its step and its first plate |
| bind | anyone, with a plate signature | names the coin the shield guards |
| discharge | anyone, with a plate signature | fires the oldest open slot as the signed order |
| installPlate | anyone, with a Winternitz signature | puts the next plate into service |
| fireBacklog | anyone | fires the oldest open slot as a burn when the backlog rule allows it |
| read | anyone | returns the whole state of a shield in one call |
| records | anyone | returns the shield's history |
WHAT IS NOT PROTECTED
A shield protects the tax a coin earns and the decision about where it goes. It does not protect the wallets that hold the coin, the coin contract, the Flap curve or the PancakeSwap pool. Those are ordinary BNB Chain and stand or fall with it.
A shield takes BNB only. A coin launched with another payment token should not use one.
A shield whose key file is lost cannot be recovered by anyone, including this site.