SAFU MODE 安全模式

How SAFU MODE works.

SAFU MODE launches coins on Flap, on BNB Chain. The dev's coins, the dev's share of the tax and the SAFU Fund all sit in vaults that open only for one-time hash signatures. This page covers what that is built from, how each part works, what it costs, and where the protection stops.

The quantum problem

Every ordinary BNB Chain wallet is an elliptic-curve key pair (secp256k1). The wallet is safe as long as nobody can work out the private key from the public key. A large enough quantum computer running Shor's algorithm can do exactly that, for every elliptic-curve key at once.

Hash functions are a different kind of problem. The best known quantum attack on a hash only halves its strength, so a 256-bit hash keeps a wide margin. A signature made from nothing but hashes stays secure.

No such computer exists today. The reason to act now is that a dev wallet and a treasury can sit on-chain for years, with their public keys visible the whole time. A key that is safe this year is not promised to be safe for the life of the coin.

What it is built from

SAFU MODE uses the Winternitz one-time signature, a design from 1979 that needs only a hash function. It is the part that does the signing inside every hash-based standard NIST has published:

We use the Winternitz signature in its plain form over keccak256, the hash BNB Chain already runs on, and let the vault itself keep track of which key comes next. This is the same building block as those standards. It is not an implementation of either one, and we don't call it one.

How a vault works

A vault is one small contract. It has no owner address and no wallet key.

Any wallet can submit the transaction and pay the network fee. That wallet has no authority: it can't change what the vault does, because the signature fixes every field. Breaking the fee wallet's key gains an attacker the gas money in it.

A vault's address is derived from its first key, so nobody can create your vault with a different key, and it can receive coins before it exists on-chain. All keys come from one vault phrase that is made in your browser and never leaves it.

The signature, in numbers

Hash functionkeccak256, 256-bit output
Key67 secrets. Each is hashed 15 times in a row to make a chain.
Fingerprint32 bytes: the hash of the 67 chain ends. This is all the vault stores.
Signature2,144 bytes: one point on each of the 67 chains
What sets the pointsThe 64 hex digits of the message hash, plus 3 checksum digits
Uses per keyOne. The signature names the next key and the vault switches to it.
Checking itAbout 500 keccak256 calls. The contract hashes each shown point forward to the end of its chain and compares the result with the stored fingerprint.

Anyone can hash a point forward. Nobody can hash it backward. The checksum means that pushing any digit of the message forward forces a checksum chain backward, so a signature can't be bent to fit a different message. The contract is 38 lines and is the whole of the cryptography: Wots.sol.

Beside the NIST scheme

The other way to do this on BNB Chain is to verify SLH-DSA-128s in a contract. Here are the two side by side.

SLH-DSA-128sSAFU MODE
Rests onHashes onlyHashes only
Hash output128 bits (SHA-256, cut short)256 bits (keccak256, full)
Signature7,856 bytes2,144 bytes
Create a vaultabout 1.1 million gasabout 0.5 million gas
Sign and send BNBabout 0.9 million gasabout 0.35 million gas
Buy a coin from the vaultabout 1.25 million gasabout 0.8 million gas
Sell a coin from the vaultOne signatureTwo keys: one to allow, one to sell
Trade after PancakeSwap listingNot builtBuilt
KeysOne key signs many timesOne key per action, switched by the vault
A NIST standard as a wholeYes, FIPS 205No. The signing part of it, used directly

What you give up with ours: the name of a finished NIST standard, and keys you can reuse. What you get: a full 256-bit hash, a signature under a third of the size, and every action at roughly half the gas or less. The one-time rule is enforced by the vault, which moves to the next key inside the same transaction.

SLH-DSA figures are the ones published by PQCpad, a BNB Chain launchpad that verifies SLH-DSA-128s on-chain, read on 4 December 2026. Ours are measured; see Measured costs.

A launch, step by step

  1. Store. The coin's picture and details are stored with Flap's own upload service, so the coin shows correctly on Flap.
  2. Make the vault key. Your browser makes a vault phrase and works out the first key's fingerprint. The dev vault's address follows from it.
  3. Seal. A separate one-time key signs the launch: your wallet, the name, the ticker, the address salt and the vault key. Change any of them and the seal fails.
  4. Submit. Your wallet sends one transaction to the SAFU MODE contract and pays the fee.
  5. Verify and launch. The contract checks the seal, creates a keyless tax splitter for the coin, and calls Flap's newTokenV6. Creation and your first buy happen together, so nobody can buy in between. The coins from that buy go straight to your vault.
  6. List. In the same transaction the coin is recorded in the contract with its vault, its splitter and the key that sealed it. The board on the home page is read from that record, so a listing can't be faked.

Every coin gets the same settings. The contract has no owner and no setting can be changed after deployment, by us or anyone else.

Where the tax goes

The fund vault is controlled by the SAFU MODE team's vault phrase. The contract does not force what it buys or when. What it can't do is move without leaving a record: every action, target and amount is readable from the vault.

What is protected

PartQuantum-resistant?
The dev's first buy and the dev's tax shareYes. Held in the dev's vault
The SAFU Fund's BNB and coinsYes. Held in the fund vault
Where each coin's tax is sentYes. The splitter has no key to break
BNB and coins a holder keeps in their own vaultYes. Any holder can make one
The wallet that submits a launch or pays a feeNo. It is an ordinary wallet, and it controls nothing afterwards
Buyers holding in ordinary walletsNo, until they move coins into a vault
Flap's contracts and the BNB in its bonding curveNo. Controlled by Flap's own keys
BNB Chain itself: validators, transaction sendersNo, until the network migrates

The accurate one-line claim is a quantum-resistant dev bag, tax route and fund. It is not a quantum-resistant token: Flap creates the token, and no launchpad can force every holder into a vault.

Measured costs

ActionGas
Create a vault500,715
Check a signature and send BNBabout 330,000
Buy a coin on Flap from a vault790,613
Launch on Flap6,300,764

Measured on a private copy of BNB Chain mainnet, the launch and the buy against Flap's real contracts. The cost in BNB depends on the network's gas price at the time.

Check it yourself

Status and limits

This is unaudited software. It has not had an independent security review. Only use amounts you can afford to lose.

References

SAFU MODE 如何运作。

SAFU MODE 在 BNB 链的 Flap 上发行代币。开发者的代币、开发者的税收份额和 SAFU 基金都放在金库里,金库只认一次性哈希签名。本页说明它由什么构成、每个部分如何运作、成本多少,以及保护到哪里为止。

量子问题

每个普通的 BNB 链钱包都是一对椭圆曲线密钥(secp256k1)。只要没人能从公钥推出私钥,钱包就是安全的。足够大的量子计算机运行 Shor 算法就能做到这一点,而且对所有椭圆曲线密钥都有效。

哈希函数是另一类问题。已知最好的量子攻击只能把哈希的强度减半,所以 256 位哈希仍有很大余量。只用哈希构成的签名依然安全。

今天还没有这样的计算机。现在就动手的原因是:开发者钱包和金库会在链上放很多年,公钥一直公开。今年安全的密钥,不保证在代币的整个生命周期里都安全。

它由什么构成

SAFU MODE 使用 Winternitz 一次性签名,这是 1979 年的设计,只需要一个哈希函数。NIST 发布的每一个哈希签名标准里,负责签名的都是它:

我们直接使用 Winternitz 签名,哈希用 BNB 链本身就在用的 keccak256,由金库自己记录下一把密钥。它与这些标准是同一个基础构件,但不是其中任何一个标准的实现,我们也不这样称呼它。

金库如何运作

金库是一个很小的合约。它没有所有者地址,也没有钱包私钥。

任何钱包都可以提交交易并支付网络费。这个钱包没有任何权限:签名已经固定了每一个字段,它改变不了金库要做的事。攻破付费钱包的密钥,攻击者只能拿到里面的燃料费。

金库地址由它的第一把密钥推导而来,所以没人能用别的密钥创建你的金库,而且金库在上链之前就能收币。所有密钥都来自一条金库口令,口令在你的浏览器里生成,不会离开浏览器。

签名的具体数字

哈希函数keccak256,输出 256 位
密钥67 个秘密值,每个连续哈希 15 次,形成一条链。
指纹32 字节:67 条链末端的哈希。金库只保存这个。
签名2,144 字节:67 条链上各亮出一个点
点的位置由什么决定消息哈希的 64 个十六进制位,加 3 个校验位
每把密钥可用次数一次。签名里写明下一把密钥,金库随即切换。
如何核对约 500 次 keccak256。合约把每个亮出的点向前哈希到链的末端,再与保存的指纹比较。

任何人都能把一个点向前哈希,没人能向后哈希。校验位保证:把消息的任何一位往前推,都会迫使某条校验链往后退,所以签名无法被改去适配另一条消息。合约只有 38 行,全部密码学都在这里:Wots.sol。

与 NIST 方案对照

在 BNB 链上做这件事的另一种办法,是在合约里验证 SLH-DSA-128s。两者对照如下。

SLH-DSA-128sSAFU MODE
安全基础只依赖哈希只依赖哈希
哈希输出128 位(截短的 SHA-256)256 位(完整的 keccak256)
签名大小7,856 字节2,144 字节
创建金库约 110 万 gas约 50 万 gas
签名并转出 BNB约 90 万 gas约 35 万 gas
从金库买入代币约 125 万 gas约 80 万 gas
从金库卖出代币一次签名两把密钥:一把授权,一把卖出
上 PancakeSwap 之后交易尚未实现已实现
密钥一把密钥可签多次每次操作一把,由金库切换
整体是否为 NIST 标准是,FIPS 205不是。直接使用其中负责签名的部分

用我们的方案,你放弃的是:一个完整 NIST 标准的名字,以及可重复使用的密钥。你得到的是:完整的 256 位哈希、不到三分之一大小的签名,以及每个操作大约一半或更少的 gas。一次性规则由金库强制执行,它在同一笔交易里就切换到下一把密钥。

SLH-DSA 的数字来自 PQCpad 公布的数据(它是 BNB 链上在链上验证 SLH-DSA-128s 的发射台),读取于 2026 年 12 月 4 日。我们的数字为实测,见“实测成本”。

发行的每一步

  1. 存储。代币的图片和资料存到 Flap 自己的上传服务,这样代币在 Flap 上能正常显示。
  2. 生成金库密钥。浏览器生成金库口令,算出第一把密钥的指纹,开发者金库的地址由此确定。
  3. 封印。另一把一次性密钥对这次发行签名:你的钱包、名称、代码、地址盐值和金库密钥。改动其中任何一项,封印就失效。
  4. 提交。你的钱包向 SAFU MODE 合约发送一笔交易并支付费用。
  5. 核对并发行。合约核对封印,为代币创建一个无密钥的税收分配合约,然后调用 Flap 的 newTokenV6。创建和你的首次买入同时发生,没人能插在中间买入。买到的代币直接进入你的金库。
  6. 登记。在同一笔交易里,代币连同它的金库、分配合约和封印密钥一起记录在合约中。首页的列表就读自这份记录,所以无法伪造上榜。

每个代币的设置都一样。合约没有所有者,部署之后任何设置都无法更改,我们也不行。

税去了哪里

基金金库由 SAFU MODE 团队的金库口令控制。合约不强制它买什么、何时买。它做不到的是不留记录地动用资金:每一次操作、目标和金额都能从金库读出。

保护范围

部分是否抗量子?
开发者的首次买入和税收份额是。放在开发者金库里
SAFU 基金的 BNB 和代币是。放在基金金库里
每个代币的税发往哪里是。分配合约没有可被破解的密钥
持币者放在自己金库里的 BNB 和代币是。任何持币者都可以创建金库
提交发行或支付费用的钱包否。它是普通钱包,之后不控制任何东西
用普通钱包持币的买家否,除非把代币转入金库
Flap 的合约及其联合曲线里的 BNB否。由 Flap 自己的密钥控制
BNB 链本身:验证者、交易发送者否,直到网络完成迁移

准确的一句话是:抗量子的开发者持仓、税收去向和基金。它不是抗量子的代币:代币由 Flap 创建,没有哪个发射台能强迫每个持币者都用金库。

实测成本

操作Gas
创建金库500,715
核对签名并转出 BNB约 330,000
从金库在 Flap 上买入代币790,613
在 Flap 上发行6,300,764

在 BNB 链主网的私有副本上测得,其中发行和买入针对的是 Flap 的真实合约。折合多少 BNB 取决于当时的 gas 价格。

自己验证

现状与限制

本软件未经审计。没有经过独立的安全审查。只使用你承受得起损失的金额。

参考资料