What are the restriction on Corda X500Names?

Hi everybody, I am reading about the X500Name constraints on corda docs, I cannot understand this:

The organisation, locality, and country attributes are present.
The maximum number of characters in the whole x500 name string is 128 characters.

The fields of the name have character lengths less than the following maximum values:

Common name: 64
Organisation: 128
Organisation unit: 64
Locality: 64
State: 64


The description in the docs are pretty literal. The X500Name in Corda is used quite frequently in flows. They are presented in the format of:


And the fields are strings. So the numbers are the character lengths for the field.

This is my question from Slack. Actually there is a mismatch between the documentation and the code. In CordaX500Name, there is no validation against the length of the whole X500Name but here in the public docs website, there is one.
Furthermore, if we look at the cordanetwork rulebook, the constraints are a bit different. The rulebook says that the Organisation unit should have less than 110 characters, while the public Corda docs say 128

Hi Phuc,

I will double-check with the team where is the check for the total length of the X500Name.

For the 128 and 110 difference. In short, it is 110. It is preserving some additional characters for other fields.

1 Like

Do you think R3 should update the Corda community code & documentation then? Is there any reason to leave it 128 as in the Kotlin docs in Corda 4.8.6

Yes, the engineering ticket is already created and is in the pipeline.

Thanks for flagging out

1 Like

Thank you very much