Skip to content

Security: RustedBytes/pg-cryptocurrency

Security

docs/SECURITY.md

Security model

pg_cryptocurrency performs no HTTP, RPC, filesystem, or wallet operations. Prices, contract status, and chain state remain application responsibilities.

Text inputs have explicit length, alphabet, checksum, scale, and range checks. EVM mixed-case addresses require a valid EIP-55 checksum. Bitcoin input is restricted to mainnet and validates witness program rules. Cardano input must be a structurally valid mainnet Shelley or stake address. Polkadot input must use SS58 prefix 0, a 32-byte account id, and a valid BLAKE2b checksum. Arithmetic is checked; uint256 overflow/underflow and invalid raw-unit conversion fail instead of wrapping. Asset arithmetic verifies network plus native/contract identity.

The token registry is extension-owned, append-only SQL state. Registration and deprecation use parameterized SPI arguments, record actor/time metadata, enforce uppercase bounded symbols, validate contract addresses against their network, and retain a global network/contract index and an active-only network/symbol index. Public table access is read-only; an identity guard rejects updates to registered identity and metadata, and deprecation audit fields permit only one irreversible transition. Deprecated rows no longer resolve through legacy symbol input, while registry-validated v1 token values remain readable. Versioned input cannot alter the registered symbol, name, decimals, or asset kind.

Optional pg_money integration resolves both extensions through pg_catalog.pg_extension and schema-qualifies the generated types and functions. It does not trust caller-controlled search_path resolution.

crypto_address validates address encoding only. It cannot determine whether an EVM address is an externally owned account or contract without external chain state, so no such claim is made.

There aren't any published security advisories