0
hello friends here is the code to find reuse R values of bitcoin transaction but unfortunately it is not scanning more than 51 transaction secondly it can only use one address at a time and i want to use text file to check multiple addresses as well as i want to save the output in a text file please help me to sort out 

import json

import urllib2

import time

import sys

#for some reason blockchain.info api-chain is 59711 blocks short..

blockstart = 170399

blockstart += 59711

blockcount = urllib2.urlopen("https://blockchain.info/de/q/getblockcount").read()

print "WELCOME TO R-scan v0.1.2!"

print "ADDRESS-R-SCAN: "

addr = raw_input("type address: ")

urladdr = "https://blockchain.info/de/rawaddr/" + str(addr)

#control api-url

print urladdr

addrdata = json.load(urllib2.urlopen(urladdr))

print "Data for pubkey: " + str(addr)

print "number of txs: " + str(addrdata['n_tx'])

#tx-details:

y = -0

inputs = []

while y < addrdata['n_tx']:

print "#################################################################################"

print "TX nr :" + str(y+1)

print "hash: " + str(addrdata['txs'][y]['hash'])

print "number of inputs: " + str(addrdata['txs'][y]['vin_sz'])

#only if

#if addrdata['txs'][y]['vin_sz'] > 1:

zy = 0

while zy < addrdata['txs'][y]['vin_sz']:

  print "Input-ScriptNR " + str(zy+1) + " :" + str(addrdata['txs'][y]['inputs'][zy]['script'])
  inputs.append(addrdata['txs'][y]['inputs'][zy]['script'])
  zy += 1

y += 1

print "compare: "

xi = 0

zi = 1

lenx = len(inputs)

alert = 0

#compare the sig values in each input script

while xi < lenx-1:

x = 0

while x < lenx-zi:

  if inputs[xi][10:74] == inputs[x+zi][10:74]:
      print "In Input NR: " + str(xi) + "[global increment] " + str(inputs[xi])
      print('\a')
                   print "Resued R-Value: "
      print inputs[x+zi][10:74]
                   alert += 1
  x += 1

zi += 1

xi += 1

#check duplicates

#alert when everything ok

if alert < 1:

print "Good pubKey. No problems."

sys.exit()

0

Use my code located here:

  • In your working directory (that you cd'd into) create an addr.txt containing your list of addresses separated by space or a newline.
  • Run it as python3 rscan.py 2>out.txt. It'll print the progress and if anything bad is found it'll be in out.txt in your working directory.
7
  • thank you very much sir! please tell me is there any script which can scan blockchain for specific signature – Muhammad Adnan Alam Jan 26 at 11:10
  • thank you very much sir! please tell me is there any script which can scan blockchain for specific signature – Muhammad Adnan Alam Jan 26 at 11:10
  • This script collects all signatures from an address and checks for all matches. If it isn't, what do you specifically need? – MCCCS Jan 26 at 11:22
  • the script scan the entire blockchain and search for the signatures and find the match of given signature input – Muhammad Adnan Alam Jan 26 at 11:27
  • I don't have it, maybe you can ask about it in a new question? It sounds difficult to code since block explorers don't index by signature – MCCCS Jan 26 at 11:45

Not the answer you're looking for? Browse other questions tagged or ask your own question.