Monday, 11 December 2017

How to track your bitcoin transaction from @hashflare

Hello!

I'm pretty new to Bitcoin hype and I don't consider myself an expert in this area. Like most of you reading this blog post, you have probably invested some money in cloud mining at hashflare.io. But the recent problem of slow Bitcoin withdrawals from Hashflare, not really related to Hashflare at all but to Bitcoin network congestion (see here), has made me to use my experience as a long time system engineer to try and find out when will my transaction be confirmed. 

I have created a withdrawal request on December 6th and till this day (December 11th), my transaction is still unconfirmed (see here).

According to Hashflare, they use block.io to broadcast the transaction (withdrawals) to Bitcoin network. You can follow the status of your transaction at chain.so. But if you try to find your transaction on some web pages such as blockchain.info, there is no transaction. The problem is that every transaction has a reference transaction, or receive_from txid. If this transaction has not been confirmed too, then no transaction that references this transaction can be broadcasted to the Bitcoin network. Receive_from transactions must be written to block (confirmed) so that Bitcoin network nodes will accept new transactions that reference other confirmed transactions for confirmations.

To track confirmations of referenced transactions I have wrote a script to see how long is the "chain of transactions" that are being referenced in each transaction. It's a simple powershell script that calls REST API interface of chain.so. Just type in your txid and run the script. The small problem with the REST API is that it can only be called 10 times during 60 seconds. So if your transaction chain is really long, couple of thousands of transactions, it can take a couple of hours. The script runs until it reaches the last confirmed transaction in the chain and outputs the referenced transaction count as well as txids of all referenced transactions.



Here is the script. Just save it in a file, something like 'track transaction chain.ps1', change the $txid variable at the bottom of the script and run the file.

function AnalyzeInput($txid)
{
    $txdata=(Invoke-RestMethod -Uri https://chain.so/api/v2/tx/BTC/$txid).data
    if($txdata.confirmations -eq 0)
    {
        Write-Host "Transaction ID:$($txdata.txid)"
        Write-Host "Confirmations:$($txdata.confirmations) Count=$counter Inputs=$(($txdata.inputs).Count))"
        $i=0
        foreach($input in ($txdata).inputs)
        {
            $txid=($txdata).inputs[$i].received_from.txid
            $i++
            $counter=$counter+1
            Start-Sleep 6
            AnalyzeInput($txid)
        }
    }
    else
    {
        Write-Host "Transaction ID:$($txdata.txid)" -ForegroundColor Green
        Write-Host "Confirmations:$($txdata.confirmations)" -ForegroundColor Green
    }
}

$txid="ccc958d745ddbd7cd10ba6a38454979aef2e61b0dda398e9ceff617c0631980a"
$counter=0
AnalyzeInput $txid

Happy mining! :)

8 comments:

  1. Thanks for your posting
    I have a one question:
    It means that before either transaction is not confirmed, my transactionwill not confirm also?
    best wishes, Igor.

    Sorry for mistakes, English is not my native language)

    ReplyDelete
  2. Replies
    1. It tracks where in the queue is your transaction and gives you an estimate on how long to wait till it gets confirmed.

      Delete
  3. For example, can you explane this screenshot?))

    https://ibb.co/kWgbh6

    ReplyDelete
    Replies
    1. Some transactions have multiple inputs which means there are multiple chain branches. What is listed here are all confirmed transactions in all branches. The number 1271 is what you need to remember, when you run the script again the number should get smaller.

      Delete
    2. Thanks for reply, i was nervous for several days)
      I cannot understand, why I not see my transaction on blockchain.info?!///

      Delete
  4. The problem is that every transaction has a reference transaction, or receive_from txid. If this transaction has not been confirmed too, then no transaction that references this transaction can be broadcasted to the Bitcoin network. But the other ICO's listed here https://icopulse.com/ico-list on ICO Pulse sites are easy to use.

    ReplyDelete