Exemplo n.º 1
0
def Mokestis():
    p = RawProxy()
    #txidd = input("Iveskite transakcija")
    #txid = str(txidd)
    txid = '0627052b6f28912f2703066a912ea577f2ce4da4caa5a5fbd8a57286c345c2f2'
    raw_tx = p.getrawtransaction(txid)
    decoded_tx = p.decoderawtransaction(raw_tx)

    sumIn = 0
    sumOut = 0
    for output in decoded_tx['vin']:
        vinTxId = output['txid']
        raw_vintx = p.getrawtransaction(vinTxId)
        decoded_vintx = p.decoderawtransaction(raw_vintx)
        vin_vout = output['vout']
        for out in decoded_vintx['vout']:
            if (out['n'] == vin_vout):
                sumIn += out['value']

    for output in decoded_tx['vout']:
        sumOut += output['value']

    tx_fee = sumIn - sumOut
    print("Transakcijos: ", txid)
    print("mokestis: ", tx_fee, "BTC")
Exemplo n.º 2
0
def get_utxo(index, txid):
    p = RawProxy()
    raw_tx = p.getrawtransaction(txid)
    decoded_tx = p.decoderawtransaction(raw_tx)
    outputs = decoded_tx['vout']
    utxo = outputs[index]
    return utxo['value']
Exemplo n.º 3
0
def search_for_transaction_by_txid(txid):
    p = RawProxy()
    try:
        transaction_info = p.getrawtransaction(txid, True)
        transaction_info['resulttype'] = 'transaction'
        return transaction_info
    except:
        return None
Exemplo n.º 4
0
def Brangiausia():
    p = RawProxy()
    txid = "4410c8d14ff9f87ceeed1d65cb58e7c7b2422b2d7529afc675208ce2ce09ed7d"
    raw_tx = p.getrawtransaction(txid)
    decoded_tx = p.decoderawtransaction(raw_tx)

    sumIn = 0
    sumOut = 0
    for output in decoded_tx['vin']:
        vinTxId = output['txid']
        raw_vintx = p.getrawtransaction(vinTxId)
        decoded_vintx = p.decoderawtransaction(raw_vintx)
        vin_vout = output['vout']
        for out in decoded_vintx['vout']:
            if (out['n'] == vin_vout):
                sumIn += out['value']

    for output in decoded_tx['vout']:
        sumOut += output['value']

    tx_fee = sumIn - sumOut
    print("Transakcijos: ", txid)
    print("mokestis: ", tx_fee, "BTC")
Exemplo n.º 5
0
def checkTrans():
    transValue = 0

    transId = raw_input("Enter transaction Id: ")

    p = RawProxy()

    trans = p.decoderawtransaction(p.getrawtransaction(transId))

    for outputTrans in trans['vin']:

        transIdLocal = outputTrans['txid']
        vout = outputTrans['vout']
        transLocal = p.decoderawtransaction(p.getrawtransaction(transIdLocal))

        for outputTransLocal in transLocal['vout']:

            if outputTransLocal['n'] == vout:
                transValue = transValue + outputTransLocal['value']

    for output in trans['vout']:
        transValue = transValue - output['value']

    print(transValue)
Exemplo n.º 6
0
def find_transaction_fee():
    p = RawProxy()
    print('Iveskite pasirinktos transakcijos id')
    txid = input_txid()
    txinval = 0
    txoutval = 0
    try:
        raw_tx = p.getrawtransaction(txid)
    except Exception as e:
        logging.error(traceback.format_exc())
        globals.control = 0
        return
    decoded_tx = p.decoderawtransaction(raw_tx)
    vins = decoded_tx['vin']
    vouts = decoded_tx['vout']
    for input in vins:
        txinval = txinval + get_utxo(input['vout'], input['txid'])
    for output in vouts:
        txoutval = txoutval + output['value']
    globals.control = 0
    print('Transakcijos kaina:')
    print(f'{txinval - txoutval} BTC')
    return
Exemplo n.º 7
0
from bitcoin.rpc import RawProxy

p = RawProxy()

trx = raw_input("Enter the ID of transaction: ")

# Uncomment the following line if need to check the special transaction.
# trx = "4410c8d14ff9f87ceeed1d65cb58e7c7b2422b2d7529afc675208ce2ce09ed7d"

# Gets raw trx in hex
rawTrx = p.getrawtransaction(trx)

# Decodes trx into a JSON object
decodedTrx = p.decoderawtransaction(rawTrx)

sumIn = 0
sumOut = 0

for input in decodedTrx['vin']:
    vinTrxId = input['txid']
    rawVinTrx = p.getrawtransaction(vinTrxId)
    decodedVinTrx = p.decoderawtransaction(rawVinTrx)
    vinOut = input['vout']
    for output in decodedVinTrx['vout']:
        if (vinOut == output['n']):
            sumIn = sumIn + output['value']

for output in decodedTrx['vout']:
    sumOut = sumOut + output['value']

print(sumIn - sumOut)
Exemplo n.º 8
0
import pprint
pp = pprint.PrettyPrinter(indent=1)

# Bitcoin Core에 접속한다.
p = RawProxy()

# MemPool에 있는 Tx 개수를 확인한다
mem = p.getmempoolinfo()
print("\n\nNumber of Tx :", mem['size'])

# MemPool에 있는Txid를 조회한다.
memTxid = p.getrawmempool()

# MemPool에 있는 Tx 데이터 10개 만 상세 데이터를 조회한다.
i = 0
for tx in memTxid:
    # MemPool에 있는 Txid의 상세 데이터를 읽어온다.
    memTx = p.getmempoolentry(tx)
    rawTx = p.getrawtransaction(tx)
    print("\nTXID :", tx)
    pp.pprint(memTx)
    print("\nRaw TX :")
    print(rawTx)
    i += 1
    if i > 10:
        break

# rawTx 데이터를 decode 한다
dTx = p.decoderawtransaction(rawTx)
print("\n\n")
pp.pprint(dTx)
Exemplo n.º 9
0
# 마지막 블록을 읽어온다
height = tip[0]['height']
bHash = tip[0]['hash']
block = p.getblock(bHash)

# 마지막 블록의 Tx를 읽는다.
nTx = len(block['tx'])
    
# Tx를 차례대로 읽어가면서 Fee를 계산한다. (Coinbase Tx는 제외)
txFee = []
byteFee = []
accByteFee = []
cnt = 0
for i in range(1, nTx):
    txid = block['tx'][i]
    tx = p.getrawtransaction(txid, True)
    
    # total Input value를 계산한다
    nIn = len(tx['vin'])
    inValue = 0
    for j in range(0, nIn):
        inValue += getUtxo(tx['vin'][j]['txid'], tx['vin'][j]['vout'])
        
    # total output value를 계산한다
    nOut = len(tx['vout'])
    outValue = 0
    for k in range (0, nOut):
        outValue += tx['vout'][k]['value']
    
    # Fee를 계산한다
    fee = (inValue - outValue) * 100000000
Exemplo n.º 10
0
from bitcoin.rpc import RawProxy

p = RawProxy()

txid = "0627052b6f28912f2703066a912ea577f2ce4da4caa5a5fbd8a57286c345c2f2"

raw_tx_in_hex = p.getrawtransaction(txid)

decoded_tx = p.decoderawtransaction(raw_tx_in_hex)

# print out

for data in decoded_tx['vout']:
    print(data['scriptPubKey']['addresses'], data['value'])
Exemplo n.º 11
0
import sys
sys.path.insert(0, '/Users/ellemouton/Documents/2019/EEE4022S/code/modules')
from io import BytesIO
from bitcoin.rpc import RawProxy
import tx
from tx import Tx


def is_unspent(txid, index, proxy):
    return proxy.gettxout(txid, index)==None


p = RawProxy(service_port = 18332)
tx_id = sys.argv[1]
raw_tx = bytes.fromhex(p.getrawtransaction(tx_id))
stream = BytesIO(raw_tx)
tx = Tx.parse(stream, testnet = True)

print(tx)

print('****** Starting Validation of the Tx ******')

#1: Checking spentness of the inputs. If checking an existing tx then all should be True (all spent)
for i, tx_in in enumerate(tx.tx_ins, start = 0):
    print("Spentness of input "+str(i)+": "+str(is_unspent(tx_in.prev_tx.hex(),tx_in.prev_index, p)))


#2: Checkthe sum of the inputs vs outputs (ie that fee is non negative)
print("Fee is positive: "+str(tx.fee()>=0))

#3: Checking the signiture
Exemplo n.º 12
0
from bitcoin.rpc import RawProxy

p = RawProxy()

txid = str(raw_input("Enter transaction ID: "))

decoded_tx = p.decoderawtransaction(p.getrawtransaction(txid))

total_out = 0
for output in decoded_tx['vout']:
    total_out += output['value']
    
total_in = 0
for input in decoded_tx['vin']:
    out_index = input['vout']
    input_tx = p.getrawtransaction(input['txid'])
    decoded_input_tx = p.decoderawtransaction(input_tx)
    total_in += decoded_input_tx['vout'][out_index]['value']
    
print("Total input: %f" % total_in)
print("Total output: %f" % total_out)

fee = total_in - total_out
print("Fee: %f" % fee)

Exemplo n.º 13
0
# `pc_transaction.py` example
from bitcoin.rpc import RawProxy

p = RawProxy()  #sujungimas

# Pavyzdinis ID: "4410c8d14ff9f87ceeed1d65cb58e7c7b2422b2d7529afc675208ce2ce09ed7d"
txid = input("Iveskite transakcijos ID\n")

# First, retrieve the raw transaction in hex - is pavyzdzio visa tranzakcijos info
raw_tx = p.getrawtransaction(txid)

# Decode the transaction hex into a JSON object - is pavyzdzio
decoded_tx = p.decoderawtransaction(raw_tx)

i_sum = []  #saugojimo kintamasis
what_got = 0
# Retrieve each of the outputs from the transaction
for output in decoded_tx['vout']:
    i_sum.append(output['value'])  #issaugo verte

print("Ka tranzakcijos gavejas gavo: ")
for ou in i_sum:
    print(ou)
    what_got += ou  #ka gavo issaugo

whole_sum = 0  #bendra suma

# Calculating whole sum

for input in decoded_tx['vin']:  #susumuojami visi pervedimai kuriuos atliko
    out_index = input['vout']
Exemplo n.º 14
0
import sys
from bitcoin.rpc import RawProxy

p = RawProxy()

txId = sys.argv[1]
tx = p.getrawtransaction(txId, 1)


#Calculate input value

input_value = 0
for vin in tx['vin']:
    input_tx = p.getrawtransaction(vin['txid'], 1)
    original_vout_index = vin['vout']
    for vout_index, vout in enumerate(input_tx['vout']):
        if(vout_index == original_vout_index):
            input_value = input_value + vout['value'] 
print 'Transactions input value: ', input_value

#Calculate output value

output_value = 0
for vout in tx['vout']:
    output_value = output_value + vout['value']

print 'Transactions output value: ', output_value

print 'Transactions fee: ', input_value - output_value
Exemplo n.º 15
0
from bitcoin.rpc import RawProxy

p = RawProxy()

tx_value = 0
# Retrieve the raw transaction by ID
ID = input("Iveskite transakcijos hash: ")

raw_tx = p.getrawtransaction(ID)
# Decode the transaction
decoded_tx = p.decoderawtransaction(raw_tx)
# Iterate through each output in the transaction
for output in decoded_tx['vout']:
    # Add up the value of each output
    tx_value = tx_value + output['value']

tx_value1 = 0
vin_len = 0

for output1 in decoded_tx['vin']:
    raw_tx1 = p.getrawtransaction(output1['txid'])
    decoded_tx1 = p.decoderawtransaction(raw_tx1)
    end = output1['vout']
    tx_value1 = tx_value1 + decoded_tx1['vout'][end]['value']

print("Fee ", tx_value1 - tx_value)
Exemplo n.º 16
0
from bitcoin.rpc import RawProxy

p = RawProxy()

# Alice's transaction ID
txid = "0627052b6f28912f2703066a912ea577f2ce4da4caa5a5fbd8a57286c345c2f2"

# First, retrieve the raw transaction in hex
raw_tx = p.getrawtransaction(txid)

# Decode the transaction hex into a JSON object
decoded_tx = p.decoderawtransaction(raw_tx)

# Retrieve each of the outputs from the transaction
for output in decoded_tx['vout']:
    print(output['scriptPubKey']['addresses'], output['value'])
Exemplo n.º 17
0
option = int(input("Choose an option: "))
print(label0)

while index <= totalBlocks:
    blockValue = 0
    heightOfBlock = startBlock + index

    blockHash = p.getblockhash(heightOfBlock)
    block = p.getblock(blockHash)

    transactions = block['tx']

    for txid in transactions:
        transactionValue = 0

        rawTransactions = p.getrawtransaction(txid)
        decoded_tx = p.decoderawtransaction(rawTransactions)

        for output in decoded_tx['vout']:
            transactionValue = transactionValue + output['value']

        blockValue = blockValue + transactionValue

    totalValue = totalValue + blockValue

    if index == 0:
        minimum = blockValue
    if blockValue < minimum:
        minimum = blockValue
    if blockValue > maximum:
        maximum = blockValue
Exemplo n.º 18
0
from bitcoin.rpc import RawProxy

# Create a connection to local Bitcoin Core node
p = RawProxy()

TX_ID = input("Iveskite transakcijos ID:")
# TX_ID = 'd0bd3560694a1c2db52b8411b7a6d6557fde298528b97b30c27271f32c8abd5b'
try:

    raw_tx = p.getrawtransaction(TX_ID)
    decoded_tx = p.decoderawtransaction(raw_tx)

    output_value = sum([i['value'] for i in decoded_tx['vout']])

    # raw_tx_input = p.getrawtransaction(decoded_tx['vin'])

    input_value = 0
    for vin in decoded_tx['vin']:
        vin_TX_ID = vin['txid']
        vin_vout = vin['vout']

        vin_tx = p.getrawtransaction(vin_TX_ID)
        decoded_vin_tx = p.decoderawtransaction(vin_tx)
        input_value += decoded_vin_tx['vout'][vin_vout]['value']

    # raw_tx_input_id = decoded_tx['vin'][0]['vout']
    # decoded_tx_input = p.decoderawtransaction(raw_tx_input)
    # input_value = decoded_tx_input['vout'][raw_tx_input_id]['value']

    # print(decoded_tx['vin'])
    print(output_value, input_value)
Exemplo n.º 19
0
from bitcoin.rpc import RawProxy
import pprint

p = RawProxy()

rawT = p.getrawtransaction(
    "1c03c65d2a9f744c8b3ca5fe93096924b880c8ac10dbebf59531f5497bcb6eaa")

decoded_rawT = p.decoderawtransaction(rawT)

#goes through transactions and creates a list of dictionaries where each
#dictionary has the txid and vout# of each input
inputDict = {}
for x in decoded_rawT['vin']:
    inputDict[x['txid']] = x['vout']

ADDLIST = []
#goes through inputDict, and adds the addresses to ADDLIST
for key in inputDict:
    newAdd = findAddress(inputDict[key], key)
    if newAdd not in ADDLIST:
        ADDLIST.append(newAdd)

pprint.pprint(ADDLIST)
Exemplo n.º 20
0
def count_fee(temp):

    decoded_tx = p.decoderawtransaction(trans)
    vin_value = 0
    vout_value = 0

    for i in decoded_tx['vin']:
        raw_tx = p.getrawtransaction(i['txid'])
        next_decoded = p.decoderawtransaction(raw_tx)
        vinVout = i['vout']
        for k in next_decoded['vout']:
            if (k['n'] == vinVout):
                vin_value += k['value']

    for output in decoded_tx['vout']:
        vout_value = vout_value + output['value']

    ans = vin_value - vout_value
    print("Transaction fee : ", ans, " BTC")


txt = input("Enter your transaction hash :")
t = p.getrawtransaction(txt)
count_fee(t)

print("Biggest transaction fee : ")
trans = p.getrawtransaction(
    '4410c8d14ff9f87ceeed1d65cb58e7c7b2422b2d7529afc675208ce2ce09ed7d')
count_fee(trans)
Exemplo n.º 21
0
from bitcoin.rpc import RawProxy

p = RawProxy()

txid = raw_input("Write transaction id:")

raw_tx = p.getrawtransaction(txid)

decoded_tx = p.decoderawtransaction(raw_tx)

output = 0

for i in decoded_tx['vout']:
    output += i['value']
print(txid)

value_first = 0

for value in decoded_tx['vin']:
    value_txid = value['txid']
    value_result = value['vout']

    value_tx = p.getrawtransaction(value_txid)
    decoded_value_tx = p.decoderawtransaction(value_tx)
    value_first += decoded_value_tx['vout'][value_result]['value']

txfee = value_first - output
print(txfee)
from bitcoin.rpc import RawProxy

p = RawProxy()

print('Enter transaction ID:')
txid = input()

#IDs for reference :
#"4410c8d14ff9f87ceeed1d65cb58e7c7b2422b2d7529afc675208ce2ce09ed7d"
#"0627052b6f28912f2703066a912ea577f2ce4da4caa5a5fbd8a57286c345c2f2"

raw_tx = p.getrawtransaction(txid)

decoded_tx = p.decoderawtransaction(raw_tx)

outvalue = 0
for output in decoded_tx['vout']:
    outvalue = outvalue + output['value']

invalue = 0
for input in decoded_tx['vin']:
    raw_txin = p.getrawtransaction(input['txid'])
    decoded_txin = p.decoderawtransaction(raw_txin)
    vout = decoded_txin['vout']
    invalue = invalue + vout[input['vout']]['value']

print(invalue - outvalue)
Exemplo n.º 23
0
from bitcoin.rpc import RawProxy
import sys

p = RawProxy()

txid = sys.argv[1]

raw_tx = p.getrawtransaction(txid)
decoded_tx = p.decoderawtransaction(raw_tx)

output_total = 0
for out in decoded_tx['vout']:
    output_total += out['value']

input_value = 0
for input in decoded_tx['vin']:
    input_txid = input['txid']
    input_vout = input['vout']
    raw_input_tx = p.getrawtransaction(input_txid)
    decoded_input_tx = p.decoderawtransaction(raw_input_tx)
    input_value += decoded_input_tx['vout'][input_vout]['value']

fee = input_value - output_total

print "Transaction's ", txid, " fee was ", fee, " BTC"
Exemplo n.º 24
0
class BlockThread(threading.Thread):
    """
        A block, a thread.
    """
    p = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F
    mod_sqrt_power = (p + 1) // 4

    def __init__(self, args=()):
        super(BlockThread, self).__init__()
        self.queue = args[0]
        self.rpc_addr = args[1]
        self.rpc_port = args[2]
        self.proxy = None
        self.nblock = 0
        self._stop_event = threading.Event()

    def init_rpc_co(self):
        try:
            if (self.rpc_addr):
                self.proxy = RawProxy(service_url=self.rpc_addr, service_port=self.rpc_port)
            else:
                self.proxy = RawProxy(service_port=self.rpc_port)
        except Exception as e:
            perror("Unable to connect: " + str(e))

    def modular_sqrt(self, a):
        """
            Return n where n * n == a (mod p).
            If no such n exists, an arbitrary value will be returned. From pycoin.
        """
        return pow(a, self.mod_sqrt_power, self.p)

    def get_y(self, x, sign):
        """
            Get the Y coordinate from a compressed key.
            -x:     x coordinate
            -sign:  sign of Y
        """
        y_squared = (x**3 + 7) % self.p
        y = self.modular_sqrt(y_squared)
        if (sign == "02" and y & 1) or (sign == "03" and not y & 1) :
            return -y % self.p
        else:
            return y

    def run(self):
        while(1):
            if self.stopped() and self.nblock == 0:
                logging.info('%s Stopped', self.name)
                break
            if self.nblock:
                self.init_rpc_co()
                #logging.info('%s running with %s', self.name, self.nblock)
                keys = []
                bhash = self.proxy.getblockhash(self.nblock)
                block = self.proxy.getblock(bhash)
                for txid in block['tx']:
                    data = self._get_keys(txid, self.nblock)
                    if data == None or len(data) == 0:
                        continue
                    keys += data
                keys = dict((x[2], x) for x in keys).values() # delete duplicates in list
                for elt in keys:
                    if self.queue.full():
                        self.queue.join()
                    self.queue.put(elt)
                self.nblock = 0
                self.proxy.close()
                self.proxy = None
        return

    def _get_keys(self, txid, block):
        """
            Retrieve all keys from a transaction and construct a list according
            to the db schema.
            -txid:  transaction id
            -block: block number
        """
        tx = self.proxy.getrawtransaction(txid)
        tx_d = self.proxy.decoderawtransaction(tx)

        keys = []
        return_keys = []
        for elt in tx_d['vin']:
            if 'coinbase' in elt.keys():
                continue
            if 'txinwitness' in elt.keys():
                tab = elt['txinwitness']
            elif 'scriptSig' in elt.keys():
                sc = elt['scriptSig']
                tab = [x for x in sc['asm'].split(' ')]

            #If there is a redeem script
            rds = [x for x in tab if x[0] == '5']
            if (len(rds) > 0):
                for x in rds:
                    keys += [p for p in self.proxy.decodescript(x)['asm'].split(' ') if
                            p[0:2] in ['02', '03', '04']]
            else:
                keys += [p for p in tab if p[0:2] in ['02', '03', '04']]

            for key in keys:
                sign = key[:2]
                if sign != "04":
                    #Because sometimes very strange keys, and also because
                    #there are "0"
                    if (len(key) < 60 or len(key) > 70): continue
                    sx = '0x' + key[2:].upper()
                    x = int(sx, 16)
                    y = self.get_y(x, sign)
                    sy = "%X" % y
                    #keys.append([tx, nblock, hash, ])
                else:
                    if (len(key) < 120 or len(key) > 136): continue
                    sx = key[2:66].upper()
                    x = int(sx, 16)
                    sy = key[66:].upper()
                    y = int(sy, 16)

                hash = P2PKHBitcoinAddress.from_pubkey(bytes.fromhex(key), 0)

                return_keys.append([block, txid, str(hash), sx, sy])

            return return_keys

    def is_working(self):
        """
            Return True if working.
        """
        if self.nblock:
            return True
        else:
            return False

    def set_block(self, nblock):
        """
            Set self.nblock.
            -nblock:    block number
        """
        self.nblock = nblock

    def stop(self):
        self._stop_event.set()

    def stopped(self):
        return self._stop_event.is_set()
Exemplo n.º 25
0
from bitcoin.rpc import RawProxy
import sys

p = RawProxy()
block_hash = p.getblockhash(int(sys.argv[1]))
block = p.getblock(block_hash)
tx_id = block['tx'][0]
tx = p.getrawtransaction(tx_id)
decoded_tx = p.decoderawtransaction(tx)
total_out = 0
for vout in decoded_tx['vout']:
    total_out += vout['value']
multiplier = 1e-8
block_info = p.getblockstats(block_hash)
print(block_info['total_out'] * multiplier)
print(block_info['total_fee'] * multiplier)
print(total_out - block_info['total_fee'] * multiplier)
Exemplo n.º 26
0
from bitcoin.rpc import RawProxy

p = RawProxy()

txid = raw_input(
    "Input your transactionID (just type \'no\' if you dont want to) -> ")
if txid == "no":
    txid = "4410c8d14ff9f87ceeed1d65cb58e7c7b2422b2d7529afc675208ce2ce09ed7d"

tx_fee = 0
tx_input = 0
tx_output = 0

#decoce the transaction
raw_tx = p.getrawtransaction(txid)
decoded_tx = p.decoderawtransaction(raw_tx)

# calculate in value
for input in decoded_tx['vin']:
    tx_prev = input['txid']
    tx_prev_index = input['vout']
    # get into prev transaction
    tx_prev_decoded = p.decoderawtransaction(p.getrawtransaction(tx_prev))
    tx_input = tx_input + tx_prev_decoded['vout'][tx_prev_index]['value']

print("Transaction input", tx_input)

#  calculate out value
for output in decoded_tx['vout']:
    tx_output = tx_output + output['value']
Exemplo n.º 27
0
# `pc_transaction.py` example
from bitcoin.rpc import RawProxy

import sys

p = RawProxy()

if len(sys.argv) != 2:
    print("Too many arguments or no transaction ID passed! ")
    sys.exit()

# Alice's transaction ID
txid = str(sys.argv[1])

# First, retrieve the raw transaction in hex
raw_tx = p.getrawtransaction(txid)

# Decode the transaction hex into a JSON object
decoded_tx = p.decoderawtransaction(raw_tx)

s = 0

for output in decoded_tx['vin']:
    vindex = output['vout']
    raw_New = p.getrawtransaction(output['txid'])
    decode_New = p.decoderawtransaction(raw_New)
    for index, outp in enumerate(decode_New['vout']):
        if index == vindex:
            s=outp['value'] + s
        
s2 = 0