Skip to content

pg_bitcoin_address

Bitcoin address types plus Base58Check and Bech32/Bech32m codecs.

pg_bitcoin_address · Bitcoin address types plus Base58Check and Bech32/Bech32m codecs.

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
101901pg_bitcoin_addresspg_bitcoin_address2.1TYPEWTFPLC

Usage

Sources:

pg_bitcoin_address Bitcoin address types plus Base58Check and Bech32/Bech32m codecs.

Enablement

Install the files for the intended server, then create pg_bitcoin_address in the target database:

CREATE EXTENSION pg_bitcoin_address;

Core Workflow

The following example is taken from the reviewed upstream documentation. Adapt object names, paths, credentials, and workload values before use.

=> SELECT pg_column_size('1BitcoinEaterAddressDontSendf59kuE'::text);
pg_column_size | 38

=> SELECT pg_column_size('1BitcoinEaterAddressDontSendf59kuE'::bitcoin_address);
pg_column_size | 26

=> SELECT pg_column_size('bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4'::text);
pg_column_size | 46

=> SELECT pg_column_size('bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4'::bitcoin_address);
pg_column_size | 26

Main Objects

The reviewed install surface includes these prominent objects:

ObjectKindOperational role
bitcoin_addressFUNCTIONCallable function from the reviewed install surface.
programFUNCTIONCallable function from the reviewed install surface.
base58checkTYPEUser-facing data type created by the extension.
versionFUNCTIONCallable function from the reviewed install surface.
hrpFUNCTIONCallable function from the reviewed install surface.
is_blindingFUNCTIONCallable function from the reviewed install surface.
is_liquidtestnetFUNCTIONCallable function from the reviewed install surface.
is_liquidv1FUNCTIONCallable function from the reviewed install surface.

Operations and Boundaries

  • Treat extension upgrades as database changes: review the upstream upgrade path, privileges, locks, and backup/restore behavior first.

Table reader