Skip to content

Commit 3d73d91

Browse files
committed
suggestions part 3
1 parent 4e10e7c commit 3d73d91

File tree

1 file changed

+35
-9
lines changed
  • content/stellar-contracts/tokens/rwa

1 file changed

+35
-9
lines changed

content/stellar-contracts/tokens/rwa/rwa.mdx

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -238,14 +238,28 @@ The RWA package includes several supporting modules that work together to provid
238238

239239
This is a mandatory module, since RWA token contract expects the compliance checks and hooks to be available.
240240

241-
Provides a modular framework for implementing custom compliance rules.
242-
[Compliance Contract](https://github.com/OpenZeppelin/stellar-contracts/blob/main/packages/tokens/src/rwa/compliance/mod.rs#L67) uses a hook-based architecture where multiple [compliance modules](https://github.com/OpenZeppelin/stellar-contracts/blob/main/packages/tokens/src/rwa/compliance/mod.rs#L327) can be registered for specific events:
243-
244-
- **Transferred**: Called after tokens are successfully transferred
245-
- **Created**: Called after tokens are successfully minted
246-
- **Destroyed**: Called after tokens are successfully burned
247-
- **CanTransfer**: Called during transfer validation (read-only)
248-
- **CanCreate**: Called during mint validation (read-only)
241+
Provides a modular framework for implementing custom compliance rules through a hook-based architecture where multiple
242+
[compliance modules](https://github.com/OpenZeppelin/stellar-contracts/blob/main/packages/tokens/src/rwa/compliance/mod.rs#L327)
243+
can be registered to the [Compliance Contract](https://github.com/OpenZeppelin/stellar-contracts/blob/main/packages/tokens/src/rwa/compliance/mod.rs#L67).
244+
245+
**Compliance Validation Flow:**
246+
247+
```mermaid
248+
graph TD
249+
A[RWA Token Transfer/Mint] --> B[Compliance Contract]
250+
B --> C{Hook Type<br/>CanTransfer<br/>CanCreate<br/>etc.}
251+
C --> D[Registered Modules 1..N]
252+
D --> E[Transfer Limit Module]
253+
D --> F[Country Restriction Module]
254+
D --> G[Investor Count Module]
255+
D --> H[Custom Module X]
256+
E --> I{All modules<br/>return true?}
257+
F --> I
258+
G --> I
259+
H --> I
260+
I -->|Yes| J[Operation Proceeds]
261+
I -->|No| K[Operation Reverts]
262+
```
249263

250264
The compliance contract is designed to be shared across multiple RWA tokens, with each hook function accepting a
251265
`token` parameter to identify the calling token.
@@ -367,12 +381,24 @@ Claims are issued by trusted authorities and contain:
367381

368382
This module is an implementation detail. It is provided as the suggested implementation for the **Claim-based** approach.
369383

370-
Validates cryptographic claims with support for multiple signature schemes:
384+
Validates cryptographic claims and provides comprehensive claim lifecycle management. The module includes:
371385

386+
**Signature Verification:**
372387
- Ed25519 (Stellar native)
373388
- Secp256k1 (Ethereum compatible)
374389
- Secp256r1 (Enterprise PKI compatible)
375390

391+
**Key Management:**
392+
- Topic-specific key authorization with registry tracking
393+
- Each public key is tied to a signature scheme
394+
- A signing key (public key + scheme) can be authorized to sign claims for specific topic and registry combinations
395+
- The same signing key can be authorized across multiple topics and registries independently
396+
397+
**Claim Invalidation Mechanisms:**
398+
- **Passive Expiration**: Helper functions to encode/decode expiration metadata (`created_at` and `valid_until` timestamps) within claim data, allowing claims to automatically expire without on-chain action
399+
- **Per-claim Revocation**: Fine-grained revocation of individual claims for precise control
400+
- **Signature Invalidation**: Efficient bulk invalidation via nonce increment for revoking all claims signed by a specific key
401+
376402
## Extensions
377403

378404
The following optional extensions are provided:

0 commit comments

Comments
 (0)