Current Value
1Relevant for: validatorsdeveloperswallets
The Big Picture
Beyond standard fields (display name, email, etc.), identities can include custom additional fields. This constant caps how many custom fields are allowed. More fields mean more storage and higher deposits, so the limit keeps identities reasonable while allowing flexibility.
Why This Matters
If you're building identity registration UI, this tells you how many custom fields to allow. Exceeding this limit will cause set_identity to fail. The limit also affects deposit calculation.
Example
MaxAdditionalFields is 1. You can register with standard fields (display, email, web, etc.) plus 1 additional custom field (maybe 'discord'). Trying to add 2 additional fields will fail.
Common Questions
- What are 'additional fields' vs standard fields?
- Standard fields are predefined: display, legal, web, riot, email, twitter, image. Additional fields are custom key-value pairs beyond these.
- How does this affect the deposit?
- Each additional field increases the deposit by FieldDeposit. More fields = higher deposit.
From Chain Metadata
Maximum user-configured additional fields
Use Cases
- Validate identity info before registration
- Calculate maximum possible deposit for identity
- Design identity forms with field limits
Code Examples
import { ApiPromise, WsProvider } from "@polkadot/api";
import { stringCamelCase } from "@polkadot/util";
const provider = new WsProvider("wss://entrypoint-finney.opentensor.ai:443");
const api = await ApiPromise.create({ provider });
// Query MaxAdditionalFields constant
const value = api.consts[stringCamelCase("Registry")][stringCamelCase("MaxAdditionalFields")];
console.log("MaxAdditionalFields:", value.toHuman());Type Information
- Type
- u32
- Byte Size
- 4 bytes
- Encoding
- fixed
- Raw Hex
- 0x01000000
Runtime Info
- Pallet
- Registry
- First Version
- v136
- Latest Version
- v136
- Current Runtime
- v393