Docs

How qflap works, what it proves and what it does not.

What qflap is

qflap is a launchpad for Flap tax coins on BNB Chain. A coin launched here is an ordinary Flap coin in every way that matters to a trader: the same Portal creates it, it has the same curve, the same tax settings, and it moves to PancakeSwap the same way.

What is different happens just before and just after the launch. Before it, a set of hash based keys is made for the coin and the coin's address is derived from them. After it, those keys sign a short list of facts about the coin as the chain reports them. All of it can be checked by anyone with a hash function.

The point is narrow and worth stating exactly. qflap gives every coin a record of its own deployment that does not depend on elliptic curve signatures.

Why hashes

Wallets on BNB Chain sign with elliptic curve keys. A large enough quantum computer could work a private key back from its public key, and a public key is exposed the first time a wallet sends a transaction. Nobody has that computer today. The concern is about records that are meant to last.

Hash functions do not have that problem in the same way. The best known quantum attack on a hash only makes guessing somewhat faster, and a 256 bit hash keeps a wide margin. Signature schemes built from hashes alone have been studied since the 1970s and are among the schemes standards bodies have chosen for the years after elliptic curves.

qflap uses one of the simplest of them, a Winternitz one-time signature under a small hash tree, with keccak256 throughout. keccak256 is the hash BNB Chain itself uses for addresses, so the same function carries a coin's key and its address.

How Flap makes an address

Flap's Portal deploys each coin with CREATE2. With CREATE2 a contract's address is not random and does not depend on timing. It is the hash of three things: who deploys (the Portal), the code being deployed (a small proxy pointing at Flap's tax coin), and a 32 byte value called the salt, chosen by whoever launches.

Flap adds one rule. A tax coin's address must end in 7777. Only about one salt in 65,536 gives such an address, so every launcher on Flap searches: try a salt, compute the address, look at the ending, try the next.

On a plain launch the salts being tried are random. That is the one free choice in a Flap deployment, and qflap uses it.

The key tree

When you press launch, the qflap signer draws 32 random bytes, the seed. From the seed it derives eight one-time keys. Each key is 67 secret values, and each secret value is hashed 15 times in a row to give a public end. The 67 ends of a key are hashed together into one value, the one-time public key.

The eight public keys are then hashed in pairs to make four values, those in pairs to make two, and those two to make one. That last value is the root. It is 32 bytes and it stands for all eight keys at once.

The seed never leaves the signer. The root is public from the first moment.

The grind

Your browser now does Flap's salt search, with one change. Candidate number 0 is the hash of the root, the parent and the number 0. Candidate 1 is the hash of the root, the parent and the number 1. And so on, for 262,144 candidates. The parent is the address of the newest coin already deployed on qflap, or the zero address for the very first coin.

Each candidate is turned into the address Flap would give it. About four of the 262,144 will end in 7777. If none does, the search continues until one does.

Because every candidate is a hash of the root, whichever one wins, the resulting address is tied to this key tree. A different tree would have produced different candidates and a different address.

Grade

Several candidates usually qualify. qflap keeps the one whose address begins with the most characters in common with the beginning of the root, and calls that count the grade.

Each extra shared character is sixteen times less likely than the last. About 22 in 100 launches reach grade 1, about 15 in 1,000 reach grade 2, about 1 in 1,000 reaches grade 3. Grade costs nothing and cannot be bought. It is what the search happened to find.

A grade above 0 can be seen without any tools: the coin's address and its root start with the same characters.

The launch call and key 0

Your wallet then sends the ordinary Flap launch transaction. Everything in it comes from the launch form. The salt is the one from the search.

When the transaction confirms, the signer looks it up on chain. It checks that the transaction succeeded, that the coin was created in it, that the salt inside it is the salt this key produces, and that the Flap Portal recognises the coin. Only then does it spend key 0 on a statement that names the coin, the root, the parent, the counter, the salt, the transaction and the hash of the full launch call.

The launch call contains every setting of the coin: its name, its buy and sell tax, how the tax is split, who receives it. So key 0's signature fixes, under the coin's own root, exactly what was asked of Flap at launch.

Keys 1 to 7

The remaining seven keys are each reserved for one state of the coin. Keys 1, 2 and 3 are for the Flap curve at 25, 50 and 75 percent. Key 4 is for the move to PancakeSwap. Keys 5, 6 and 7 are for the PancakeSwap pool holding two, four and eight times the amount of pay token it held when the coin arrived.

Nothing here runs on a timer. When a coin's page is opened, the signer reads the coin's state from the Flap Portal and, once the coin has moved, from the pool. If the next state in order has been reached, it spends that key. If not, nothing happens. Keys are always spent in order.

Each statement is a few lines of fixed text: which coin, which key, which state, and for keys 4 to 7 which pool. Because the text is fixed, there is exactly one message each key could ever sign.

Lineage

The parent that goes into every salt links the coins together. A coin's address is a hash of, among other things, the address of the coin before it. Follow the parents back and you reach the first coin, whose parent is the zero address.

The lineage page draws this as a line with branches. It is a record of the order in which coins were built that needs no signatures at all.

The anchor

The anchor is qflap's own coin. It is shown at the top of the main page and in the bar at the top of every page, with its value read from Birdeye every second and its address drawn as a grid of cells.

The anchor has no special powers over other coins. It is not a parent unless it happens to have been the newest coin when someone launched, and it holds none of the keys.

What this does not do

qflap does not make BNB Chain quantum proof. Buying, selling and sending a coin are authorized by ordinary wallet signatures, like everything else on the chain. If those are ever broken, balances are at risk on every chain that uses them, and no launchpad can change that.

qflap does not put the keys in your hands. The signer holds each coin's seed. What limits it is that every statement is fixed text and every key can be used once, so the most it could do wrong is sign a state early, and anyone can compare a statement with the chain.

qflap does not sign the moment something happens. A key is spent when someone next opens the coin's page after the chain has reached that state. The block written next to each statement is the block at which the signer looked.

qflap does not change a coin after launch. It has no control over the coin's contract, its tax, its liquidity or its holders.

Words used on this site

anchorqflap's own coin, set by the site
root32 bytes that stand for all eight of a coin's keys
parentthe newest qflap coin at the moment a key was opened
counterwhich of the candidates became the salt
saltthe 32 bytes Flap turns into the coin's address
gradehow many leading characters the address shares with the root
statementthe fixed text a key signs
paththe three hashes that lead from one key up to the root
unbounda coin launched here without a key
boundonly key 0 spent
spendingtwo to seven keys spent
exhaustedall eight keys spent