• Returns the script under which ElectrumX indexes every operation on a name: OP_NAME_UPDATE <name> <empty value> OP_2DROP OP_DROP OP_RETURN.

    Pushes are written like ElectrumX's Script.push_data: a length byte, or OP_PUSHDATA1, OP_PUSHDATA2 or OP_PUSHDATA4 with the length, never a number opcode such as OP_5. A one-byte name therefore stays a push.

    A string is encoded as UTF-8 exactly as given. Names that look alike can differ byte for byte, so normalize a name that a user types the way your application registers names (for example with name.normalize('NFC')), and pass the bytes of a name read from a transaction unchanged.

    Parameters

    • name: string | Buffer

      The name, as bytes or as a string.

    Returns Buffer

    The index script.