Skip to content

Commit

Permalink
Note 1.5 protocol as draft
Browse files Browse the repository at this point in the history
  • Loading branch information
Neil Booth committed Aug 11, 2018
1 parent 9e5b939 commit 785f302
Show file tree
Hide file tree
Showing 3 changed files with 164 additions and 161 deletions.
3 changes: 3 additions & 0 deletions docs/protocol-changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ Removed methods
Version 1.5
===========

.. note:: This is a draft of ideas for protocol 1.5; they are not
implemented

This protocol version makes changes intended to allow clients and
servers to more easily scale to support queries about busy addresses.
It has changes to reduce the amount of round-trip queries made in
Expand Down
161 changes: 161 additions & 0 deletions docs/protocol-methods.rst
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,108 @@ Return the confirmed and unconfirmed balances of a :ref:`script hash
"unconfirmed": "0.236844"
}

blockchain.scripthash.get_history
=================================

Return the confirmed and unconfirmed history of a :ref:`script hash
<script hashes>`.

**Signature**

.. function:: blockchain.scripthash.get_history(scripthash)
.. versionadded:: 1.1

*scripthash*

The script hash as a hexadecimal string.

**Result**

A list of confirmed transactions in blockchain order, with the
output of :func:`blockchain.scripthash.get_mempool` appended to the
list. Each confirmed transaction is a dictionary with the following
keys:

* *height*

The integer height of the block the transaction was confirmed in.

* *tx_hash*

The transaction hash in hexadecimal.

See :func:`blockchain.scripthash.get_mempool` for how mempool
transactions are returned.

**Result Examples**

::

[
{
"height": 200004,
"tx_hash": "acc3758bd2a26f869fcc67d48ff30b96464d476bca82c1cd6656e7d506816412"
},
{
"height": 215008,
"tx_hash": "f3e1bf48975b8d6060a9de8884296abb80be618dc00ae3cb2f6cee3085e09403"
}
]

::

[
{
"fee": 20000,
"height": 0,
"tx_hash": "9fbed79a1e970343fcd39f4a2d830a6bde6de0754ed2da70f489d0303ed558ec"
}
]

blockchain.scripthash.get_mempool
=================================

Return the unconfirmed transactions of a :ref:`script hash <script
hashes>`.

**Signature**

.. function:: blockchain.scripthash.get_mempool(scripthash)
.. versionadded:: 1.1

*scripthash*

The script hash as a hexadecimal string.

**Result**

A list of mempool transactions in arbitrary order. Each mempool
transaction is a dictionary with the following keys:

* *height*

``0`` if all inputs are confirmed, and ``-1`` otherwise.

* *tx_hash*

The transaction hash in hexadecimal.

* *fee*

The transaction fee in minimum coin units (satoshis).

**Result Example**

::

[
{
"tx_hash": "45381031132c57b2ff1cbe8d8d3920cf9ed25efd9a0beb764bdb2f24c7d1c7e3",
"height": 0,
"fee": 24310
}
]

blockchain.scripthash.history
=============================

Expand Down Expand Up @@ -371,6 +473,65 @@ hashes>`.
}


blockchain.scripthash.listunspent
=================================

Return an ordered list of UTXOs sent to a script hash.

**Signature**

.. function:: blockchain.scripthash.listunspent(scripthash)
.. versionadded:: 1.1

*scripthash*

The script hash as a hexadecimal string.

**Result**

A list of unspent outputs in blockchain order. This function takes
the mempool into account. Mempool transactions paying to the
address are included at the end of the list in an undefined order.
Any output that is spent in the mempool does not appear. Each
output is a dictionary with the following keys:

* *height*

The integer height of the block the transaction was confirmed in.
``0`` if the transaction is in the mempool.

* *tx_pos*

The zero-based index of the output in the transaction's list of
outputs.

* *tx_hash*

The output's transaction hash as a hexadecimal string.

* *value*

The output's value in minimum coin units (satoshis).

**Result Example**

::

[
{
"tx_pos": 0,
"value": 45318048,
"tx_hash": "9f2c45a12db0144909b5db269415f7319179105982ac70ed80d76ea79d923ebf",
"height": 437146
},
{
"tx_pos": 0,
"value": 919195,
"tx_hash": "3d2290c93436a3e964cfc2f0950174d8847b1fbe3946432c4784e168da0f019f",
"height": 441696
}
]

.. _subscribed:

blockchain.scripthash.subscribe
Expand Down
161 changes: 0 additions & 161 deletions docs/protocol-removed.rst
Original file line number Diff line number Diff line change
Expand Up @@ -212,164 +212,3 @@ bandwidth-intensive request.
concatenated together. As many as headers as are available at the
implied starting height will be returned; this may range from zero
to the coin-specific chunk size.

blockchain.scripthash.get_history
=================================

Return the confirmed and unconfirmed history of a :ref:`script hash
<script hashes>`.

**Signature**

.. function:: blockchain.scripthash.get_history(scripthash)
.. versionadded:: 1.1

*scripthash*

The script hash as a hexadecimal string.

**Result**

A list of confirmed transactions in blockchain order, with the
output of :func:`blockchain.scripthash.get_mempool` appended to the
list. Each confirmed transaction is a dictionary with the following
keys:

* *height*

The integer height of the block the transaction was confirmed in.

* *tx_hash*

The transaction hash in hexadecimal.

See :func:`blockchain.scripthash.get_mempool` for how mempool
transactions are returned.

**Result Examples**

::

[
{
"height": 200004,
"tx_hash": "acc3758bd2a26f869fcc67d48ff30b96464d476bca82c1cd6656e7d506816412"
},
{
"height": 215008,
"tx_hash": "f3e1bf48975b8d6060a9de8884296abb80be618dc00ae3cb2f6cee3085e09403"
}
]

::

[
{
"fee": 20000,
"height": 0,
"tx_hash": "9fbed79a1e970343fcd39f4a2d830a6bde6de0754ed2da70f489d0303ed558ec"
}
]

blockchain.scripthash.listunspent
=================================

Return an ordered list of UTXOs sent to a script hash.

**Signature**

.. function:: blockchain.scripthash.listunspent(scripthash)
.. versionadded:: 1.1

*scripthash*

The script hash as a hexadecimal string.

**Result**

A list of unspent outputs in blockchain order. This function takes
the mempool into account. Mempool transactions paying to the
address are included at the end of the list in an undefined order.
Any output that is spent in the mempool does not appear. Each
output is a dictionary with the following keys:

* *height*

The integer height of the block the transaction was confirmed in.
``0`` if the transaction is in the mempool.

* *tx_pos*

The zero-based index of the output in the transaction's list of
outputs.

* *tx_hash*

The output's transaction hash as a hexadecimal string.

* *value*

The output's value in minimum coin units (satoshis).

**Result Example**

::

[
{
"tx_pos": 0,
"value": 45318048,
"tx_hash": "9f2c45a12db0144909b5db269415f7319179105982ac70ed80d76ea79d923ebf",
"height": 437146
},
{
"tx_pos": 0,
"value": 919195,
"tx_hash": "3d2290c93436a3e964cfc2f0950174d8847b1fbe3946432c4784e168da0f019f",
"height": 441696
}
]

blockchain.scripthash.get_mempool
=================================

Return the unconfirmed transactions of a :ref:`script hash <script
hashes>`.

**Signature**

.. function:: blockchain.scripthash.get_mempool(scripthash)
.. versionadded:: 1.1

*scripthash*

The script hash as a hexadecimal string.

**Result**

A list of mempool transactions in arbitrary order. Each mempool
transaction is a dictionary with the following keys:

* *height*

``0`` if all inputs are confirmed, and ``-1`` otherwise.

* *tx_hash*

The transaction hash in hexadecimal.

* *fee*

The transaction fee in minimum coin units (satoshis).

**Result Example**

::

[
{
"tx_hash": "45381031132c57b2ff1cbe8d8d3920cf9ed25efd9a0beb764bdb2f24c7d1c7e3",
"height": 0,
"fee": 24310
}
]

0 comments on commit 785f302

Please sign in to comment.