Hello everyone,
Is there a way to identify if an address is an enterprise address or not from just the address. I checked the blockfrost api to see if the detailed information could work. I’m not necessarily stuck to a specific api and would prefer a solution in bash anyways.
I don’t think just checking if there’s a stake key will work. I have been able to create wallet addresses without a stake key.
Would I be able to assume that any address that doesn’t start with addr is an enterprise address? Or is there a calculation I can do to check.
Thanks,
Chris
Addresses without a stake key are enterprise addresses. So, the short ones are enterprise addresses, the long ones are ”normal” addresses.
You have created an enterprise address there.
Addresses that start with Ddz
or Ae2
are Byron-era addresses. Since that was before staking was possible, the distinction does not really make sense there. Or you could consider all of them enterprise addresses. As you wish.
More about addresses can be found in: https://cips.cardano.org/cips/cip19/
From the header bits at https://cips.cardano.org/cips/cip19/#shelleyaddresses and the Bech32 encoding table at https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki#bech32 you can also deduce that the type of address can be seen by the first character after addr1
:
Start of address |
Header bits |
Payment part |
Stake part |
addr1q |
0000 |
Key hash |
Key hash |
addr1z |
0001 |
Script hash |
Key hash |
addr1y |
0010 |
Key hash |
Script hash |
addr1x |
0011 |
Script hash |
Script hash |
addr1g |
0100 |
Key hash |
Pointer |
addr12 |
0101 |
Script hash |
Pointer |
addr1v |
0110 |
Key hash |
— |
addr1w |
0111 |
Script hash |
— |
In the wild, I have never seen pointer addresses. And scripts as stake parts are also quite rare. So, you’ll mostly see addr1q
, addr1z
, addr1v
, and addr1w
on the chain, where addr1v
are the ones usually called enterprise addresses.
3 Likes