citp / BlockSci

A high-performance tool for blockchain science and exploration
https://citp.github.io/BlockSci/
GNU General Public License v3.0
1.34k stars 259 forks source link

How to use Other Heuristics #348

Closed candre-rungood closed 4 years ago

candre-rungood commented 4 years ago

In the heuristic page of the documentation https://citp.github.io/BlockSci/reference/heuristics/other_heuristics.html

I was looking at blocksci.heuristics.poison_tainted_outputs(output: blocksci.Output, tainted_value: int) → List[Tuple[blocksci.Output, int]] Returns the list of current UTXOs poison tainted by this output

but I'm note sure how to use it. Is there an example of how to use it? How do i select an Output? the one i get from tx are tx outputs TxOut()

thanks

maltemoeser commented 4 years ago

Taking the output of a transaction should work with the heuristic

candre-rungood commented 4 years ago

Do you have a quick example?

it says Invoked with:

poison_tainted_outputs(): incompatible function arguments. The following argument types are supported:

  1. (outputs: List[blocksci.Output], max_block_height: int=-1, taint_fee: bool=True) -> List[Tuple[blocksci.Output, Tuple[int, int]]]

Invoked with: TxOut

When i select a transaction output

Thanks

maltemoeser commented 4 years ago

The error tells you to pass in a list, simply wrap your output in square brackets [out]

candre-rungood commented 4 years ago

I tried this

outputs = [output for output in chain.blocks[1000].coinbase_tx.outs] poison_tainted_outputs = blocksci.heuristics.poison_tainted_outputs(outputs)

RuntimeError Traceback (most recent call last)

in 1 outputs = [output for output in chain.blocks[1000].coinbase_tx.outs] ----> 2 poison_tainted_outputs = blocksci.heuristics.poison_tainted_outputs(outputs) RuntimeError: Caught an unknown exception!

I was trying with litecoin if that matters?

maltemoeser commented 4 years ago

Yeah IIRC certain aspects of the logic were only implemented for Bitcoin.