Did you know ... Search Documentation:
Pack usdt_network -- prolog/usdt_network.pl
PublicShow source

Most failed stablecoin payments are not hacks. They are a USDT transfer sent on one network to an address that only exists on another, or a pasted address with one character wrong. This library looks at an address string and tells you:

  • which networks the format fits (TRON, EVM chains, Bitcoin, Solana, TON, Lightning invoice),
  • whether the built-in checksum is valid where the format has one (TRON and Bitcoin legacy Base58Check, Bitcoin SegWit Bech32 and Taproot Bech32m),
  • whether the network you are about to send on matches the address.

It is a format check only. It never touches a node or the internet, so it cannot tell you that an address is funded, owned by the right person, or that an exchange supports a given network for deposits. EVM addresses share one format across Ethereum, BNB Smart Chain, Polygon, Arbitrum, Optimism, Base and Avalanche C-Chain, so a 0x address can never tell you which of those the receiver expects. EIP-55 mixed-case checksums need Keccak-256 and are not verified.

author
- CryptoeSIM.io
license
- MIT
 network_info(?Network, -TokenStandard, -GasToken) is nondet
Token standard used by USDT/USDC on Network and the coin you need in the sending wallet to pay the network fee.
 address_networks(+Address, -Networks:list) is det
Networks whose address format matches Address. Empty list if none.
 address_check(+Address, -Network, -Status) is nondet
For each network the format fits, Status is one of checksum_ok, checksum_bad, or format_only (no checksum in the format, or one this library does not verify).
 send_check(+SendNetwork, +Address, -Verdict) is det
Verdict is ok(Status), ambiguous_evm(Chains) or mismatch(Fits).