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

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)

Return type:int
equiv(equiv_script: bool=True) → blocksci.EquivAddress

Returns a list of all addresses equivalent to this address

Return type:blocksci.EquivAddress
first_tx

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

Type:blocksci.Tx
has_been_spent

Check if a type equivalent address has ever been spent

Type:bool
in_txes() → List[blocksci.Tx]

Returns a list of all transaction where this address was an input

in_txes_count() → int

Return the number of transactions where this address was an input

Return type:int
ins() → List[blocksci.Input]

Returns a list of all inputs spent from this address

out_txes() → List[blocksci.Tx]

Returns a list of all transaction where this address was an output

out_txes_count() → int

Return the number of transactions where this address was an output

Return type:int
outs

Returns a range of all outputs sent to this address

Type:blocksci.OutputIterator
raw_type

The type of address

Type:int
revealed_tx

The transaction where a type equivalent address was first revealed

Type:Optional[blocksci.Tx]
txes() → List[blocksci.Tx]

Returns a list of all transactions involving this address

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

address_string

Bitcoin address string

Type:str
find_multisigs() → blocksci.AddressIterator

List of multisigs which include this public key

Return type:blocksci.AddressIterator
pubkey

Public key for this address

Type:Optional[bytes]
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

address_string

Bitcoin address string

Type:str
find_multisigs() → blocksci.AddressIterator

List of multisigs which include this public key

Return type:blocksci.AddressIterator
pubkey

Public key for this address

Type:Optional[bytes]
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

address_string

Bitcoin address string

Type:str
find_multisigs() → blocksci.AddressIterator

List of multisigs which include this public key

Return type:blocksci.AddressIterator
pubkey

Public key for this address

Type:Optional[bytes]
pubkeyhash

160 bit address hash

Type:blocksci.uint160

Multisignature Address

class blocksci.MultisigAddress

Bases: blocksci.Address

Extra data about multi-signature address

addresses

The list of the keys that can sign for this address

Type:list
required

The number of signatures required for this address

Type:int
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

address_string

Bitcoin address string

Type:str
raw_address

The 160 bit P2SH address hash

Type:blocksci.uint160
wrapped_address

The address inside this P2SH address

Type:Optional[Address]

Pay to witness script hash Address

class blocksci.WitnessScriptHashAddress

Bases: blocksci.Address

Extra data about pay to script hash address

address_string

Bitcoin address string

Type:str
raw_address

The 160 bit P2SH address hash

Type:blocksci.uint256
wrapped_address

The address inside this P2SH address

Type:Optional[Address]

Non-standard Address

class blocksci.NonStandardAddress

Bases: blocksci.Address

Extra data about non-standard address

in_script

Nonstandard input script

Type:str
out_script

Nonstandard output script

Type:str

Op Return

class blocksci.OpReturn

Bases: blocksci.Address

Extra data about op_return address

data

Data contained inside this address

Type:bytes