Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Kindhearted57 opened this issue Mar 19, 2021 · 5 comments
Open

Comments

@Kindhearted57
Copy link

Kindhearted57 commented Mar 19, 2021

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)
@jiagengliu
Copy link

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

@Kindhearted57
Copy link
Author

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.

@jiagengliu
Copy link

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.

@alex-btc
Copy link

alex-btc commented Feb 22, 2024

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.

@jiagengliu
Copy link

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants