Gas and cost model
What each action costs, where the cost comes from, and why the numbers are modelled rather than measured on a live network.
Gas is measured; the money is not. The gas figures come from the test suite and from EVM cost rules, so they are accurate. What they cost in currency depends entirely on the gas price and the BNB price at the moment you send, so treat any amount here as an order of magnitude.
Where the cost comes from
Three EVM prices explain almost the entire cost model.
| Operation | Gas | Effect on bMail |
|---|---|---|
| Writing a fresh 32-byte storage slot | 20,000 | Kept for small structural facts only |
| Event log data, per byte | 8 | Carries every message body |
| Event topic | 375 | Three indexed topics make inbox filtering cheap |
| Base transaction | 21,000 | The floor under any action |
Message cost by size
| Message | Envelope | Approx. gas | Notes |
|---|---|---|---|
| One line | ~0.5 KB | ~55,000 | Padded to the 256-byte block |
| Short note | ~1 KB | ~74,000 | The reference figure |
| Long email | ~4 KB | ~110,000 | At the free-envelope threshold |
| Maximum | 32 KB | ~330,000 | MAX_ENVELOPE_BYTES |
The envelope is roughly twice the plaintext, because every message carries two ciphertexts: one for the recipient and one so the sender can read their own sent copy. Padding to 256-byte blocks adds a little more.
Other actions
| Action | Approx. gas | Fee on top |
|---|---|---|
| Register a name, 5+ characters | ~150,000 to 250,000 | None. Gas only. |
| Register a name, 3 to 4 characters | ~150,000 to 250,000 | price3 / price4 |
| Rotate a key | ~50,000 | None |
| Set a stamp price | ~30,000 | None |
| Claim or refund one stamp | ~45,000 | None |
| Two-step transfer, both halves | ~90,000 | None |
| Reading any mail | 0 | Reads are log queries, not transactions |
Only the sender pays. Reading your inbox is a filtered log query against an RPC node and costs nothing on chain.
Why two chains
BSC carries the liquidity and the recognition. opBNB carries the cost profile
that makes routine messaging feel free. Deploying to both lets a user choose
between the two without changing identity, since the mailbox key derivation
deliberately excludes chainId.
What large attachments would need
32 KB is a hard ceiling in the contract. Anything larger belongs off chain, with only a reference and a content key inside the envelope. BNB Greenfield is the intended target for that, and it is not part of v1.