Tell whether a Cardano payment address carries a stake credential
A wallet export can mix base and enterprise addresses. The header byte determines whether the remaining payload carries a stake reference and how the payment credential is represented.
Decode the binary header
Use an address decoder to obtain the original bytes after verifying the textual encoding. For Shelley payment addresses, split the first byte into an upper type nibble and lower network tag.
0x01 = 0000 0001
0x61 = 0110 0001
In the examples, both network tags are 1 for mainnet. Type 0 denotes a base address with key-hash payment and staking credentials. Type 6 denotes an enterprise address with a key-hash payment credential and no stake credential.
Avoid inventing a reward account
An enterprise address alone cannot supply a staking credential for reward queries. Even with a base address, inspect the stake credential type before constructing a reward address. Byron addresses use a different format and need a separate decoder. cips.cardano.org Cardano CIP-19