returns success,msg (if success is True then the block was added)
True if any of the inputs of a tx has been spent
check if transaction input and output funds match
check that: * all inputs reference same public key * the public keys in all inputs match the
public keys in the output in the previous transaction
return all coins that have not been spent by pubkey
find a transaction by hash h
find the block where transaction with hash h appears
find funds in txin
True if txin is already spent in any previous transactions
a list of same size of the list of ouputs which has the hash of the transaction if spent otherwise empty string
Rebuilds transaction index from list of blocks
return all coins that have not been spent by a public key, as a dictionary with keys transaction hash, output number and value being the amount of coins
return transaction where txin shows as spent
returns a dictionary of all coins.TxIn in the list txlist of coins.Transaction. The dictionary key is the tuple (pubkey.N,pubkey.e,hash_prev,output_num) and the value is the number of times a particular txin appears as input in txlist.
True if transaction has been signed correctly
Sign a transaction
Note: all the input transactions are assumed to be from the same public key, so we just sign using one private key which is assumed to be that of the only owner of all inputs In bitcoin transactions, there is a “script” describing which keys to use to verify that the transaction is legit