Skip to content

VirtualMaster.validateSalt

Validates that a salt satisfies the TIP-1022 32-bit proof-of-work requirement.

TIP-1022

Returns false for invalid master addresses, including the zero address, virtual addresses, and TIP-20 token addresses.

Imports

Named
import { VirtualMaster } from 'ox/tempo'

Examples

import { Address, Hex } from 'ox'
import { VirtualMaster } from 'ox/tempo'
 
const valid = VirtualMaster.validateSalt({
  address: Address.from('0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266'),
  salt: Hex.from('0x00000000000000000000000000000000000000000000000000000000abf52baf'),
})
 
valid
true

Definition

function validateSalt(
  value: validateSalt.Value,
): boolean

Source: src/tempo/VirtualMaster.ts

Parameters

value

  • Type: validateSalt.Value

Master address and salt.

Return Type

true if the first 4 bytes of the registration hash are zero.

boolean