regional-custom-manual.rst (6721B)
1 .. 2 This file is part of GNU TALER. 3 Copyright (C) 2014-2024 Taler Systems SA 4 5 TALER is free software; you can redistribute it and/or modify it under the 6 terms of the GNU Affero General Public License as published by the Free Software 7 Foundation; either version 2.1, or (at your option) any later version. 8 9 TALER is distributed in the hope that it will be useful, but WITHOUT ANY 10 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 11 A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. 12 13 You should have received a copy of the GNU Affero General Public License along with 14 TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> 15 16 @author Florian Dold 17 @author Marcello Stanisci 18 @author Christian Grothoff 19 20 21 .. target audience: operator 22 23 Regional Currency Custom Setup Manual 24 ##################################### 25 26 This manual describes how to setup a regional currency manually. If you want a guided setup you can follow the :doc:`automated setup manual<regional-automated-manual>`. 27 28 .. contents:: Table of Contents 29 :local: 30 31 .. include:: ../frags/regional-manual-architecture.rst 32 33 Custom Manual Setup 34 =================== 35 36 You first need to setup the :ref:`libeufin-bank<libeufin-bank>` and integrate it with a Taler exchange. 37 38 If you don't want your regional currency to be backed by a fiat currency, you can stop here. 39 40 Enabling Currency Conversion 41 ++++++++++++++++++++++++++++ 42 43 You need to setup the :ref:`libeufin-nexus<libeufin-nexus>` using a bank account at a bank dealing in fiat currency that 44 offers an online banking protocol supported by LibEuFin Nexus. 45 46 Next, you have to enable conversion and should ensure that at least one TAN 47 channel for :ref:`multi-factor authentication <libeufin-mfa>` is configured. 48 49 The following snippet shows how to enable conversion in ``libeufin-bank`` configuration: 50 51 .. code-block:: ini 52 53 [libeufin-bank] 54 ALLOW_CONVERSION = YES 55 FIAT_CURRENCY = EUR 56 57 Make sure to (re)start the libeufin-bank after changing 58 these configuration options: 59 60 .. code-block:: console 61 62 # systemctl restart libeufin-bank 63 64 65 Web-based Configuration 66 +++++++++++++++++++++++ 67 68 Now you have to set the conversion rates and the ``admin`` debt limit via the bank's web interface as the ``admin`` user. 69 70 .. _regional-conversion-setup: 71 72 Configuring the Exchange for Conversion 73 +++++++++++++++++++++++++++++++++++++++ 74 75 An exchange that supports currency conversion needs to advertise two bank 76 accounts, one in the regional currency and a second in the fiat currency. The 77 conversion logic ensures that wire transfers in either account are 78 immediately reflected in the other account. 79 80 This section explains how to enable currency conversion at the exchange, 81 which is critical for wallets to know how to wire fiat currency to an 82 exchange to obtain regional currency. 83 84 You will need to use the ``taler-exchange-offline`` tool to inform the 85 exchange about the **fiat** bank account that can be used for cash in 86 operations and also specify the URL for currency conversion. Additionally, 87 you may also configure restrictions on the bank accounts that may originate 88 the funds, for example, to prevent international wire transfers that may expose 89 you to additional compliance risks. 90 91 Given the ``$IBAN`` of the fiat currency bank account and ``$NAME`` as 92 the (URL-encoded) name of the exchange-account owner, the following 93 ``taler-exchange-offline`` invocation can be used to notify wallets about 94 the possibility of currency conversion (cash in): 95 96 .. code-block:: console 97 98 # source config/user.conf 99 # sudo -u taler-exchange-offline \ 100 taler-exchange-offline \ 101 wire-fee now iban "${CURRENCY}":0 "${CURRENCY}":0 \ 102 enable-account \ 103 "${CONVERSION_PAYTO}" \ 104 conversion-url "${PROTO}://bank.$DOMAIN_NAME/conversion-info/" \ 105 display-hint 10 "CHF" \ 106 debit-restriction deny \ 107 credit-restriction \ 108 regex \ 109 'payto://iban/.*/CH.*?receiver-name=.*' \ 110 'Swiss only' \ 111 '{"de":"nur Schweiz","fr":"Suisse uniquement"}' \ 112 upload 113 114 Here, the ``$CONVERSION_URL`` must be set to the base URL of the conversion 115 endpoint of the bank, which should be 116 ``https://bank.$DOMAIN/conversion-info/`` in our setup. 117 118 The above commands set up the exchange to perform conversion with a 119 restriction to only accept credit transfers from Swiss bank accounts. You may 120 want to configure such restrictions on the bank accounts that may originate 121 funds to prevent international wire transfers that may expose you to 122 additional compliance risks. 123 124 You can leave out the "credit-restriction" if you want to allow international 125 inbound wire transfers. 126 127 The "debit-restriction" is largely mandatory as in this setup the 128 ``taler-exchange-transfer`` is only configured to deal with the regional 129 currency bank. Crediting fiat bank accounts must thus be done via the 130 cash-out functionality of the regional currency bank account. 131 132 The "display-hint" gives priority (10) for the fiat cash-in account over the 133 regional currency account in the withdraw dialog of the wallets and labels the 134 account with "CHF". 135 136 .. note:: 137 138 The above command adds a **second** bank account to the exchange. 139 You (or the guided setup script) should have already enabled the 140 regional currency bank account (without any "conversion-url"). 141 142 .. include:: ../frags/regional-system-on.rst 143 .. include:: ../frags/deploying-tos.rst 144 145 146 Maintenance 147 +++++++++++ 148 149 The ``taler-exchange-offline`` commands given above set fees only for the 150 current year (``now``). Thus, before January 1st of each year, you must to set 151 up new fees for the new calendar year. In a regional currency setup, this 152 typically requires up to three annual settings: 153 154 .. code-block:: console 155 156 # YEAR=2025 # edit if necessary 157 # FIAT_CURRENCY=CHF # edit if necessary 158 # REGIO_CURRENCY=NETZBON # edit if necessary 159 # sudo -u taler-exchange-offline \ 160 taler-exchange-offline \ 161 wire-fee "$YEAR" \ 162 iban "${FIAT_CURRENCY}":0 "${FIAT_CURRENCY}":0 \ 163 wire-fee "$YEAR" \ 164 x-taler-bank "${REGIO_CURRENCY}":0 "${REGIO_CURRENCY}":0 \ 165 global-fee $YEAR \ 166 "${REGIO_CURRENCY}:0" \ 167 "${REGIO_CURRENCY}:0" \ 168 "${REGIO_CURRENCY}:0" \ 169 4w 6y 4 \ 170 upload 171 172 If the fees are not all zero, simply change the respective place to specify 173 a non-zero fee. 174 175 .. note:: 176 177 Additionally, the denomination signing keys will only have been 178 pre-generated for some time, depending on your ``LOOKAHEAD_SIGN`` 179 configuration option. Thus, you may need to periodically run 180 the "taler-exchange-offline download sign upload" sequence as well!