Bitcoin Forum
April 21, 2019, 07:22:19 AM *
News: Latest Bitcoin Core release: 0.17.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 2 3 4 5 6 [7] 8 »  All
  Print  
Author Topic: [ANN] chainsnort (live transaction monitoring and fingerprinting tool)  (Read 24275 times)
flatfly
Legendary
*
Offline Offline

Activity: 1022
Merit: 1002


View Profile
January 30, 2015, 08:03:28 PM
 #121

Can this be added to Bitcoin-ncurses?

Haven't heard of Bitcoin-ncurses - will look it up!

1111127SpvabYpoeDoiz5L7QPkfiSh2Q. Only donate if you have a reason to.
100% New Software
PC, Mac, Android, & HTML5 Clients
Krill Rakeback
Low Rake
Bitcoin Poker 3.0
Bad Beat Jackpot
SwC Poker Relaunch
PLAY NOW
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1555831339
Hero Member
*
Offline Offline

Posts: 1555831339

View Profile Personal Message (Offline)

Ignore
1555831339
Reply with quote  #2

1555831339
Report to moderator
1555831339
Hero Member
*
Offline Offline

Posts: 1555831339

View Profile Personal Message (Offline)

Ignore
1555831339
Reply with quote  #2

1555831339
Report to moderator
bitpop
Legendary
*
Offline Offline

Activity: 2464
Merit: 1045


https://keybase.io/bitpop


View Profile WWW
January 30, 2015, 08:18:38 PM
 #122

Can this be added to Bitcoin-ncurses?

Haven't heard of Bitcoin-ncurses - will look it up!

It's awesome to check on my node, but it's missing live transactions

Reputation  |  PGP  |  DigitalOcean  |  TorGuard  |  Ethereum Classic
Bitcoin: 3DSh6AnmvBpDJFUz2mnLirMLmTMcFs9nDm
Bitmessage: BM-2cXN9j8NFT2n1FxDVQ6HQq4D4MZuuaBFyb
flatfly
Legendary
*
Offline Offline

Activity: 1022
Merit: 1002


View Profile
January 30, 2015, 08:29:08 PM
 #123


A little screenshot of the latest windows build, highlighting a large multisig transaction:





Also, starting today I will be experimenting a new funding model and see if it's sustainable:
  
  • on odd-numbered weeks, the latest stable Windows build for chainsnort can be obtained at no cost - just PM me for the download link
     
  • on even-numbered weeks, the download will cost 0.255 BTC - send the transaction and PM me for the download link


Hopefully the revenue will help cover part of my development time.


1111127SpvabYpoeDoiz5L7QPkfiSh2Q. Only donate if you have a reason to.
bitpop
Legendary
*
Offline Offline

Activity: 2464
Merit: 1045


https://keybase.io/bitpop


View Profile WWW
January 30, 2015, 08:33:26 PM
 #124

I have a business idea for you. Traders would pay to see large transactions entering and leaving exchanges.

Reputation  |  PGP  |  DigitalOcean  |  TorGuard  |  Ethereum Classic
Bitcoin: 3DSh6AnmvBpDJFUz2mnLirMLmTMcFs9nDm
Bitmessage: BM-2cXN9j8NFT2n1FxDVQ6HQq4D4MZuuaBFyb
Sukrim
Legendary
*
Offline Offline

Activity: 2478
Merit: 1002


View Profile
January 31, 2015, 09:59:46 AM
 #125

Exchanges don't publish lists of addresses they hold, this would make them easily auditable.

https://www.coinlend.org <-- automated lending at various exchanges. No fees(!).
Mail me at Bitmessage: BM-BbiHiVv5qh858ULsyRDtpRrG9WjXN3xf
Balloon
Newbie
*
Offline Offline

Activity: 9
Merit: 0


View Profile
February 27, 2015, 06:24:33 PM
 #126

Very useful code!

One question though. I wrote my own version which basically just takes in any unconfirmed transaction and write it to a file. And I also tried the json API provided by blockchain.info.
***
https://blockchain.info/unconfirmed-transactions?format=json
***
What surprises me is that websocket missed several transactions. Is there any way to make sure that the websocket API will return ALL unconfirmed transactions?

Balloon
bitpop
Legendary
*
Offline Offline

Activity: 2464
Merit: 1045


https://keybase.io/bitpop


View Profile WWW
February 27, 2015, 06:30:45 PM
 #127

Very useful code!

One question though. I wrote my own version which basically just takes in any unconfirmed transaction and write it to a file. And I also tried the json API provided by blockchain.info.
***
https://blockchain.info/unconfirmed-transactions?format=json
***
What surprises me is that websocket missed several transactions. Is there any way to make sure that the websocket API will return ALL unconfirmed transactions?

Balloon

I doubt it, it's not meant to be a reliable api, you'll have to roll your own node possibly with that bitpay software

Reputation  |  PGP  |  DigitalOcean  |  TorGuard  |  Ethereum Classic
Bitcoin: 3DSh6AnmvBpDJFUz2mnLirMLmTMcFs9nDm
Bitmessage: BM-2cXN9j8NFT2n1FxDVQ6HQq4D4MZuuaBFyb
BootstrapCoinDev
Full Member
***
Offline Offline

Activity: 154
Merit: 100



View Profile WWW
March 06, 2015, 12:31:51 PM
 #128

Exchanges don't publish lists of addresses they hold, this would make them easily auditable.
You can verify whether the address belong to exchange or no by dint of big transactions with huge number of inputs. No software required.

lissacoffey
Newbie
*
Offline Offline

Activity: 5
Merit: 2


View Profile WWW
March 06, 2015, 12:44:56 PM
Last edit: September 20, 2017, 10:01:21 AM by lissacoffey
 #129

Blockchain.info uses a special system that doesn't involve Python (as far as we know), they're most likely using a modified node that notifies them of transactions.

The easy way

Just use Blockchain.info's transaction notification service. Their web sockets api lets anyone subscribe to any bitcoin address
The hard way

If you want to listen to all latest transactions, and not to addresses you own, you're going to need more in depth control. Otherwise use Bitcoind and its wallet notify parameter. Check out PyNode, a Bitcoin node implementation in Python.

Thanks
Lissa
http://driverrestore.com/
bitpop
Legendary
*
Offline Offline

Activity: 2464
Merit: 1045


https://keybase.io/bitpop


View Profile WWW
March 08, 2015, 10:19:54 AM
 #130

Can someone help me with a little tut for linux, im new with linux


Just copy and paste into a terminal:

1/ curl -o websocket.py https://raw.github.com/liris/websocket-client/master/websocket.py

2/ curl -o chainsnort.py https://gist.github.com/flatfly/8253870/raw/9733e34e469e1bcd8d0ae13565ade4eaa0490618/gistfile1.py

3/ python chainsnort.py

Reputation  |  PGP  |  DigitalOcean  |  TorGuard  |  Ethereum Classic
Bitcoin: 3DSh6AnmvBpDJFUz2mnLirMLmTMcFs9nDm
Bitmessage: BM-2cXN9j8NFT2n1FxDVQ6HQq4D4MZuuaBFyb
Newar
Legendary
*
Offline Offline

Activity: 1358
Merit: 1000


https://gliph.me/hUF


View Profile
March 08, 2015, 10:50:10 AM
 #131

it said: bash: 1/: No such file or directory

Code:
curl -o websocket.py https://raw.github.com/liris/websocket-client/master/websocket.py

curl -o chainsnort.py https://gist.github.com/flatfly/8253870/raw/9733e34e469e1bcd8d0ae13565ade4eaa0490618/gistfile1.py

python chainsnort.py

OTC rating | GPG keyid 1DC91318EE785FDE | Gliph: lightning bicycle tree music | Mycelium, a swift & secure Bitcoin client for Android | LocalBitcoins
Newar
Legendary
*
Offline Offline

Activity: 1358
Merit: 1000


https://gliph.me/hUF


View Profile
March 08, 2015, 11:12:53 AM
 #132

Sorry, that websocket link is broken. curl -o didn't work either anymore for me. Try:
Code:
git clone https://github.com/liris/websocket-client.git

cd websocket-client

python setup.py install

wget https://gist.github.com/flatfly/8253870/raw/9733e34e469e1bcd8d0ae13565ade4eaa0490618/gistfile1.py

python gistfile1.py


OTC rating | GPG keyid 1DC91318EE785FDE | Gliph: lightning bicycle tree music | Mycelium, a swift & secure Bitcoin client for Android | LocalBitcoins
lutinus
Newbie
*
Offline Offline

Activity: 8
Merit: 0


View Profile
March 14, 2015, 11:28:53 PM
 #133

Sorry, that websocket link is broken. curl -o didn't work either anymore for me. Try:
Code:
git clone https://github.com/liris/websocket-client.git

cd websocket-client

python setup.py install

wget https://gist.github.com/flatfly/8253870/raw/9733e34e469e1bcd8d0ae13565ade4eaa0490618/gistfile1.py

python gistfile1.py



I get this :

 # python setup.py install
Traceback (most recent call last):
  File "setup.py", line 1, in <module>
    from setuptools import setup
ImportError: No module named setuptools

OS : Debian GNU/Linux 7

Any idea please ?
bitpop
Legendary
*
Offline Offline

Activity: 2464
Merit: 1045


https://keybase.io/bitpop


View Profile WWW
May 16, 2015, 09:30:30 AM
 #134

Adding to ncurses would be awesome

https://github.com/azeteki/bitcoind-ncurses/issues/15

Reputation  |  PGP  |  DigitalOcean  |  TorGuard  |  Ethereum Classic
Bitcoin: 3DSh6AnmvBpDJFUz2mnLirMLmTMcFs9nDm
Bitmessage: BM-2cXN9j8NFT2n1FxDVQ6HQq4D4MZuuaBFyb
bitpop
Legendary
*
Offline Offline

Activity: 2464
Merit: 1045


https://keybase.io/bitpop


View Profile WWW
June 22, 2015, 05:00:28 PM
 #135

So it's gone?

Reputation  |  PGP  |  DigitalOcean  |  TorGuard  |  Ethereum Classic
Bitcoin: 3DSh6AnmvBpDJFUz2mnLirMLmTMcFs9nDm
Bitmessage: BM-2cXN9j8NFT2n1FxDVQ6HQq4D4MZuuaBFyb
gregwtmtno
Member
**
Offline Offline

Activity: 77
Merit: 10



View Profile
September 19, 2015, 11:20:44 AM
 #136

Does anyone have a copy of the code? I'm trying to build something similar.
Newar
Legendary
*
Offline Offline

Activity: 1358
Merit: 1000


https://gliph.me/hUF


View Profile
September 19, 2015, 12:17:30 PM
Last edit: September 19, 2015, 01:03:11 PM by Newar
 #137

Does anyone have a copy of the code? I'm trying to build something similar.

I thought I did, but turns out I didn't  Undecided . All I can find for gistfile1.py (posted Jul 6, 2015): https://www.snip2code.com/Snippet/576729/chainsnort-0-484--latest_stable-

I gave it a quick go and after creating an empty file called prefixes.txt, it seems to work ok.

flatfly was last active on August 01, 2015, so until he comes back I put it on github as a backup. You can get it using:
Code:
wget https://raw.githubusercontent.com/Newar417/flatfly_archived_chainsnort/master/gistfile1.py

Code from snip2code:
Code:
import json, os, sys, datetime, time, urllib, websocket, operator, random, re
from colorama import Fore, Style, init   ; init()
  
t0 = time.time() ; Z = 0 ; nboutputs = 0 ; nbinputs = 0
VERBOSE = 1

print 'chainsnort v0.484: ' ,
os.system('title chainsnort_inspect [mainnet]')
matches = open('prefixes.txt').read().split()
matches2 = ['111111','XXXXXX']  

mini_easter_egg = ['** THANKS! **    (' +chr(3)+ ' _ ' +chr(3)+ ')        ','** PEACE! **     (^ _ ^)        ']


class Plex(object):
    def __init__(self, name):
        self.file = open(name, 'w')
        self.stdout = sys.stdout
        sys.stdout = self
    def __del__(self):
        sys.stdout = self.stdout
        self.file.close()
    def write(self, data):
    
        self.stdout.write(data)
        data=data.replace(chr(8),'')
        data=data.replace(chr(0x1B),'')
        data=re.sub('\[.*m','',data)
        # data=re.sub('\t ','X', data)

        self.file.write(data)


def main():
  global Z, btcseen
  btcseen = 0
  
  while (1):
    bigtag = '  '
    result = ws.recv()
    time.sleep(0.05)
    result = json.loads(result)
    if result['op'] == 'block' :
      print
      reward = result['x']['reward']/1e8  
      print datetime.datetime.utcnow().strftime("%H:%M:%S.%f")[:-3] , bigtag + ' {:11.4f}'.format(reward) ,'B  [NEW BLOCK SOLVED] ' ,
      print Fore.CYAN+Style.BRIGHT + str(result['x']['height']) + Fore.RESET+Style.NORMAL
      print
      continue
   
    inputs = sum(p['prev_out']['value'] for p in result['x']['inputs']  )
    outputs = sum(p['value'] for p in result['x']['out']  )
    feepaid = (inputs-outputs)/1e8
    val = sum(p['value'] for p in result['x']['out'])/1e8
    btcseen = btcseen + val

    if val >= 50:
     if val >= 5000:
      print '\a' ,
     bigtag = Fore.GREEN+Style.BRIGHT + '>>' #  + chr(16)*2
     time.sleep(0.3)

    feetag = ''
    if feepaid < 0.0001 or feepaid >= 0.01:  
     feetag = Fore.YELLOW+Style.BRIGHT

    if VERBOSE == 0:
        max_addr = sorted(result['x']['out'], key=operator.itemgetter('value'), reverse=True)[0]['addr']
        for ku in result['x']['out']:
         if any(s in ku['addr'] for s in matches):
           max_addr =  Fore.MAGENTA+Style.BRIGHT + max_addr + Fore.RESET+Style.NORMAL
            
        print '\b'+ datetime.datetime.utcnow().strftime("%H:%M:%S.%f")[:-3], bigtag + ' {:11.4f}'.format(val) ,'B '  + Fore.RESET+Style.NORMAL , max_addr , '\t' , feetag ,  '\b'*6 + '{:12.8f}'.format(feepaid) + Fore.RESET+Style.NORMAL
  
    if VERBOSE == 1:
       nboutputs = 0 ; nbinputs = 0
 
       for ki in result['x']['inputs']:
           print ' '.ljust(30) , 'i', ki['prev_out']['addr']
           nbinputs += 1
       for ku in result['x']['out']:
           print ' '.ljust(30) , 'o', ku['addr']
           nboutputs += 1

       txcat =  ''  
       if any(s['prev_out']['addr'] in ku['addr'] for s in result['x']['inputs']):    
           txcat = '[WEB_SPEND]'
       if nboutputs > 2:
    txcat = '[AUTOMATED_PAYMENT]'
  if (nboutputs > 20) & (nbinputs == 1):
      txcat = '[FAUCET_PAYMENT]'
      if val >= 0.2:
          txcat = '[MIXER]'
      if val >= 20:
          txcat = '[MININGPOOL_PAYMENT]'
       if (val >= 50) & (nbinputs == 1):
    txcat = '[COLDSTORAGE_MOVE]'
       if (val <= 0.0011) & (nbinputs == 1):
    txcat = '[MICROTRANSACTION]'  
       if (nboutputs == 1) & (nbinputs == 1):
    txcat = '[ADDRESS_SWEEP]'
       if (nboutputs == 1) & (nbinputs > 1):
    txcat = '[ADDRESS_CONSOLIDATION]'      
       if txcat == '':  
           txcat = '[NATIVE_SPEND]'
       for ku in result['x']['out']:
           if any(s in ku['addr'] for s in matches) | ('1Lucky' in result['x']['inputs'][0]) :    # to fix
               txcat +=    ' [ONCHAIN_GAMING]'           # or in inputs as well
               break
       for ku in result['x']['out']:
           if any(s in ku['addr'] for s in matches2):
               txcat = '[COIN_DESTRUCTION]'      # also add DONATION
               break
       for ku in result['x']['out']:
           if ku['value'] < 546:  
               txcat = '[ILLEGAL]'
               break              
       for ku in result['x']['out']:
           if ku['value'] == 7800:
               if (nboutputs == 3):  
                  txcat = '[XCP_OP]'
               # print '\a'
               break  

       for ku in result['x']['out']:
           if ku['addr'][0] == '3':  
               txcat = Fore.CYAN+Style.BRIGHT + '[MULTISIG]'
               break
                
       print 'Transaction:   ' + result['x']['hash']

       print '\b'+ datetime.datetime.utcnow().strftime("%H:%M:%S.%f")[:-3], bigtag + ' {:11.4f}'.format(val) ,'B '  + Fore.RESET+Style.NORMAL , Fore.RESET+Style.BRIGHT + txcat.ljust(32) + Fore.RESET+Style.NORMAL , ' ', feetag , '{:12.8f}'.format(feepaid) + Fore.RESET+Style.NORMAL
 
    Z += 1 ; print
 
try:
  sys.tracebacklimit = 0
  domain='blockchain.info'
  stat = int(urllib.urlopen('https://'+domain+'/q/24hrtransactioncount').read().decode("utf8"))
  print Fore.CYAN+Style.BRIGHT + '\b' + str(stat)  + Fore.RESET+Style.NORMAL +  ' new transactions in the last 24 hours  -  ' + Fore.CYAN+Style.BRIGHT  + '%02.02f' % (stat/86400.0) + Fore.RESET+Style.NORMAL + ' tx/sec'
  # print '\nEstablishing TLS tunnel...',  
  print '\nCapturing transactions on mainnet...  (Fingerprinting enabled)\r',  
  ws = websocket.create_connection("wss://ws."+domain+"/inv")
  ws.send('{"op":"unconfirmed_sub"}')  ;
  ws.send('{"op":"blocks_sub"}')
  # print 'Done. Waiting for new transactions...\r',
  
  if '-o' in sys.argv:
       Plex('../../../Log/txtrace.log')      
  
  time.sleep(0.3)
  main()
      
except KeyboardInterrupt:
  t1 = time.time()
  print
  print 'Closing threads... Done.'
  print 'Captured',Z, 'events - Transaction density: %02.02f' % (Z/(t1 - t0)) , 'tx/sec - Coins moved:' + ' {:5.4f}'.format(btcseen)
  sys.exit()


OTC rating | GPG keyid 1DC91318EE785FDE | Gliph: lightning bicycle tree music | Mycelium, a swift & secure Bitcoin client for Android | LocalBitcoins
gregwtmtno
Member
**
Offline Offline

Activity: 77
Merit: 10



View Profile
September 19, 2015, 11:59:29 PM
 #138

Thanks a ton, Newar. God, this code is so much simpler than the Rust I'm doing my version in.
azeteki
Member
**
Offline Offline

Activity: 96
Merit: 10

esotericnonsense


View Profile WWW
May 09, 2016, 03:25:31 PM
 #139

Hello,

I've been playing around recently with adding this functionality to my bitcoind front-end.

Those of you who aren't running full nodes will not find this useful. However, if you do have a full node, you can do all of this locally without external API requests. It may even be faster (I have not tested chainsnort, so I do not know.)

https://github.com/esotericnonsense/bitcoind-ticker

At the moment this is just a proof of concept and does the absolute bare minimum required. No highlighting or anything fancy, just spews out transactions to the terminal. The idea is there though.

frogCorporation
Full Member
***
Offline Offline

Activity: 126
Merit: 100



View Profile
May 09, 2016, 07:31:07 PM
 #140


Very cool now we have a look and evaluate mainly under Linux
Pages: « 1 2 3 4 5 6 [7] 8 »  All
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!