H256
Composite 13 v393primitive_types::H256
About This Type
256-bit hash value (32 bytes).
Used for block hashes, extrinsic hashes, storage keys, and Merkle tree roots. Typically the output of Blake2b-256 hashing.
Encoding: Fixed-width: always exactly 32 bytes, no length prefix.
Common Uses
- • Block hashes for querying historical state
- • Extrinsic hashes for tracking transactions
- • Storage root hashes for state verification
Fields (1)
| # | Name | Type |
|---|---|---|
| 0 | (unnamed) | [u8; 32] |
SCALE Encoding
- Rule
- Fixed 32 bytes — raw hash, no length prefix.
- Size
- 32 bytes
Examples
Block hash example = 0x91b1...
0x91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c391b171bb...70ce90c3 32 bytes of Blake2b-256 hash outputCode Examples
import { TypeRegistry } from "@polkadot/types";
const registry = new TypeRegistry();
// Encode H256
const value = registry.createType("H256", {
field: 0
});
console.log("Hex:", value.toHex());Referenced By (67)
#22 System::Event via Remarked.hash#22 System::Event via UpgradeAuthorized.code_hash#22 System::Event via RejectedInvalidAuthorizedUpgrade.code_hash#39 SubtensorModule::Event via ColdkeySwapAnnounced.new_coldkey_hash#39 SubtensorModule::Event via CRV3WeightsCommitted#39 SubtensorModule::Event via WeightsCommitted#39 SubtensorModule::Event via WeightsRevealed#39 SubtensorModule::Event via TimelockedWeightsCommitted#46 Vec<H256> #61 Preimage::Event via Noted.hash#61 Preimage::Event via Requested.hash#61 Preimage::Event via Cleared.hash#65 Proxy::Event via Announced.call_hash#74 Ethereum::Event via Executed.transaction_hash#97 Contracts::Event via CodeStored.code_hash#97 Contracts::Event via CodeRemoved.code_hash#97 Contracts::Event via ContractCodeUpdated.new_code_hash#97 Contracts::Event via ContractCodeUpdated.old_code_hash#97 Contracts::Event via DelegateCalled.code_hash#100 MevShield::Event via EncryptedSubmitted.id
and 47 more...
Type Information
- Type ID
- 13
- Kind
- Composite
- Path
- primitive_types::H256
- Runtime
- v393