BlockSci icon indicating copy to clipboard operation
BlockSci copied to clipboard

Is there a way to get the string for nonstandard and multis addresses

Open Kindhearted57 opened this issue 3 years ago • 5 comments

System Information (if applicable)

Using AMI: no BlockSci version: 0.7.0 Blockchain: Bitcoin Parser: Disk

I want to iterate through the blockchain and get the inputs and outputs of each transaction. However, as for nonstandard and multisig type, I can not find out a way to get the address string.

The below code shows how to get the address string for other types of address. But there seems no way to get the address string for the two aforementioned type?

for block in chain:
    for tx in block:
        inputs = tx.inputs.address.to_list()
        outputs = tx.outputs.address.to_list()
        for i in inputs:
            print(i.address_string)

Kindhearted57 avatar Mar 19 '21 16:03 Kindhearted57

These don't have a representative address string, I think. Alternatively, you can record the transaction hash.

jiagengliu avatar Mar 23 '21 21:03 jiagengliu

These don't have a representative address string, I think. Alternatively, you can record the transaction hash.

Do you mean record the transaction hash then find the address string from other source like btc explorer? My problem is that I have a large amount of addresses to deal with... So other methods like crawler might not be effective.

Kindhearted57 avatar Mar 25 '21 09:03 Kindhearted57

These don't have a representative address string, I think. Alternatively, you can record the transaction hash.

Do you mean record the transaction hash then find the address string from other source like btc explorer? My problem is that I have a large amount of addresses to deal with... So other methods like crawler might not be effective.

Yes. Alternatively, you can keep a record of the address index and address type. These do not change from machine to machine.

jiagengliu avatar Mar 26 '21 14:03 jiagengliu

Hi @jiagengliu, I'm wondering if we can still utilize all BlockSci functionalities for Taproot addresses (beginning with bc1p), despite BlockSci not being updated since the Taproot upgrade.

In my testing, all transaction details, including inputs, outputs, and values, are accurate. The only issue is with the address_string, which cannot be obtained for Taproot addresses. However, Taproot addresses do have a valid unique address_num and are categorized as address_type.witness_unknown, WitnessUnknownScript(), with a raw_type equals to 9.

Is my understanding correct?

If @maltemoeser is still active here, I would like also to hear his opinion on this.

alex-btc avatar Feb 22 '24 14:02 alex-btc

@alex-btc Yes I agree with you. After all, Taproot addresses should be somewhat backward compatible with older node versions. However, it's unclear whether clustering algorithms still work as expected.

jiagengliu avatar Feb 22 '24 16:02 jiagengliu