Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
cc3f148
build(deps)!: update Platform to v5.1-dev 063589bf
lklimek Oct 24, 2026
82eecdd
refactor: adapt to the rust-dashcore cryptography API
lklimek Oct 24, 2026
e18e7f2
fix: adapt to protocol version 14 upstream types
lklimek Oct 24, 2026
2bb9fed
fix(sdk): follow the network's protocol version
lklimek Oct 24, 2026
173a135
test(platform): guard the protocol 13 tables and transitions
lklimek Oct 24, 2026
6a4e6e7
fix(errors): explain protocol 14 refusals that existing actions can hit
lklimek Oct 24, 2026
d75a159
docs: record the Platform v5.1-dev bump and protocol tracking
lklimek Oct 24, 2026
d2feb6a
feat(tokens): create and claim once-per-identity token distributions
lklimek Oct 24, 2026
74695e7
fix(errors): explain moderation, gas sponsorship and distribution lim…
lklimek Oct 24, 2026
67fb742
merge: bring the moderation, gas sponsorship and distribution limit r…
lklimek Oct 24, 2026
53d3fb2
fix(context): keep one system contract set per protocol version
lklimek Oct 25, 2026
e698c7a
fix(platform): confirm only a verified protocol version without the e…
lklimek Oct 25, 2026
4abf4d5
fix(wallet): erase the secp256k1 signing key after use
lklimek Oct 25, 2026
5536745
test(protocol): guard a contested name built with the contest fund at…
lklimek Oct 25, 2026
93cea96
fix(ui): say plainly what the app cannot edit or sign yet
lklimek Oct 25, 2026
16c1c7f
chore: keep AGENTS.md and the marketplace comment as on v1.0-dev
lklimek Oct 25, 2026
c0a8bea
fix(tokens): stop retrying a refused once-per-identity claim
lklimek Oct 25, 2026
b2bc371
merge: bring the review fixes of the Platform bump into the once-per-…
lklimek Oct 25, 2026
c0933c7
fix(errors): word the once-per-identity refusal like the non-transfer…
lklimek Oct 25, 2026
407bbaa
fix(test): prove the protocol version the headless refresh learns
lklimek Oct 25, 2026
01840b2
merge: bring the headless refresh test fix into this branch
lklimek Oct 25, 2026
9c54f99
test: drop the protocol 13 transition encoding tests
lklimek Oct 26, 2026
0555714
refactor(context): read the network's protocol version from the SDK
lklimek Oct 26, 2026
e7a9a45
refactor(context): set the fee multiplier from each proved epoch read
lklimek Oct 26, 2026
318ef38
docs(context): say why proved epochs need no ordering
lklimek Oct 26, 2026
8a18bff
test: drop the protocol 13 client tables snapshot
lklimek Oct 26, 2026
325ec45
fix(context): decode saved contracts at the proof verifier's version
lklimek Oct 26, 2026
7db8d30
fix(wallet): report a failed signed-message envelope instead of panic…
lklimek Oct 26, 2026
749f8bd
style: drop blank lines left by the removed secp256k1 context
lklimek Oct 26, 2026
eeca18a
Merge branch 'chore/bump-platform-063589bf' into feat/token-once-per-…
lklimek Oct 26, 2026
a977583
fix(tokens): read the protocol version from the SDK after the Platfor…
lklimek Oct 26, 2026
ea0485e
Merge branch 'v1.0-dev' (squash of #1114) into feat/token-once-per-id…
lklimek Oct 26, 2026
d8fc3ef
fix(tokens): name the operation when Platform rejects a token action
lklimek Oct 26, 2026
717de39
refactor(tokens): send token actions through the identity's own wallet
lklimek Oct 26, 2026
a9734ff
feat(tokens): keep token data visible but disable actions without a w…
lklimek Oct 26, 2026
a7a4e8a
fix(tokens): mint to the destination the contract allows and say so
lklimek Oct 26, 2026
6354f51
fix(tokens): show the same fee estimate before and after a token action
lklimek Oct 26, 2026
fca56bd
docs(tokens): record the platform-wallet token decision and wallet rule
lklimek Oct 26, 2026
f28fdd2
style(tokens): collapse the mint group-balance update condition
lklimek Oct 26, 2026
02909a1
docs(tokens): flag the group settings-update proof gap at its call site
lklimek Oct 26, 2026
3f7ba37
Merge branch 'feat/token-once-per-identity' into feat/tokens-via-plat…
lklimek Oct 26, 2026
815f301
fix(tokens): disable group co-signing for identities without a wallet
lklimek Oct 26, 2026
08a87a2
test(tokens): wire the wallet backend for the group co-sign gating test
lklimek Oct 26, 2026
1a3225f
fix(tokens): treat an open group settings-update proposal as recorded
lklimek Oct 26, 2026
b94578f
chore(deps): repin Platform to the updated dashpay/platform#5584 head
lklimek Oct 26, 2026
58ef5dc
test(contracts): pin contract bytes saved by the current build
lklimek Oct 27, 2026
7b5f6a1
chore(deps): bump dashpay/platform to v5.1-dev 0d91c133
lklimek Oct 27, 2026
fc7cca8
chore(deps): record platform pin 0d91c133 in the migration guards
lklimek Oct 27, 2026
3cf1720
test(contracts): pin a rich user contract saved by the previous build
lklimek Oct 27, 2026
f611495
Merge chore/bump-platform-0d91c133 (#1153) into feat/tokens-via-platf…
lklimek Oct 27, 2026
8197f9d
test(tokens): hold the layout test's identity in a loaded wallet
lklimek Oct 27, 2026
5171e7d
Merge v1.0-dev into feat/tokens-via-platform-wallet
lklimek Nov 21, 2026
1da2847
test(tokens): drop the co-signer test's unused action contexts after …
lklimek Nov 21, 2026
8e528c4
test(tokens): generate the routing tests' wallet seeds at runtime
lklimek Nov 21, 2026
e5097c2
refactor(tokens): move the token form's amount and identity-ID parsin…
lklimek Nov 21, 2026
3473d80
fix(tokens): take the mint recipient rules from the contract the mint…
lklimek Nov 21, 2026
2d76a46
test(tokens): set the forbid-choosing rule on the signed contract in …
lklimek Nov 21, 2026
aa08c5c
fix(tokens): let identities no wallet holds act on tokens through the…
lklimek Nov 21, 2026
a1d7391
docs(tokens): describe token actions of identities no wallet holds in…
lklimek Nov 21, 2026
85ccacd
fix(tokens): re-read token-action availability when identities change…
lklimek Nov 21, 2026
b574026
fix(tokens): disable Set Price while the identity's wallet is not open
lklimek Nov 21, 2026
6fa1031
docs(tokens): reattach execute_token_op's doc comment to it
lklimek Nov 21, 2026
2880533
docs(tokens): record the two token-action routes in the design note
lklimek Nov 21, 2026
8d9a899
fix(identity): report a signing key with no private half as a missing…
lklimek Nov 21, 2026
58c0ee0
fix(tokens): offer the token action form once the identity's wallet l…
lklimek Nov 21, 2026
7cefd7b
fix(tokens): let identities of a removed wallet act on tokens through…
lklimek Nov 21, 2026
d29390a
fix(group-actions): re-check token action availability while waiting …
lklimek Nov 21, 2026
bf893e8
docs(tokens): describe the removed-wallet rule and drop review IDs fr…
lklimek Nov 21, 2026
bdfeae0
Merge commit 'f6cb57956c' into feat/tokens-via-platform-wallet
lklimek Nov 21, 2026
9128b10
test(contracts): check the saved DashPay v2 contract against its reco…
lklimek Nov 21, 2026
ed88498
test(tokens): expect a rejected mint in the unauthorized-mint e2e test
lklimek Nov 21, 2026
57b5849
fix(tokens): fail an SDK mint at a missing token position before signing
lklimek Nov 21, 2026
c4a496e
fix(tokens): name the mint destination as last known in the confirmation
lklimek Nov 21, 2026
2ea1973
fix(tokens): co-sign a group mint only while the destination matches …
lklimek Nov 21, 2026
d4dbcb2
fix(tokens): re-check waiting token actions in My Tokens as it draws
lklimek Nov 21, 2026
f447376
test(tokens): keep each routing test's doc comment on its own test
lklimek Nov 21, 2026
961b44d
fix(tokens): name the mint destination as last known when co-signing
lklimek Nov 21, 2026
d85f9a9
fix(tokens): report a settings update as Platform proved it
lklimek Nov 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions docs/ai-design/2026-10-26-tokens-via-platform-wallet/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Token actions through platform-wallet

## Decision

All twelve token state transitions (mint, transfer, burn, freeze, unfreeze,
destroy frozen funds, pause, resume, claim, set price, purchase, settings
update) take one of two routes, chosen by `AppContext::token_action_wallet`
from the identity's DET wallet link:

- **Wallet-linked identity:** the upstream `platform-wallet` crate,
`IdentityWallet::token_*_with_signer` of the wallet that holds it. DET never
borrows another wallet's handle. If that wallet is not registered upstream,
the existing `WalletNotLoaded` / `WalletLockedNotLoaded` errors apply.
- **Wallet-less identity** (masternode, evonode and key-only identities): DET
builds the same `Token*TransitionBuilder` through the SDK and signs with the
identity's own keys. At the pinned revision `_with_signer` is exactly this SDK
call, so both routes send the same transition. The user chose to keep this
route because upstream offers no token handle outside a wallet; drop it once
upstream does.
- **Removed wallet:** once storage is prepared, a link to an HD wallet the app
no longer knows (it was removed) counts as no link, so the identity takes the
SDK route. Before that the wallet list may still be filling, so the link is
kept. A known wallet that is locked or still loading keeps the identity
waiting.

- **Seam:** `src/wallet_backend/tokens.rs`. `TokenActor` pairs a route (the
holding `PlatformWallet`, or the SDK) with the acting `QualifiedIdentity` (the
signer) and has one method per action. `AppContext::token_actor` picks the
route.
- **Why `_with_signer`, not `_with_external_signer`:** the external-signer
variants pick the signing key themselves, take no `StateTransitionCreationOptions`
(so the Developer signing override and fee agreement would be lost), fetch the
contract again, and need the identity inside the wallet's `IdentityManager`.
- **Errors:** `_with_signer` returns a raw `dash_sdk::Error`, so each `TokenActor`
method maps it with `TaskError::from_token_operation(kind, e)`.
- Proof failures are logged.
- Dedicated consensus mappings take priority.
- Unclassified failures become `TokenOperationFailed`; unclassified rejections
become `TokenOperationRejected`. Both name the operation.
- **UI:** `AppContext::token_action_availability` blocks actions only for a
linked wallet that is not loaded yet: My Tokens shows "View only" with the
transaction buttons disabled, and token action screens show the reason
instead of the form, re-checking each frame while they wait. Read-only token
data stays visible. Wallet-less identities are never blocked.
- **Mint recipient:** upstream drops a chosen recipient when the token does not
allow choosing one. `model::token::MintRecipient` applies the same rule up
front, so the confirmation names the identity that actually receives the
tokens.

## Upstream gaps

1. **No token handle outside a wallet.** `platform-wallet` exposes token
actions only on an identity held by a wallet, so wallet-less identities use
DET's SDK route instead.
2. **`_with_signer` returns `dash_sdk::Error`.** DET labels the operation itself.
3. **The mint recipient is normalised silently** (only a `debug!` log upstream).
4. **No passthrough for `PutSettings` / `user_fee_increase`.** DET does not use
them for tokens.
5. **`ConfigUpdateResult::GroupActionWithDocument` required a document.**
A group settings-update proposal is proved without one while the action stays
open, so it was reported as a proof error even though Platform accepted it.
Fixed upstream in dashpay/platform#5584 (`Option<Document>`); DET treats
`None` as a recorded proposal and keeps the stored settings until the group
closes the action.

## Not changed

- Contract registration and all token queries.
- Balances, which upstream's `IdentitySyncManager` already owns.
- Post-broadcast bookkeeping, apart from the mint recipient.

Known existing issue (out of scope): the `HistoricalDocument` branches write the
document's `amount` (a delta) as the identity's balance for mint and burn. The
transfer, claim and purchase branches read field names the token-history
contract does not have, so they do nothing.
12 changes: 12 additions & 0 deletions docs/user-stories.md
Original file line number Diff line number Diff line change
Expand Up @@ -1223,6 +1223,7 @@ As a token issuer, I want to mint additional tokens so that I can increase the c

- Requires authorized identity.
- Specify amount to mint.
- A recipient can be chosen only when the token allows it; otherwise the screen and the confirmation name the token's destination identity.

### TOK-007: Burn tokens [Implemented]
**Persona:** Jordan
Expand Down Expand Up @@ -1263,6 +1264,7 @@ As a user, I want to claim tokens distributed to me so that they appear in my ba

- View available claims.
- Claim action transfers tokens to identity.
- Identities that belong to no wallet in this app, such as evonode identities, can claim too.

### TOK-012: Set token pricing and purchase tokens [Implemented]
**Persona:** Jordan
Expand Down Expand Up @@ -1346,6 +1348,15 @@ As a token creator, I want to create a token that holders cannot send to other i
- For a token that cannot be transferred, My Tokens disables Transfer and says why.
- A transfer refused by the network is explained.

### TOK-021: Token transactions go through the identity's wallet when it has one [Implemented]
**Persona:** Alex, Jordan, Priya

As a user, I want token transactions to use the wallet that holds my identity, and to be told up front when that wallet is not ready, so that I do not fill in a form the network step will refuse.

- Token transactions (transfer, mint, burn, freeze, unfreeze, destroy frozen funds, pause, resume, claim, set price, purchase, settings update) of an identity that a wallet in this app holds are sent through that wallet.
- An identity that no wallet in this app holds (masternode, evonode and key-only identities) sends them signed with its own keys; it needs no wallet.
- When the identity's wallet is known but not loaded yet, My Tokens marks the identity "View only" with its transaction buttons disabled, and token action screens show the reason (unlock the wallet or wait for it to load) instead of the form.

## Contracts and Documents (DOC)

### DOC-001: Register a new data contract [Implemented]
Expand Down Expand Up @@ -1954,6 +1965,7 @@ As a masternode operator, I want to open the key screen for a node, so that I ca
As an evonode operator, I want to jump to token-reward claiming from the node's detail view, so that I can collect rewards my evonode earned.

- An Evonode's detail view shows "Claim token rewards ›", routing to the existing Claim Tokens screen for that identity.
- The claim is signed with the evonode identity's own keys; no wallet is needed.
- The action is hidden entirely on a plain Masternode's detail view.

### MN-010: Keep the Masternodes tab consistent across a network switch [Implemented]
Expand Down
Loading
Loading