Accounts and transactions
Chain identity
app/config.go defines everything that identifies QUAC on the wire, and installs it before any other code runs:
const (
AppName = "QuacApp"
BaseDenom = "uquac" // 1 QUAC = 10^6 uquac
DisplayDenom = "QUAC"
DenomExponent = 6
AccountAddressPrefix = "quac"
AccountPubKeyPrefix = "quacpub"
ValidatorAddressPrefix = "quacvaloper"
ValidatorPubKeyPrefix = "quacvaloperpub"
ConsNodeAddressPrefix = "quacvalcons"
ConsNodePubKeyPrefix = "quacvalconspub"
PQKeyType = "ml_dsa_65"
)
func init() {
sdk.DefaultBondDenom = BaseDenom
cfg := sdk.GetConfig()
cfg.SetBech32PrefixForAccount(AccountAddressPrefix, AccountPubKeyPrefix)
cfg.SetBech32PrefixForValidator(ValidatorAddressPrefix, ValidatorPubKeyPrefix)
cfg.SetBech32PrefixForConsensusNode(ConsNodeAddressPrefix, ConsNodePubKeyPrefix)
cfg.Seal()
}
A Go init() runs when the package is imported, before main. The node, the CLI and the tests therefore all agree on the prefixes before any address is printed or parsed. cfg.Seal() makes the global config read-only, so nothing can change the prefixes afterwards.
The same prefixes are passed explicitly to the account keeper and staking keeper in app/app.go, so the keepers' address codecs never depend on global state.
| Prefix | Example | Used for |
|---|---|---|
quac |
quac1z8qt7x6n… |
Accounts |
quacvaloper |
quacvaloper17y9rqx… |
Validator operators |
quacvalcons |
quacvalcons1qeg8ew… |
Validator consensus addresses (block proposer, signatures) |
Keys
Creating a key
quacd keys add mywallet # ML-DSA-65 by default on QUAC
quacd keys add mywallet --recover # restore from a 24-word mnemonic
quacd keys show mywallet -a # print the quac1… address
ML-DSA-65 keys are derived from the mnemonic deterministically, reusing the standard Cosmos HD path:
24-word mnemonic ──BIP-39──▶ seed ──BIP-32, m/44'/118'/0'/0/0──▶ 32 bytes ──FIPS 204 keygen──▶ ML-DSA-65 key pair
The Cosmos SDK (crypto/hd/mldsa65.go) takes the 32-byte BIP-32 child key and uses it directly as the ML-DSA-65 key-generation seed (mldsa65.GenPrivKeyFromSeed). The same mnemonic always restores the same key and address, and different account indexes in the path give independent keys. The BIP-32 step only stretches the mnemonic into a seed. The resulting key is pure ML-DSA-65, and nothing about it is exposed on chain except the ML-DSA public key.
Keyring backends
| Backend | Where keys live | Use for |
|---|---|---|
os |
The operating system's credential store | Desktop wallets |
file |
Encrypted files under --home, with a passphrase |
Servers |
test |
Unencrypted files under --home |
Devnet, CI, the testnet faucet only |
Addresses
An address is SHA-256(public key)[:20], Bech32-encoded:
pubkey (1,952 bytes) ──SHA-256──▶ 32 bytes ──first 20──▶ address bytes ──bech32("quac")──▶ quac1…
Transactions
A Cosmos SDK transaction has three parts:
| Part | Contents |
|---|---|
| Body | Messages (for example MsgSend), memo, timeout, unordered flag |
| Auth info | One signer info per signer (public key on first use, sign mode, sequence) and the fee (amount, gas limit, optional payer or fee granter) |
| Signatures | One per signer. On QUAC each is 3,309 bytes. |
Signing covers the body, the auth info, the chain ID and the account number (SIGN_MODE_DIRECT). A signature from one chain can't be replayed on another, and the per-account sequence number stops replays on the same chain.
QUAC also enables SDK unordered transactions (authkeeper.WithUnorderedTransactions(true) in app/app.go). Such a transaction carries a timeout instead of a sequence number, so high-volume senders can submit many in parallel without coordinating sequence numbers.
Size and gas
An ML-DSA transfer is large by blockchain standards:
| Component | Bytes |
|---|---|
| Public key (first transaction only) | 1,952 |
| Signature | 3,309 |
| Message, fee, sequence, encoding | about 250 |
| Total, first transaction from an account | about 5,500 |
| Total, later transactions | about 3,600 |
Gas comes from three places:
- Size:
TxSizeCostPerByte= 10 gas per byte, so about 55,000 gas for a first transaction. - Signature verification:
SigVerifyCostMlDsa65= 750 gas per ML-DSA-65 signature. - State access: reading and writing the accounts and balances involved, which is most of the rest.
Measured on the testnet, a transfer uses about 285,000 gas. At the default minimum gas price of 0.0025uquac per gas, that is a fee of about 0.0008 QUAC.
Estimating gas
quacd tx bank send … --gas auto --gas-adjustment 1.4 --gas-prices 0.0025uquac
--gas auto simulates the transaction first. The 1.4 multiplier leaves headroom, because simulation can come in a little low. QUAC's gas consumer charges the ML-DSA price even in simulations, which keeps the estimate honest.
Block limits
The testnet genesis sets:
| Parameter | Value | Why |
|---|---|---|
block.max_gas |
100,000,000 | About 350 transfers per block. Without a cap (-1), one huge transaction could stall block production. |
block.max_bytes |
4 MiB | Room for those transactions plus ML-DSA commit signatures. |
Multisig
A legacy Amino multisig (quacd keys add shared --multisig a,b,c --multisig-threshold 2) is allowed when all members are ML-DSA-65 keys. Each member signature is 3,309 bytes, so a 2-of-3 multisig transaction carries about 6.6 KB of signatures.
Receiving at classical addresses
The chain can't tell what kind of key an address came from until that key signs. Anyone can therefore send QUAC to an address derived from a secp256k1 key, but that key can never spend. Wallets and exchanges should only show addresses from ML-DSA-65 keys. The explorer flags accounts that hold a classical key.