3

I need to validate Tezos addresses and have arrived at the following prefixed base 58 regular expressions for wallet and contract addresses.

Contract:

/KT1[1-9A-HJ-NP-Za-km-z]{33}/

Wallet:

/tz[1-3][1-9A-HJ-NP-Za-km-z]{33}/

Are these regexes sufficient, or could something like a KT2 or tz4 address ever be introduced into the protocol?

1 Answer 1

4

Transaction rollups coming with the Jakarta protocol will introduce new addresses with prefixes (txr1, tz4, and txi). And the K protocol will also introduce a new ones scr1, etc.

You can find all the prefixes here: https://gitlab.com/tezos/tezos/-/blob/master/src/lib_crypto/base58.ml#L348 https://gitlab.com/tezos/tezos/-/blob/master/src/proto_alpha/lib_protocol/tx_rollup_prefixes.ml#L33

Also, something to have in mind is that the regex is not enough to validate the address. It uses base58check encoding, which includes a checksum at the end of the address.

2
  • very informative, thank you. would any of these other adresses ever be able to hold FA12 or FA2 tokens in a way that is user controllable? it seems like the tz4 layer 2 address would be a candidate for this, will they be indistinguishable for the tz1,tz2,tz3 layer 1 addresses when they eventually interact with existing contracts?
    – 0x10
    Jun 27 at 7:15
  • 1
    They are distinguishable, tz4 will have a new type tx_rollup_l2_address. Jun 27 at 10:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.