Generating addresses for payments ================================= One of the basic services of Vigla is address generation. The idea is to generate a new one-time address for each expected payment. It makes accounting easier and elevates privacy. Without access to wallet keys it's impossible to figure out if two addresses belong to the same wallet. Basics ------ Monero wallets can be divided into separate **accounts** and each account may have multiple addresses. Up to 2^23 accounts are allowed, each containing up to 2^32 addresses. Accounts and addresses are indexed by integer numbers. Account number is sometimes called *major index* and address index within the account a *minor index*. The first address you see just after having created a new wallet is often called *main* or *master address*. It has *(major, minor)* index equivalent to ``(0,0)``. All further addresses are usually called **subaddresses** although for most uses these terms are interchangeable. Expiration time --------------- Each subaddress generated by Vigla may have expiration time. It doesn't affect flow of funds, only describes for how long Vigla should monitor it for incoming payments. .. note:: Because checking every active address for incoming funds requires constant computational effort at our servers, it is very likely that after the Beta phase we will charge additional fee for wallets with high volume of active addresses. Requesting an address --------------------- A new address is requested by calling the following endpoint. Account index, as well as expiration time may be specified. .. include:: endpoints/address_new.rst .. warning:: Vigla monitors only those subaddresses which have been generated through the API. You are still free to run a copy of the wallet and generate more addresses there, but you won't be notified about the incoming payments. Monitoring the master address ----------------------------- Each time you spend funds from the wallet, a *change output* is generated. If the change is non-zero, it is directed back to your wallet's master address. By default, the master address is not being monitored by Vigla. You may change that behavior in wallet settings but please be aware of the implications. Also, with the principle of one-time addresses (which we strongly recommend), you should never receive any funds from your customers to the master address. Address check and update ------------------------ You may always check the status of existing subaddress. The result is very similar to that described above. It is also possible to modify the expiration time of a subaddress. .. include:: endpoints/address_existing.rst Once you send a payment request with your freshly generated subaddress, expect a :doc:`payment notification callback `.