Close Menu
  • Home
  • Altcoin
  • Bitcoin
  • Crypto
  • Forex
  • Online Money
What's Hot

fraud – Is it normal to be asked for an advance fee on a withdrawal?

October 11, 2025

How to Trade Long Tailed Pin Bar Signals on Daily Charts » Learn To Trade The Market

October 11, 2025

Google updates Misrepresentation policy for Shopping Ads and free listings

October 11, 2025
Facebook X (Twitter) Instagram
  • Altcoin
  • Bitcoin
  • Crypto
  • Forex
  • Online Money
Facebook X (Twitter) Instagram
Cointelegraphe
  • Home
  • Altcoin
  • Bitcoin
  • Crypto
  • Forex
  • Online Money
Cointelegraphe
Home»Bitcoin»The transaction history made to the address via the Electrum Testnet wallet is not displayed
The transaction history made to the address via the Electrum Testnet wallet is not displayed
Bitcoin

The transaction history made to the address via the Electrum Testnet wallet is not displayed

adminBy adminJuly 16, 2025No Comments3 Mins Read
Share
Facebook Twitter LinkedIn Pinterest Email


I am new to this business, so I apologize for such a possibly basic and stupid question, I tried to find any information, but I couldn’t.

I made a number of transfers to the address shown in the following example.

The transaction history made to the address via the Electrum Testnet wallet is not displayed

I also have these transfers in my history, and they are marked as successful. For reference, I made a transfer from my wallet to the address that is linked to my\wallet.

2

I also have a connection to the test network.

3

In the wallet, as shown, everything is there, everything is fine, but when you try to check the information of my address, there is nothing there.

Here I checked the address through a special site.

4


I wrote a small program to check the history of the address, balance, but nothing is displayed there.

Connecting to Electrum server...
Successfully connected to Electrum server.
Address: tb1qc7j5j80s02gupl0qa3svg5kr99smjdq9a7yezd
ScriptHash: bb72dcabbea723d56aa49cd29575e53aaabf832f9dbdb45f251b56e187ce915a
Raw history response: []
Fetching transaction history...
Found 0 transactions.
Total balance for tb1qc7j5j80s02gupl0qa3svg5kr99smjdq9a7yezd: 0 satoshis (0 BTC)
Current block height: 900621
Disconnected from Electrum server.

Here is the code of the program itself:

import * as bitcoin from 'bitcoinjs-lib';
import { ElectrumClient, ElectrumClientEvents } from '@electrum-cash/network';

const ELECTRUM_HOST = 'blackie.c3-soft.com';
const ADDRESS = 'tb1qc7j5j80s02gupl0qa3svg5kr99smjdq9a7yezd';
const NETWORK = bitcoin.networks.testnet;

function addressToElectrumScriptHash(address: string, network: bitcoin.Network): string | null {
  try {
    const outputScript = bitcoin.address.toOutputScript(address, network);
    const hash = bitcoin.crypto.sha256(outputScript);
    return Buffer.from(hash.reverse()).toString('hex');
  } catch (e) {
    console.error(`Failed to convert address ${address} to scripthash: ${e.message}`);
    return null;
  }
}

async function debugScripthashHistory(client: ElectrumClient<ElectrumClientEvents>, scriptHash: string) {
  try {
    const history = await client.request('blockchain.scripthash.get_history', scriptHash);
    console.log('Raw history response:', JSON.stringify(history, null, 2));
  } catch (error) {
    console.error('Error fetching raw history:', error.message);
  }
}

async function checkAddress() {
  const client = new ElectrumClient(
    'Address Checker',
    '1.4.1',
    ELECTRUM_HOST,
  );

  try {
    console.log('Connecting to Electrum server...');
    await client.connect();
    console.log('Successfully connected to Electrum server.');

    const scriptHash = addressToElectrumScriptHash(ADDRESS, NETWORK);
    if (!scriptHash) {
      console.error('Failed to generate scripthash for address.');
      return;
    }
    console.log(`Address: ${ADDRESS}`);
    console.log(`ScriptHash: ${scriptHash}`);
    await debugScripthashHistory(client, scriptHash);

    console.log('Fetching transaction history...');
    const historyResult = await client.request('blockchain.scripthash.get_history', scriptHash);
    if (historyResult instanceof Error) {
      console.error(`Error fetching history: ${historyResult.message}`);
      return;
    }
    if (!Array.isArray(historyResult)) {
      console.error('Unexpected history response:', historyResult);
      return;
    }

    const history = historyResult as { tx_hash: string; height: number }[];
    console.log(`Found ${history.length} transactions.`);

    let totalBalance = 0;
    for (const tx of history) {
      const txHash = tx.tx_hash;
      console.log(`Processing transaction: ${txHash} (Block height: ${tx.height})`);

      const txDataResult = await client.request('blockchain.transaction.get', txHash, true);
      if (txDataResult instanceof Error) {
        console.error(`Error fetching transaction ${txHash}: ${txDataResult.message}`);
        continue;
      }
      if (!txDataResult || typeof txDataResult !== 'object') {
        console.error(`Invalid transaction data for ${txHash}`);
        continue;
      }

      const txData = txDataResult as { vout: { value: string; scriptPubKey: { hex: string } }[] };
      const outputScriptHex = bitcoin.address.toOutputScript(ADDRESS, NETWORK).toString('hex');

      for (const vout of txData.vout) {
        if (vout.scriptPubKey.hex === outputScriptHex) {
          const amount = Math.round(parseFloat(vout.value) * 1e8); // Конвертация BTC в сатоши
          totalBalance += amount;
          console.log(`Found output to address: ${amount} satoshis`);
        }
      }
    }

    console.log(`Total balance for ${ADDRESS}: ${totalBalance} satoshis (${totalBalance / 1e8} BTC)`);

    const blockHeightResponse = await client.request('blockchain.headers.subscribe');
    if (blockHeightResponse && typeof blockHeightResponse === 'object' && 'height' in blockHeightResponse) {
      console.log(`Current block height: ${blockHeightResponse.height}`);
    }

  } catch (error) {
    console.error('Error during address check:', error.message);
  } finally {
    try {
      await client.disconnect();
      console.log('Disconnected from Electrum server.');
    } catch (e) {
      console.error('Error during disconnection:', e.message);
    }
  }
}

checkAddress().catch(console.error);



Source link

Address displayed electrum History testnet transaction wallet
Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
admin
  • Website

Related Posts

fraud – Is it normal to be asked for an advance fee on a withdrawal?

October 11, 2025

Analyst Predicts XRP Could Stand Among The ‘Greatest’ Assets In Modern History

October 9, 2025

Brazil’s OranjeBTC Goes Public, Boosts LATAM Bitcoin Push

October 8, 2025

Rally Fueled by ‘Perfect Storm,’ ETH, DOGE, BNB Surge

October 7, 2025
Add A Comment
Leave A Reply Cancel Reply

Top Insights

fraud – Is it normal to be asked for an advance fee on a withdrawal?

October 11, 2025

How to Trade Long Tailed Pin Bar Signals on Daily Charts » Learn To Trade The Market

October 11, 2025

Google updates Misrepresentation policy for Shopping Ads and free listings

October 11, 2025

MA Crosses MT4 Indicator – ForexMT4Indicators.com

October 10, 2025
ads

Subscribe to Updates

Get the latest creative news from Cointelegraphe about Crypto, bItcoin and Altcoin.

About Us
About Us

At CoinTelegraphe, we are dedicated to bringing you the latest and most insightful news, analysis, and updates from the dynamic world of cryptocurrency. Our mission is to provide our readers with accurate, timely, and comprehensive information to help them navigate the complexities of the crypto market.

Facebook X (Twitter) Instagram Pinterest YouTube
Top Insights

fraud – Is it normal to be asked for an advance fee on a withdrawal?

October 11, 2025

How to Trade Long Tailed Pin Bar Signals on Daily Charts » Learn To Trade The Market

October 11, 2025

Google updates Misrepresentation policy for Shopping Ads and free listings

October 11, 2025
Get Informed

Subscribe to Updates

Get the latest creative news from Cointelegraphe about Crypto, bItcoin and Altcoin.

Please enable JavaScript in your browser to complete this form.
Loading
  • About us
  • Contact Us
  • Shop
  • Privacy Policy
  • Terms and Conditions
Copyright 2024 Cointelegraphe Design By Horaam Sultan.

Type above and press Enter to search. Press Esc to cancel.