/** A Dilithium3 public key. ~1952 bytes. */
type Dilithium3PublicKey = Uint8Array;
/** A Dilithium3 secret key. ~4032 bytes. */
type Dilithium3SecretKey = Uint8Array;
/** A Dilithium3 signature. ~3309 bytes. */
type Dilithium3Signature = Uint8Array;
/** A Dilithium3 keypair. */
interface Dilithium3Keypair {
    publicKey: Dilithium3PublicKey;
    secretKey: Dilithium3SecretKey;
}
/**
 * Generate a new Dilithium3 keypair.
 *
 * @param seed - Optional 32-byte seed for deterministic generation. If omitted,
 *               a cryptographically secure random seed is used.
 */
declare function generateKeypair(seed?: Uint8Array): Dilithium3Keypair;
/**
 * Sign a message with a Dilithium3 secret key.
 *
 * In practice the caller should sign the BLAKE3 hash of a structured message
 * (transaction body, block header, vote payload) rather than raw application
 * data, but Dilithium3 can handle arbitrary-length input.
 */
declare function sign(message: Uint8Array, secretKey: Dilithium3SecretKey): Dilithium3Signature;
/**
 * Verify a Dilithium3 signature.
 *
 * @returns `true` if the signature is valid for the message under the given
 *          public key, `false` otherwise. Never throws on invalid input —
 *          returns `false` instead.
 */
declare function verify(message: Uint8Array, signature: Dilithium3Signature, publicKey: Dilithium3PublicKey): boolean;

/**
 * BLAKE3 hash. Returns 32 bytes by default. Length can be customized via
 * `dkLen` — useful for address derivation (20 bytes) or extended output.
 */
declare function blake3(data: Uint8Array, dkLen?: number): Uint8Array;
/**
 * SHA-256 hash. Returns 32 bytes. Provided for Ethereum compatibility surfaces
 * only — AsentumChain consensus and state hashing use BLAKE3.
 */
declare function sha256(data: Uint8Array): Uint8Array;

/** A 20-byte address, displayed as `0x` + 40 hex characters with checksum. */
type Address = string;
/**
 * The bech32 human-readable prefix for AsentumChain addresses.
 * `ase1...` mirrors cosmos/osmosis/injective conventions so external
 * tooling can decode our addresses via any BIP-173 library.
 */
declare const ASE_HRP = "ase";
/**
 * Derive the raw 20 address bytes from a Dilithium3 public key.
 *
 * Use this when you need `Uint8Array`-typed addresses for on-chain logic
 * (state keys, transaction `to` fields, etc). For user-facing display, use
 * `addressFromPublicKey` which returns a checksummed hex string instead.
 */
declare function addressBytesFromPublicKey(publicKey: Dilithium3PublicKey): Uint8Array;
/**
 * Derive a 20-byte address from a Dilithium3 public key.
 *
 * Returns a `0x`-prefixed mixed-case hex string with the EIP-55-style
 * checksum applied.
 */
declare function addressFromPublicKey(publicKey: Dilithium3PublicKey): Address;
/**
 * Apply the EIP-55-style mixed-case checksum to a hex address.
 *
 * Accepts either `0x`-prefixed or bare hex input, any case. Always returns a
 * `0x`-prefixed, checksummed result. Throws on invalid length or non-hex
 * characters.
 */
declare function toChecksumAddress(address: string): Address;
/**
 * Check whether a string is a syntactically valid AsentumChain address.
 *
 * Verifies length, `0x` prefix, and hex charset. Does NOT verify the
 * checksum — an all-lowercase or all-uppercase address is considered valid.
 * Use `toChecksumAddress(addr) === addr` to enforce a checksummed form.
 */
declare function isValidAddress(address: string): boolean;
/**
 * Encode 20 raw address bytes as an `ase1...` bech32 string.
 * Deterministic: same bytes always produce the same string.
 */
declare function bytesToBech32Address(bytes: Uint8Array): Address;
/**
 * Decode an `ase1...` bech32 address to raw 20 bytes.
 * Throws on wrong HRP, bad checksum, or wrong payload length.
 */
declare function bech32AddressToBytes(addr: string): Uint8Array;
/**
 * Derive an `ase1...` bech32 address from a Dilithium3 public key.
 * The underlying 20-byte payload is identical to `addressFromPublicKey`.
 */
declare function bech32AddressFromPublicKey(publicKey: Dilithium3PublicKey): Address;
/**
 * True iff `s` is a syntactically valid `ase1...` bech32 address for the
 * `ase` HRP with a 20-byte payload. Does NOT throw.
 */
declare function isValidBech32Address(s: string): boolean;
/**
 * Backward-compat parser. Accepts either `0x...` hex or `ase1...` bech32
 * input and returns the canonical 20 raw bytes. Throws on any invalid form.
 *
 * Use this at every RPC boundary and every user-input parse point during the
 * migration window so all downstream code can stop caring about the input
 * format.
 */
declare function parseAnyAddress(input: string): Uint8Array;
/**
 * Canonicalize any accepted address input to the target display format.
 * Callers that stringify to logs/RPC responses should route through this so
 * the migration flip is a one-liner.
 */
declare function canonicalizeAddress(input: string, form: 'hex' | 'bech32'): Address;

/**
 * Convert between bit-widths (e.g. 8-bit bytes → 5-bit groups for bech32).
 * `pad` should be true when encoding, false when decoding.
 */
declare function convertBits(data: Uint8Array | number[], fromBits: number, toBits: number, pad: boolean): number[] | null;
/**
 * Encode raw bytes into a bech32 string with the given human-readable part.
 * Throws on invalid HRP characters or oversize data.
 */
declare function bech32Encode(hrp: string, bytes: Uint8Array): string;
/**
 * Decode a bech32 string into its HRP and raw bytes.
 * Returns null on any failure (bad case, unknown chars, bad checksum).
 */
declare function bech32Decode(input: string): {
    hrp: string;
    bytes: Uint8Array;
} | null;

export { ASE_HRP, type Address, type Dilithium3Keypair, type Dilithium3PublicKey, type Dilithium3SecretKey, type Dilithium3Signature, addressBytesFromPublicKey, addressFromPublicKey, bech32AddressFromPublicKey, bech32AddressToBytes, bech32Decode, bech32Encode, blake3, bytesToBech32Address, canonicalizeAddress, convertBits, generateKeypair, isValidAddress, isValidBech32Address, parseAnyAddress, sha256, sign, toChecksumAddress, verify };
