From c51e3672a67950cb1b3478a59731d7b2bc5c3bdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Sa=C5=82aban?= Date: Thu, 3 Jan 2019 18:04:42 +0000 Subject: [PATCH] Update docs --- docs/source/address.rst | 14 ++++++++++++++ docs/source/backends.rst | 27 +++++++++++++++++++++------ docs/source/index.rst | 2 +- 3 files changed, 36 insertions(+), 7 deletions(-) diff --git a/docs/source/address.rst b/docs/source/address.rst index 976bdae..2ca9c30 100644 --- a/docs/source/address.rst +++ b/docs/source/address.rst @@ -67,6 +67,20 @@ We may use a subaddress too: These two classes, ``Address`` and ``SubAddress`` have similar functionality but one significant difference. Only the former may form *integrated address*. +Generating subaddresses +----------------------- + +It is possible to get subaddresses in two ways: + + 1. Creating them in the wallet file by calling ``.new_address()`` on ``Account`` or ``Wallet`` + instance. In properly synced wallet this will return an address that is guaranteed to be fresh + and unused. It is the right way if you plan to use one-time addresses to identify payments or + to improve your privacy by avoiding address reuse. + 2. Requesting arbitrary subaddress by calling ``Wallet.get_address(major, minor)`` where ``major`` + is the account index and ``minor`` is the index of the address within an account. Addresses + obtained this way are not guaranteed to be fresh and **will not be saved as already generated + within the wallet file**. (Watch out for unintentional address reuse!) + Payment IDs and integrated addresses ------------------------------------ diff --git a/docs/source/backends.rst b/docs/source/backends.rst index f6ec1f8..9a6337a 100644 --- a/docs/source/backends.rst +++ b/docs/source/backends.rst @@ -2,8 +2,10 @@ Backends ======== Backends are the protocols and methods used to communicate with the Monero daemon and interact with -the wallet. As of the time of this writing, the only backend available in this library is for the -HTTP based RPC server. +the wallet. As of the time of this writing, the only backends available in this library are: + + * ``jsonrpc`` for the HTTP based RPC server, + * ``offline`` for running the wallet without Internet connection and even without the wallet file. JSON RPC ---------------- @@ -20,9 +22,22 @@ the official `Wallet RPC`_ documentation. .. _`Wallet RPC`: https://getmonero.org/resources/developer-guides/wallet-rpc.html - -API reference -------------- - .. automodule:: monero.backends.jsonrpc :members: + +Offline +---------------- + +This backend allows creating a `Wallet` instance without network connection or even without the +wallet itself. In version 0.5 the only practical use is to cold-generate +:doc:`subaddresses
` like in the example below: + +.. code-block:: python + + In [8]: w = Wallet(OfflineWallet('47ewoP19TN7JEEnFKUJHAYhGxkeTRH82sf36giEp9AcNfDBfkAtRLX7A6rZz18bbNHPNV7ex6WYbMN3aKisFRJZ8Ebsmgef', view_key='6d9056aa2c096bfcd2f272759555e5764ba204dd362604a983fa3e0aafd35901')) + + In [9]: w.get_address(100,37847) + Out[9]: 883Gcsq65iqh4UL3fJTWLxY45skXyFVNQJZ4bdw4TJcqd8vafvtpX4p6HNmawqFMQ6TwJP7adzyLT1fbU6z1n9dqB9bJrfn + +.. automodule:: monero.backends.offline + :members: diff --git a/docs/source/index.rst b/docs/source/index.rst index 8940d2e..8843575 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -15,7 +15,7 @@ planned as well. Project homepage: https://github.com/emesik/monero-python .. toctree:: - :maxdepth: 1 + :maxdepth: 2 :caption: Contents: quickstart