• Creates a payment for a name output held by a Pay-to-Witness-Public-Key-Hash (P2WPKH) address.

    The name output is spent like the holder's P2WPKH output, so address, hash, pubkey, signature, input and witness work as in p2wpkh and are checked against the owner's script behind the name prefix. output is the whole name script; it is only set when it was passed in, because the name and its value cannot be derived from the other fields.

    Parameters

    • a: Payment

      The payment object. output, if given, must be a name script held by a P2WPKH address.

    • Optional opts: PaymentOpts

      Optional payment options.

    Returns Payment

    The payment object of the holder, with output set to the name script.

    Throws

    If output is not a name script held by a P2WPKH address, or if the other data does not match it.