---
id: "wifaddrcomp"
kind: "datatype"
status: "stable"
is_pii: false
categories: ["cryptocurrency", "secrets"]
langs: ["common"]
quality: 83
url: "http://registry.apicrafter.io/datatype/wifaddrcomp"
---

# Bitcoin private key in WIF (compressed public key) (`wifaddrcomp`)

Bitcoin private key in Wallet Import Format (WIF) for a compressed public key: the Base58Check encoding of the byte 0x80, the 32-byte private key and the flag byte 0x01. Such keys have 52 characters and start with K or L. The value is a secret: whoever knows it can spend the funds. Testnet keys start with c and are not matched; keys for an uncompressed public key are wifaddruncomp.

- Parent datatype: `private_key`
- Personal data (PII): no
- Categories: Cryptocurrency (cryptocurrency), Secrets and credentials (passwords, keys, tokens) (secrets)
- Countries: global
- Languages: Common to most languages (common)
- Classification: identifier

## Detection

Regular expression (Python `re`):

```
^[KL][1-9A-HJ-NP-Za-km-z]{51}$
```

Check digit algorithm: `base58check`

## Examples

- `L1aW4aubDFB7yfras2S1mN3bqg9nwySY8nkoLmJebSLD5BWv3ENZ` — Example from https://allprivatekeys.com/bitcoin-address-format
- `KwdMAjGmerYanjeui5SHS7JkmpZvVipYvB2LJGU1ZxJwYvP98617` — Sample key of the Bitcoin Wiki article on WIF with the compression flag; never import or fund it
- `L1aW4aubDFB7yfras2S1mN3bqg9nwySY8nkoLmJebSLD5BWv3ENa` (invalid example) — last character changed, the checksum fails
- `5HueCGU8rMjxEXxiPuD5BDku4MkFqeZyd4dZ1jvhTVqvbTLvyTJ` (invalid example) — key for an uncompressed public key (wifaddruncomp)

## Metacrafter rules

2 rules: 1 match the field name, 1 match values.

- `wifaddrcomp` (data, `common/cryptocurrency.yaml`)
- `wifaddrcomp_by_field` (field, `common/cryptocurrency.yaml`)

## Supported by tools

- `metacrafter`

## Translations

- ru: Закрытый ключ Bitcoin в формате WIF (сжатый открытый ключ)

## Sources

- other: <https://en.bitcoin.it/wiki/Wallet_import_format>
- other: <https://allprivatekeys.com/bitcoin-address-format>

## Quality

Score 83/100. Missing: authoritative source link, mapping (Wikidata, Schema.org, ...).

JSON: <http://registry.apicrafter.io/api/v1/datatypes/wifaddrcomp.json> · Edit: <https://github.com/apicrafter/metacrafter-registry/edit/main/data/datatypes/any/cryptocurrency/wifaddrcomp.yaml>
