Document solver_pubkey in restore-session response#41
Document solver_pubkey in restore-session response#41BraCR10 wants to merge 1 commit intoMostroP2P:mainfrom
Conversation
Clarifies that orders currently in dispute are reported solely through the `disputes` array, not `orders`. Introduces the `solver_pubkey` field to the dispute object, indicating the assigned solver for a dispute and its use for chat key derivation. Updates field descriptions and examples to accurately reflect the new structure and the `solver_pubkey` field.
WalkthroughDocumentation update to the restore-session endpoint that restructures dispute representation. Disputed orders are relocated from the Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/restore_session.md`:
- Line 90: Update the `solver_pubkey` field description in the
restore_session.md diff to remove the incorrect claim that it is "used to derive
the ECDH shared key for the dispute chat"; keep that it is the hex pubkey of the
assigned solver (or null) and is set via `admin-add-solver`, and if needed add a
clarifying note that the dispute chat ECDH shared key is derived from the
admin's pubkey (see `admin-took-dispute` / dispute_chat.md) rather than from
`solver_pubkey`.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: ecf38a3c-c5e7-401e-a1fa-aeb27d14f1ae
📒 Files selected for processing (1)
src/restore_session.md
| * `trade_index`: trade index of that order. Used with the mnemonic seed to derive the same trade key pair already subscribed to it. | ||
| * `status`: current state of the dispute (e.g., `initiated`, `in-progress`). | ||
| * `initiator`: party that opened the dispute (`buyer` or `seller`). Tells the client whether the user or the counterparty started it. | ||
| * `solver_pubkey`: hex pubkey of the assigned solver, or `null` if none yet. Set once an admin assigns one via `admin-add-solver`. Also used to derive the ECDH shared key for the dispute chat. |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Search for ECDH derivation logic related to dispute chat and solver pubkey
# Look for ECDH or key derivation mentions in dispute documentation
rg -n -C5 --type=md 'ECDH|shared.?key|key.?deriv' src/dispute.md
# Search for chat-related dispute messages or encryption details
rg -n -C5 --type=md 'chat|encrypt' src/dispute.md
# Check if there are other docs mentioning dispute chat encryption
fd -e md -x rg -l 'dispute.*chat|chat.*dispute'Repository: MostroP2P/protocol
Length of output: 126
🏁 Script executed:
cat src/dispute_chat.mdRepository: MostroP2P/protocol
Length of output: 2102
🏁 Script executed:
cat src/restore_session.md | head -100Repository: MostroP2P/protocol
Length of output: 3634
Remove incorrect ECDH claim from solver_pubkey field description.
The claim that solver_pubkey is "used to derive the ECDH shared key for the dispute chat" is inaccurate. According to dispute_chat.md, the dispute chat ECDH key is derived using the admin's pubkey (sent in the admin-took-dispute message), not the solver's pubkey:
Shared Key = ECDH(tradeKey.private, adminPubkey)
The solver_pubkey identifies the dispute solver but is not involved in the ECDH key derivation. Remove this incorrect claim from the field description.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/restore_session.md` at line 90, Update the `solver_pubkey` field
description in the restore_session.md diff to remove the incorrect claim that it
is "used to derive the ECDH shared key for the dispute chat"; keep that it is
the hex pubkey of the assigned solver (or null) and is set via
`admin-add-solver`, and if needed add a clarifying note that the dispute chat
ECDH shared key is derived from the admin's pubkey (see `admin-took-dispute` /
dispute_chat.md) rather than from `solver_pubkey`.
disputesarray, notorders.solver_pubkeyfield to the dispute object, indicating the assigned solver for a dispute and its use for chat key derivation.solver_pubkeyfield.Summary by CodeRabbit
disputessection instead oforders.solver_pubkeyfield to dispute objects with explicit status values (initiated,in-progress) and initiator indicators (buyer,seller).