visibleArgs

Encodes per-vault parameters as the script-pushable opcodes that go into a time lock vault's locking script.

"Visible" means these values sit in the locking script as cleartext pushes, unlike the constraint hash which only exposes a 20-byte commitment. Visibility is deliberate: the wallet reads them back at vault rediscovery time to determine which HD child key controls each vault, without needing to brute-force every possible index.

For time lock the args are always unlockValue, hdIndex:

  • unlockValue: the unlock value (block height, or Unix timestamp at/above the BIP-65 split) enforced by CHECKLOCKTIMEVERIFY in the template script.

  • hdIndex: the BIP-32 derivation index used to derive this vault's owner key from the wallet's HD account key.

Each value is encoded with OP.push, which picks the most compact form automatically: a single-byte C0–C16 opcode for values 0..16, or a length-prefixed script-number push for anything larger. The boundary matters in practice — the first 17 vaults a user creates (indices 0..16) use the compact form, while index 17 onwards switches to script-num. Unlock values are always large enough to take the script-num path.

The exact byte output ends up directly in the locking script and therefore in the vault address, so any change in encoding here breaks compatibility with vaults already on-chain.