View Issue Details

IDProjectCategoryView StatusLast Update
0012243Talerdocumentationpublic2026-11-29 17:15
Reporterbot-oec [agent]  
ImplementerChristian Grothoff Revieweroec  
Release signed byFlorian Dold Deployed byFlorian Dold  
VerifierFlorian Dold CommunicatorCM_7  
Fast-trackYes — The control, the release and the deployment are skipped: whoever implemented this change verifies and closes it themselves.
PrioritynormalSeveritytext 
Status closedResolutionfixed 
Fixed in Version1.6 
Summary0012243: P2P payments: the format of the encrypted contract, and that a push URI is a bearer instrument, are not documented
DescriptionThe 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`).
TagsNo tags attached.

Required notifications

Address or linkRemarkAdded byNotifiedActions

Relationships

related to 0012240 new P2P payments: the payment URI does not bind the purse, so the exchange can present a purse of its own 

Activities

bot-oec [agent]

2026-11-21 23:37

reporter   ~0030737

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 {

Christian Grothoff

2026-11-29 17:15

manager   ~0030950

cd220ad9..f70e0af2

Issue History

Date ModifiedUsernameFieldChange
2026-11-21 10:27bot-oecNew Issue
2026-11-21 10:27bot-oecRelationship addedrelated to 0012240
2026-11-21 10:27bot-oecImplementer => bernaalp
2026-11-21 10:27bot-oecReviewer => Emmanuel
2026-11-21 10:27bot-oecRelease signed by => Antoine A
2026-11-21 10:27bot-oecDeployed by => Antoine A
2026-11-21 10:27bot-oecVerifier => Amoui NGoran
2026-11-21 10:27bot-oecCommunicator => CM_7
2026-11-21 15:59oecImplementerbernaalp =>
2026-11-21 15:59oecReviewerEmmanuel => Christian Grothoff
2026-11-21 15:59oecRelease signed byAntoine A => Florian Dold
2026-11-21 15:59oecDeployed byAntoine A => Florian Dold
2026-11-21 15:59oecVerifierAmoui NGoran => Florian Dold
2026-11-21 22:44Christian GrothoffSeverityminor => text
2026-11-21 23:37bot-oecNote Added: 0030737
2026-11-29 15:58Christian GrothoffImplementer => Christian Grothoff
2026-11-29 15:58Christian GrothoffReviewerChristian Grothoff => oec
2026-11-29 15:58Christian GrothoffView Statusprivate => public
2026-11-29 15:58Christian GrothoffFast-track0 => 1
2026-11-29 17:15Christian GrothoffLocked by => Christian Grothoff
2026-11-29 17:15Christian GrothoffStatusnew => implementing
2026-11-29 17:15Christian GrothoffLocked byChristian Grothoff =>
2026-11-29 17:15Christian GrothoffStatusimplementing => closed
2026-11-29 17:15Christian GrothoffResolutionopen => fixed
2026-11-29 17:15Christian GrothoffFixed in Version => 1.6
2026-11-29 17:15Christian GrothoffNote Added: 0030950