View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0012243 | Taler | documentation | public | 2026-11-21 10:27 | 2026-11-29 17:15 |
| Reporter | bot-oec [agent] | ||||
| Implementer | Christian Grothoff | Reviewer | oec | ||
| Release signed by | Florian Dold | Deployed by | Florian Dold | ||
| Verifier | Florian Dold | Communicator | CM_7 | ||
| Fast-track | Yes — The control, the release and the deployment are skipped: whoever implemented this change verifies and closes it themselves. | ||||
| Priority | normal | Severity | text | ||
| Status | closed | Resolution | fixed | ||
| Fixed in Version | 1.6 | ||||
| Summary | 0012243: P2P payments: the format of the encrypted contract, and that a push URI is a bearer instrument, are not documented | ||||
| Description | The documentation does not describe the encrypted contract of a purse: its key `HKDF(ECDH(contract.priv, purse.pub))`, the cipher `crypto_secretbox` (XSalsa20-Poly1305), and a header with the type (offer or request) and, for a push payment, `merge.priv`. It therefore does not say either that the push payment URI is a bearer instrument: whoever learns it can take the payment. **Proposed change:** document the format and key of the encrypted contract as the exchange's library implements it (`crypto_contract.c`; written out in `spec/p2p.md`), and state that a push payment URI is a bearer instrument. **Found by:** the formalization of the Taler protocols; the contract format had to be taken from the exchange's code (`crypto_contract.c`). | ||||
| Tags | No tags attached. | ||||
| related to | 0012240 | new | P2P payments: the payment URI does not bind the purse, so the exchange can present a purse of its own |
| Proposed patch (taler-docs master b3970cce): the format and key of EncryptedContract as src/util/crypto_contract.c implements them, and that a taler://pay-push/ URI is a bearer instrument (it carries contract_priv, which decrypts the merge key). diff --git a/core/exchange/post-purses-PURSE_PUB-create.rst b/core/exchange/post-purses-PURSE_PUB-create.rst index bb0dd055..28144651 100644 --- a/core/exchange/post-purses-PURSE_PUB-create.rst +++ b/core/exchange/post-purses-PURSE_PUB-create.rst @@ -143,6 +143,25 @@ } + ``econtract`` is a nonce of 24 bytes followed by an XSalsa20-Poly1305 + ciphertext of the plaintext (libsodium ``crypto_secretbox_easy`` under that + nonce). The 32-byte key is derived with ``GNUNET_CRYPTO_hkdf_gnunet`` from + the key material ``ECDH(contract_priv, purse_pub)`` (as + ``GNUNET_CRYPTO_ecdh_eddsa`` computes it from the contract's private key and + the purse's public key), with the nonce as salt and the context string + ``p2p-merge-contract`` for a payment offer (push) or + ``p2p-deposit-contract`` for a payment request (pull). The plaintext is a + header of two 32-bit integers in network byte order, the type (0: payment + offer, 1: payment request) and the length of the uncompressed contract; for a + payment offer followed by the 32-byte private merge key; then the contract + terms as compact JSON with sorted keys, compressed with zlib + (``compress``). The reference implementation is + ``src/util/crypto_contract.c`` of the exchange. + + Whoever knows ``contract_priv`` can decrypt the contract, and for a payment + offer obtains the merge key with it: a ``taler://pay-push/`` URI, which + carries ``contract_priv``, is a bearer instrument for the payment. + .. ts:def:: PurseCreateSuccessResponse interface PurseCreateSuccessResponse { | |
| cd220ad9..f70e0af2 | |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2026-11-21 10:27 | bot-oec | New Issue | |
| 2026-11-21 10:27 | bot-oec | Relationship added | related to 0012240 |
| 2026-11-21 10:27 | bot-oec | Implementer | => bernaalp |
| 2026-11-21 10:27 | bot-oec | Reviewer | => Emmanuel |
| 2026-11-21 10:27 | bot-oec | Release signed by | => Antoine A |
| 2026-11-21 10:27 | bot-oec | Deployed by | => Antoine A |
| 2026-11-21 10:27 | bot-oec | Verifier | => Amoui NGoran |
| 2026-11-21 10:27 | bot-oec | Communicator | => CM_7 |
| 2026-11-21 15:59 | oec | Implementer | bernaalp => |
| 2026-11-21 15:59 | oec | Reviewer | Emmanuel => Christian Grothoff |
| 2026-11-21 15:59 | oec | Release signed by | Antoine A => Florian Dold |
| 2026-11-21 15:59 | oec | Deployed by | Antoine A => Florian Dold |
| 2026-11-21 15:59 | oec | Verifier | Amoui NGoran => Florian Dold |
| 2026-11-21 22:44 | Christian Grothoff | Severity | minor => text |
| 2026-11-21 23:37 | bot-oec | Note Added: 0030737 | |
| 2026-11-29 15:58 | Christian Grothoff | Implementer | => Christian Grothoff |
| 2026-11-29 15:58 | Christian Grothoff | Reviewer | Christian Grothoff => oec |
| 2026-11-29 15:58 | Christian Grothoff | View Status | private => public |
| 2026-11-29 15:58 | Christian Grothoff | Fast-track | 0 => 1 |
| 2026-11-29 17:15 | Christian Grothoff | Locked by | => Christian Grothoff |
| 2026-11-29 17:15 | Christian Grothoff | Status | new => implementing |
| 2026-11-29 17:15 | Christian Grothoff | Locked by | Christian Grothoff => |
| 2026-11-29 17:15 | Christian Grothoff | Status | implementing => closed |
| 2026-11-29 17:15 | Christian Grothoff | Resolution | open => fixed |
| 2026-11-29 17:15 | Christian Grothoff | Fixed in Version | => 1.6 |
| 2026-11-29 17:15 | Christian Grothoff | Note Added: 0030950 |