H160

Composite 49 v393

primitive_types::H160

About This Type

160-bit hash (20 bytes), used as an Ethereum-compatible address.

Enables Ethereum-style addressing for cross-chain compatibility. Displayed as 0x-prefixed hex (e.g., 0x1234...abcd).

Encoding: Fixed-width: always exactly 20 bytes, no length prefix.

Fields (1)

#NameType
0(unnamed)[u8; 20]

SCALE Encoding

Rule
1 field encoded consecutively in declaration order. No field names or delimiters.
Size
sum of field sizes

Examples

Struct with 1 field = ?: [u8; 20]
0x<field0>
field 0 field0: [u8; 20]

Code Examples

import { TypeRegistry } from "@polkadot/types";

const registry = new TypeRegistry();

// Encode H160
const value = registry.createType("H160", {
  field: 0
});
console.log("Hex:", value.toHex());

Referenced By (26)

and 6 more...

Type Information

Type ID
49
Kind
Composite
Path
primitive_types::H160
Runtime
v393