Skip to content

Document solver_pubkey in restore-session response#41

Open
BraCR10 wants to merge 1 commit intoMostroP2P:mainfrom
BraCR10:docs/restore-session-solver-pubkey
Open

Document solver_pubkey in restore-session response#41
BraCR10 wants to merge 1 commit intoMostroP2P:mainfrom
BraCR10:docs/restore-session-solver-pubkey

Conversation

@BraCR10
Copy link
Copy Markdown
Member

@BraCR10 BraCR10 commented Apr 25, 2026

  • 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.

Summary by CodeRabbit

  • Documentation
    • Updated restore session API response documentation to reflect new dispute handling semantics: disputed orders now appear exclusively in the disputes section instead of orders.
    • Added solver_pubkey field to dispute objects with explicit status values (initiated, in-progress) and initiator indicators (buyer, seller).

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.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 25, 2026

Walkthrough

Documentation update to the restore-session endpoint that restructures dispute representation. Disputed orders are relocated from the restore_data.orders collection to restore_data.disputes, and dispute objects are enhanced with solver assignment tracking and explicit status clarification.

Changes

Cohort / File(s) Summary
Restore Session Documentation
src/restore_session.md
Restructures dispute representation by moving disputed orders from restore_data.orders to restore_data.disputes, adds solver_pubkey field to dispute objects for solver assignment tracking, clarifies explicit dispute status values (initiated, in-progress), and updates field documentation to reflect the new schema organization.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

Suggested reviewers

  • grunch
  • Catrya
  • arkanoider

Poem

🐰 Disputes find their rightful home,
In a separate nest they now roam,
With solver's key and status clear,
The schema's now precisely dear!
No longer mixed with orders fine,
Each element shines in its line.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and concisely describes the main change: documenting the new solver_pubkey field in the restore-session response, which is the primary focus of the pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between f90c8ae and 18ab96d.

📒 Files selected for processing (1)
  • src/restore_session.md

Comment thread 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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 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.md

Repository: MostroP2P/protocol

Length of output: 2102


🏁 Script executed:

cat src/restore_session.md | head -100

Repository: 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`.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant