#!/usr/bin/php parse($btc, $row['xpub'])->derivePath($row['leaf'].$row['idx']); $address = $addrKey->getAddress($addrCreator)->getAddress($btc);*/ $address = getAddress($row['xpub'], $row['leaf'].$row['idx']); echo("computed address: ".$address."\n"); //print_r($addrKey); /* //print_r($row); $txs = db_query("SELECT * FROM txs JOIN txos ON ( txos.create_txid_id = txs.txid_id OR txos.destroy_txid_id = txs.txid_id ) JOIN txids USING ( txid_id ) WHERE scriptpubkey_id = ?", $row['scriptpubkey_id']); $status = ''; foreach ($txs as $tx) { $status .= $tx['txid'].':'.$tx['tx_height'].':'; } echo("status=$status, status_hash=".hash('sha256', $status)."\n"); */ $scripthash_status = compute_scripthash_status($row['scriptpubkey_id']); echo("computed scripthash_status=$scripthash_status\n"); $rwsh = getReverseScriptHash($address); $json = rpc_electrum('blockchain.scripthash.subscribe', $rwsh); echo("received scripthash_status=$json\n"); echo(bin2hex(getScriptPubKey($address))."\n"); $rwsh2 = bin2hex(strrev(hash('sha256', getScriptPubKey($address), true))); echo("rwsh=$rwsh\n"); echo("rwsh2=$rwsh2\n"); exit; } //echo(getReverseScriptHash('1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa')."\n"); ?>