// create a new p2pkh paying to a specific address var address = Address.fromString('1NaTVwXDDUJaXDQajoa9MqHhz4uTxtgK14'); var script = Script.buildPublicKeyHashOut(address); assert(script.toString() === 'OP_DUP OP_HASH160 20 0xecae7d092947b7ee4998e254aa48900d26d2ce1d OP_EQUALVERIFY OP_CHECKSIG');