VirtualMaster
TIP-1022 master registration utilities.
These utilities expose deterministic hashing and bounded salt mining helpers for
registerVirtualMaster(bytes32 salt) without introducing any extra hashing dependency.
Examples
import { Address, Hex } from 'ox'
import { VirtualMaster } from 'ox/tempo'
const registration = {
address: Address.from('0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266'),
salt: Hex.from('0x00000000000000000000000000000000000000000000000000000000abf52baf'),
}
const registrationHash = VirtualMaster.getRegistrationHash(registration) // keccak256(address || salt)
const masterId = VirtualMaster.getMasterId(registration) // bytes [4:8] of the hashFunctions
| Name | Description |
|---|---|
VirtualMaster.getMasterId | Derives the 4-byte TIP-1022 masterId from a master address and salt. |
VirtualMaster.getRegistrationHash | Computes the TIP-1022 registration hash for a master address and salt. |
VirtualMaster.mineSalt | Searches a bounded range of salts for the first value that satisfies TIP-1022 PoW. |
VirtualMaster.mineSaltAsync | Searches for a salt that satisfies TIP-1022 PoW using parallel workers and WASM-accelerated keccak256. |
VirtualMaster.validateSalt | Validates that a salt satisfies the TIP-1022 32-bit proof-of-work requirement. |
Types
| Name | Description |
|---|---|
VirtualMaster.Salt | A valid salt input for TIP-1022 master registration. |

