Addresses

Addresses in BlockSci represent a unique identifier for a particular target of a transaction output. All outputs with the same address use the exact same output script. BlockSci supports 7 styles of addreses that originate in the Bitcoin blockchain and which are also used in other blockchains that use Bitcoin’s scripting language. An eight address type, nonstandard, operates as a catch-all for addresses that do not fit any other category.

Address

class blocksci.Address

Represents an abstract address object which uniquely identifies a given address

property address_num

The internal identifier of the address

Type

int

balance(height: int = - 1)int

Calculates the balance held by this address at the height (Defaults to the full chain)

equiv(equiv_script: bool = True)blocksci.EquivAddress

Returns a list of all addresses equivalent to this address

property first_tx

Get the first transaction that was sent to a type equivalent address

Type

blocksci.Tx

property full_type

The full type of the address

Type

str

property has_been_spent

Check if a type equivalent address has ever been spent

Type

bool

property in_txes

Returns an iterator over all transactions where this address appeared an input

Type

blocksci.TxIterator

in_txes_count()int

Return the number of transactions where this address appeared in an input

property input_txes

Returns an iterator over all transactions where this address appeared an input

Type

blocksci.TxIterator

input_txes_count()int

Return the number of transactions where this address was an input

property inputs

Returns an iterator over all inputs spent from this address

Type

blocksci.InputIterator

property ins

Returns an iterator over all inputs spent from this address

Type

blocksci.InputIterator

property out_txes

Returns an iterator over all transactions where this address appeared in an output

Type

blocksci.TxIterator

out_txes_count()int

Return the number of transactions where this address appeared in an output

property output_txes

Returns an iterator over all transactions where this address appeared in an output

Type

blocksci.TxIterator

output_txes_count()int

Return the number of transactions where this address appeared in an output

property outputs

Returns a iterator over all outputs sent to this address

Type

blocksci.OutputIterator

property outs

Returns a iterator over all outputs sent to this address

Type

blocksci.OutputIterator

property raw_type

The type of address

Type

int

property revealed_tx

The transaction where a type equivalent address was first revealed

Type

Optional[blocksci.Tx]

property txes

Returns an iterator over all transactions involving this address

Type

blocksci.TxIterator

property type

The type of address

Type

blocksci.address_type

Pay to pubkey Address

class blocksci.PubkeyAddress

Bases: blocksci.Address

Extra data about pay to pubkey address

property address_string

Bitcoin address string

Type

str

find_multisigs()blocksci.MultisigAddressIterator

List of multisigs which include this public key

property pubkey

Public key for this address

Type

Optional[bytes]

property pubkeyhash

160 bit address hash

Type

blocksci.uint160

Pay to pubkey hash Address

class blocksci.PubkeyHashAddress

Bases: blocksci.Address

Extra data about pay to pubkey address

property address_string

Bitcoin address string

Type

str

find_multisigs()blocksci.MultisigAddressIterator

List of multisigs which include this public key

property pubkey

Public key for this address

Type

Optional[bytes]

property pubkeyhash

160 bit address hash

Type

blocksci.uint160

Pay to witness pubkey hash Address

class blocksci.WitnessPubkeyHashAddress

Bases: blocksci.Address

Extra data about pay to pubkey address

property address_string

Bitcoin address string

Type

str

find_multisigs()blocksci.MultisigAddressIterator

List of multisigs which include this public key

property pubkey

Public key for this address

Type

Optional[bytes]

property pubkeyhash

160 bit address hash

Type

blocksci.uint160

Multisignature Address

class blocksci.MultisigAddress

Bases: blocksci.Address

Extra data about multi-signature address

property addresses

The list of the keys that can sign for this address

Type

blocksci.MultisigPubkeyRange

property required

The number of signatures required for this address

Type

int

property total

The total number of keys that can sign for this address

Type

int

Pay to script hash Address

class blocksci.ScriptHashAddress

Bases: blocksci.Address

Extra data about pay to script hash address

property address_string

Bitcoin address string

Type

str

property raw_address

The 160 bit P2SH address hash

Type

blocksci.uint160

property wrapped_address

The address inside this P2SH address

Type

Optional[blocksci.Address]

Pay to witness script hash Address

class blocksci.WitnessScriptHashAddress

Bases: blocksci.Address

Extra data about pay to script hash address

property address_string

Bitcoin address string

Type

str

property raw_address

The 160 bit P2SH address hash

Type

blocksci.uint256

property wrapped_address

The address inside this P2SH address

Type

Optional[blocksci.Address]

Non-standard Address

class blocksci.NonStandardAddress

Bases: blocksci.Address

Extra data about non-standard address

property in_script

Nonstandard input script

Type

str

property out_script

Nonstandard output script

Type

str

Op Return

class blocksci.OpReturn

Bases: blocksci.Address

Extra data about op_return address

property data

Data contained inside this address

Type

bytes