View Issue Details

IDProjectCategoryView StatusLast Update
0012240Talerspecificationpublic2026-11-29 18:44
Reporterbot-oec [agent]  
ImplementerChristian Grothoff  
Estimated effort (hours)8 
PrioritynormalSeveritymajor 
Status implementing 
Target Version1.8 
Summary0012240: P2P payments: the payment URI does not bind the purse, so the exchange can present a purse of its own
Description`taler://pay-push/{exchange}/{contract.priv}` and `taler://pay-pull/…` carry only `contract.priv`. The wallet fetches `GET /contracts/{contract.pub}` and decrypts with `ECDH(contract.priv, purse.pub)`. That key can be computed from `contract.pub` by anyone with a purse key, so whoever answers the request (the exchange) can present a purse of its own, with a contract encrypted to `contract.pub`; `econtract_sig` is made by that purse's key and verifies.

For a push payment, the payee accepts and merges a purse the payer never offered; no value is lost (the payer's purse is refunded on expiry), but which contract the payee accepts rests on the exchange. For a payment request (pull), the payer pays into a purse the payee never created, and the payment goes to whoever owns that purse. This is the contract-substitution concern of design document 013, "Refinements", with the exchange alone.

The ProVerif model `models/proverif/purse.pv` finds both traces (PU8 in `spec/p2p.md`).

**Proposed change:** put a short commitment to the purse into the URI, for example a truncated `H(purse.pub)`, long enough that second preimages stay infeasible; with it the payee accepts only the offered purse (ProVerif `models/proverif/purse-bound.pv`). Or derive `contract` from a secret the URI carries together with the purse binding. Otherwise, document the trust in the exchange.

**Found by:** the formalization of the Taler protocols; the ProVerif model of purses (`purse.pv`), against PU8 in `spec/p2p.md`.
TagsNo tags attached.

Required notifications

Address or linkRemarkAdded byNotifiedActions

Questions

Put toAsked byStatusNote
Florian DoldChristian Grothoffwaiting for an answer30,957
 
A question is put to one person and moves the issue nowhere: it can be assigned, worked on and implemented with a question open, because whoever asked is the one who knows whether the answer still matters. Several may be open at once. The question itself is the note, so it is formatted, notified and in the record like everything else anybody said here.

Relationships

related to 0012243 closed P2P payments: the format of the encrypted contract, and that a push URI is a bearer instrument, are not documented 

Activities

bot-oec [agent]

2026-11-21 23:38

reporter   ~0030739

Proposed patch, the interim part (taler-docs master b3970cce): document the trust in the exchange at GET /contracts. The protocol fix needs a decision: put a short commitment to the purse into the URI, for example a truncated H(purse_pub) long enough that second preimages stay infeasible, which the wallet compares with the purse_pub it gets (ProVerif models/proverif/purse-bound.pv in the formalization proves the binding); or derive the contract key from a secret the URI carries together with the purse binding. Either changes the URI format (wallets and the taler URI specification).

diff --git a/core/exchange/get-contracts-CONTRACT_PUB.rst b/core/exchange/get-contracts-CONTRACT_PUB.rst
index eeab6f3a..693cb1c1 100644
--- a/core/exchange/get-contracts-CONTRACT_PUB.rst
+++ b/core/exchange/get-contracts-CONTRACT_PUB.rst
@@ -2,6 +2,14 @@
 
   Obtain P2P contract associated with the given contract public key.
 
+ A ``taler://pay-push/`` or ``taler://pay-pull/`` URI carries only the
+ contract's private key. The client cannot check that the purse returned
+ here is the one the other party created: anyone with a purse key can
+ encrypt a contract to ``$CONTRACT_PUB`` and sign it, so the client trusts
+ the exchange to return the right purse. For a payment offer (push) a wrong
+ purse costs no value, but decides which contract the payee accepts; for a
+ payment request (pull) the payer pays into the purse the exchange returns.
+
   **Response:**
 
   :http:statuscode:`200 Ok`:

Christian Grothoff

2026-11-29 17:35

manager   ~0030956

This is actually a specification issue, not a documentation issue.

We probably should replace contract_priv in the URL with the hash of the contract terms (which have a nonce). Then derive contract_priv from that hash, and after downloading the contract terms check that the hash matches the URL. Remains a single field, and fixes the contract. As P2P URLs can be floating around the Internet during the update, we need to be creative in how we signal the switch to the new semantics, maybe by making the hash of the contract terms a character longer than the private key when encoding it by prefixing some byte?

Christian Grothoff

2026-11-29 17:35

manager   ~0030957

Please review the high level design and approach.

Issue History

Date ModifiedUsernameFieldChange
2026-11-21 10:27bot-oecNew Issue
2026-11-21 10:27bot-oecImplementer => mikolai
2026-11-21 10:27bot-oecReviewer => Stefan
2026-11-21 10:27bot-oecRelease signed by => Antoine A
2026-11-21 10:27bot-oecDeployed by => Stefan
2026-11-21 10:27bot-oecVerifier => mikolai
2026-11-21 10:27bot-oecCommunicator => CM_7
2026-11-21 15:56oecImplementermikolai =>
2026-11-21 15:56oecReviewerStefan => Florian Dold
2026-11-21 15:56oecRelease signed byAntoine A => Florian Dold
2026-11-21 15:56oecDeployed byStefan => Florian Dold
2026-11-21 15:56oecVerifiermikolai => Florian Dold
2026-11-21 22:44Christian GrothoffSeveritymajor => text
2026-11-21 23:38bot-oecNote Added: 0030739
2026-11-29 15:59Christian GrothoffView Statusprivate => public
2026-11-29 17:35Christian GrothoffImplementer => Christian Grothoff
2026-11-29 17:35Christian GrothoffSeveritytext => major
2026-11-29 17:35Christian GrothoffStatusnew => planning
2026-11-29 17:35Christian GrothoffCategorydocumentation => specification
2026-11-29 17:35Christian GrothoffTarget Version => 1.8
2026-11-29 17:35Christian GrothoffNote Added: 0030956
2026-11-29 17:35Christian GrothoffLocked by => Christian Grothoff
2026-11-29 17:35Christian GrothoffStatusplanning => implementing
2026-11-29 17:35Christian GrothoffNote Added: 0030957
2026-11-29 18:44Christian GrothoffEstimated effort (hours) => 8
2026-12-01 12:02Locked byChristian Grothoff =>