Skip to content

Commit f96ff8b

Browse files
authored
docs: document enhanced redeem behavior and issuer authorization (#1649)
Signed-off-by: Flamki <9833ayush@gmail.com>
1 parent 9a0f07c commit f96ff8b

3 files changed

Lines changed: 15 additions & 4 deletions

File tree

docs/services/ttx.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,17 @@ Enables the transfer of token ownership. The service:
178178
### Redeem
179179
A specialized transfer where the recipient is "hidden" or "empty," effectively removing the tokens from circulation on the ledger.
180180

181+
Redeem supports an enhanced flow where an issuer signature is required as part of transfer validation:
182+
1. Add the redeem action with `tx.Redeem(...)`.
183+
2. If the issuer endpoint cannot be resolved automatically, pass `ttx.WithFSCIssuerIdentity(...)` so the initiator can contact the issuer for endorsement.
184+
3. Optionally pass `ttx.WithIssuerPublicParamsPublicKey(...)` to pin which issuer public-parameters signing key must authorize the redeem.
185+
4. Run `CollectEndorsementsView` to collect owner, auditor (if configured), and issuer signatures.
186+
181187
## Collecting Endorsements
182188

183189
The `CollectEndorsementsView` is responsible for gathering all signatures required to make a transaction valid:
184190
* **Owner Signatures**: For every token spent, the service requests a signature from the node that owns the corresponding identity.
185-
* **Issuer Signatures**: For transactions involving token issuance.
191+
* **Issuer Signatures**: For transactions involving token issuance and enhanced redeem flows that require issuer authorization.
186192
* **Auditor Signatures**: If the TMS is configured with an auditor, the transaction must be approved via the `AuditApproveView`.
187193
* **Network Endorsements**: The service delegates to the **Network Service** to obtain backend-specific endorsements (e.g., Fabric chaincode endorsements).
188194

docs/token_sdk_usage.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,15 @@ if err != nil {
143143
}
144144

145145
// 2. Add Redeem Action
146-
// If the issuer is not automatically resolvable, provide their identity.
146+
// If the issuer is not automatically resolvable, provide their FSC identity.
147+
// If needed, also pin the issuer signing key expected by public parameters.
147148
senderWallet := ttx.GetWallet(context, senderWalletID)
148149
err = tx.Redeem(
149150
senderWallet,
150151
tokenType,
151152
amount,
152-
ttx.WithFSCIssuerIdentity(issuerIdentity), // Contact issuer for approval
153+
ttx.WithFSCIssuerIdentity(issuerIdentity), // Contact issuer for approval
154+
ttx.WithIssuerPublicParamsPublicKey(issuerPublicParamsPubKey), // Optional key pinning
153155
)
154156
if err != nil {
155157
return nil, err
@@ -168,6 +170,9 @@ if err != nil {
168170
}
169171
```
170172

173+
Use `ttx.WithFSCIssuerIdentity(...)` when your app cannot resolve the issuer endpoint automatically.
174+
Use `ttx.WithIssuerPublicParamsPublicKey(...)` when you want redeem authorization to be verified against a specific issuer key from public parameters.
175+
171176
---
172177

173178
## 5. Atomic Swap ([`swap.go`](../integration/token/fungible/views/swap.go))

docs/tokenapi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ A [Request](../token/request.go) is a ledger-agnostic blueprint for a token tran
5959

6060
### Core Actions
6161
* **Issue**: Minting new tokens into the system.
62-
* **Transfer**: Reassigning ownership of existing tokens (includes **Redeem** by transferring to a null owner).
62+
* **Transfer**: Reassigning ownership of existing tokens (includes **Redeem** by transferring to a null owner; enhanced redeem flows can additionally require issuer authorization/signature).
6363

6464
### The Request Lifecycle
6565
1. **Assemble**: Add actions to the `Request` using a TMS.

0 commit comments

Comments
 (0)