Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mostro panics when attempting to unwrap a message sent in "full privacy" mode #414

Closed
chebizarro opened this issue Jan 3, 2025 · 3 comments
Assignees

Comments

@chebizarro
Copy link

According to the Mostro docs, a user can enable "full privacy" and the client sends null instead of the hashed and signed contents of the first order field:

https://github.com/MostroP2P/protocol/blob/b78f19d6ef2b81be9c02c0738a352bc080acd3d1/src/key_management.md?plain=1#L121-L163

When I attempt to do this with the mobile client, it causes the mostro daemon to panic and crash with the following message:

thread 'main' panicked at src/app.rs:254:68:
called `Result::unwrap()` on an `Err` value: Error("invalid type: null, expected a hex string representing 64 byte schnorr signature", line: 1, column: 333)

The error occurs because mostro attempts to initialize the order and the signature here, expecting the signature to be non-null, which is different from the documentation:

mostro/src/app.rs

Lines 253 to 254 in 98a6b4d

let (message, sig): (Message, Signature) =
serde_json::from_str(&event.rumor.content).unwrap();

Since the trade index check doesn't occur until after the signature is extracted, it doesn't seem as if full privacy is currently implemented. I could be missing something, but the client is generating messages that comply with the protocol documentation.

@grunch
Copy link
Member

grunch commented Jan 3, 2025

Can you paste here the event you are sending?

@grunch
Copy link
Member

grunch commented Jan 3, 2025

I push a fix, please give it a look, if you keep having issues let me know

#415

@chebizarro
Copy link
Author

PR #415 fixes this issue

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

No branches or pull requests

2 participants