Equivalent Addresses

Equivalent addresses reflect BlockSci’s understanding that various distinct addresses actually require a common piece of information to spend them.

BlockSci supports two distinct notions of address equivalence.

  1. Type Equivalence - Addresses which require the exact same knowledge to spend them can be considered equivalent. Pay to pubkey, pay to pubkeyhash and pay to witness pubkey hash all require knowledge of a given pubkey in order to be spent and can thus be considered equivalent. Similarly pay to scripthash and pay to witness scripthash both require knowledge of a given spending script.

  2. Script Equivalence - A Pay to script hash address and the address that is wrapped inside it can be considered equivalent addresses since they reflect the same piece of information.

Type Equivalence and Script Equivalence together or Type Equivalence alone form an equivalence class over the addresses. This technique allows users to find a set of addresses that is guarenteed to be controlled by the same person.

EquivAddress provides a very similar interface to address, except operates on a set of equivalent addresses rather than a single address.

In other analysis tools, this distinction between Address and EquivAddress is not explicitly handled. Frequently Pay to Pubkey and Pay to Pubkey hash addresses using the same public key are treated as the same address and in many block explorers the balance of an ‘address’ is the sum of the balances of both types. However a Pay to witness pubkey hash address using the same pubkey is treated as completely distinct from the other addresses. Further when a pubkey is used both in P2PKH addresses as well as wrapped inside a P2SH, these are frequently treated as different addresses. BlockSci allows the user to decide which address concept they would like to work with.

EquivAddress

class blocksci.EquivAddress

A set of equivalent addresses

property addresses

Calculate balance

Type

blocksci.AddressIterator

balance(height: int = - 1)int

Calculates the balance held by these equivalent addresses at the height (Defaults to the full chain)

in_txes() → List[blocksci.Tx]

Returns a list of all transaction where these equivalent addresses were an input

in_txes_count()int

Return the number of transactions where these equivalent addresses were an input

input_txes() → List[blocksci.Tx]

Returns a list of all transaction where these equivalent addresses were an input

input_txes_count()int

Return the number of transactions where these equivalent addresses were an input

property inputs

Returns an iterator over all inputs spent from these equivalent addresses

Type

blocksci.InputIterator

property ins

Returns an iterator over all inputs spent from these equivalent addresses

Type

blocksci.InputIterator

property is_script_equiv

Returns whether this equiv address is script equivalent or not

Type

bool

out_txes() → List[blocksci.Tx]

Returns a range of all transaction where these equivalent addresses were an output

out_txes_count()int

Return the number of transactions where these equivalent addresses were an output

output_txes() → List[blocksci.Tx]

Returns a range of all transaction where these equivalent addresses were an output

output_txes_count()int

Return the number of transactions where these equivalent addresses were an output

property outputs

Returns an iterator over all outputs sent to these equivalent addresses

Type

blocksci.OutputIterator

property outs

Returns an iterator over all outputs sent to these equivalent addresses

Type

blocksci.OutputIterator

txes() → List[blocksci.Tx]

Returns a list of all transactions involving these equivalent addresses