Skip to content

feat(cli): add FRC-102 compatible EIP-191 signing via --fevm flag (#13256)#13388

Merged
rvagg merged 6 commits intofilecoin-project:masterfrom
aceppaluni:feat/frc-102-signing
Jan 19, 2026
Merged

feat(cli): add FRC-102 compatible EIP-191 signing via --fevm flag (#13256)#13388
rvagg merged 6 commits intofilecoin-project:masterfrom
aceppaluni:feat/frc-102-signing

Conversation

@aceppaluni
Copy link
Copy Markdown
Contributor

Related Issues

This PR aims to fix Issue #13256

Proposed Changes

This PR updates the lotus wallet sign command to implement FRC-102, allowing users to sign messages with an EIP-191 (Ethereum-style) prefix for FEVM compatibility.

Additional Info

  • Added --fevm flag to wallet sign command.
  • Prepends the appropriate prefix to messages before signing (EIP-191 for FEVM, Filecoin prefix for native messages).
  • Supports interoperability with other Filecoin wallets using FRC-102.
  • Returns signatures in the same format as the existing command.

Checklist

Before you mark the PR ready for review, please make sure that:

@aceppaluni
Copy link
Copy Markdown
Contributor Author

Hi all 👋 Just wanted to follow up on this PR.
No rush.
Please let me know if there’s anything I can update to help move it forward!

@rvagg
Copy link
Copy Markdown
Member

rvagg commented Nov 7, 2025

@hugomrdias @eshon @bumblefudge can you help us out here -- this PR does two things, it changes the default signature to be the version 0x45 (E) style signature but adds a --fevm argument to do the version 0x46 (F) style signature. I don't use this API for signing and I don't know what current users would expect but this would be a breaking change.
There are 4 variants in FRC-0102, should we support all of them and a bare form for backward compatibility? We could do --type=[0|1|E|F|bare] (defaulting to F perhaps?). What do ledger and filsnap do here?

Comment thread cli/wallet.go Outdated
@github-project-automation github-project-automation Bot moved this from 📌 Triage to ⌨️ In Progress in FilOz Nov 7, 2025
@hugomrdias
Copy link
Copy Markdown

hugomrdias commented Nov 7, 2025

@hugomrdias @eshon @bumblefudge can you help us out here -- this PR does two things, it changes the default signature to be the version 0x45 (E) style signature but adds a --fevm argument to do the version 0x46 (F) style signature. I don't use this API for signing and I don't know what current users would expect but this would be a breaking change. There are 4 variants in FRC-0102, should we support all of them and a bare form for backward compatibility? We could do --type=[0|1|E|F|bare] (defaulting to F perhaps?). What do ledger and filsnap do here?

in this command we only care about 0x46 "personal_sign", filsnap and ledger only implement 0x46 for personal messages.

yes, its a breaking change there no more unprefixed signatures exactly frc-0102 purpose

https://github.com/hugomrdias/filecoin/blob/main/packages/iso-filecoin/src/wallet.js#L274-L285

@rvagg
Copy link
Copy Markdown
Member

rvagg commented Nov 24, 2025

in this command we only care about 0x46 "personal_sign", filsnap and ledger only implement 0x46 for personal messages.

OK, @aceppaluni would you mind please just removing the --fevm and the branch that allows that and just going with the 0x46 prefixed version for all signing.

But then also, we need to fix the "verify" command to be the reverse of "sign", so it also needs to know about the prefix. When you're done, you should be able to pass the output of "sign" to "verify" and it pass.

@BigLep BigLep requested a review from rvagg December 1, 2025 19:20
@BigLep BigLep marked this pull request as draft December 1, 2025 19:20
@BigLep
Copy link
Copy Markdown
Member

BigLep commented Dec 1, 2025

@aceppaluni : please fil any CI checks that are failing (e.g., gofmt) and then go ahead and mark "ready for review" (assuming other feedback has been incoporated).

@aceppaluni aceppaluni force-pushed the feat/frc-102-signing branch from b7a7a9b to 70006d9 Compare December 2, 2025 23:24
@aceppaluni aceppaluni marked this pull request as ready for review December 3, 2025 14:31
@rjan90 rjan90 moved this from ⌨️ In Progress to 🔎 Awaiting Review in FilOz Dec 3, 2025
@rvagg rvagg force-pushed the feat/frc-102-signing branch from 70006d9 to 44474fd Compare January 19, 2026 02:52
Apply the FRC-0102 "Filecoin Signed Message" envelope by default when
signing arbitrary messages, ensuring compatibility with Ledger, FilSnap,
and iso-filecoin. Add --raw flag to preserve raw signing for backward
compatibility.

Fixes filecoin-project#13256
Fixes filecoin-project#13373
@rvagg
Copy link
Copy Markdown
Member

rvagg commented Jan 19, 2026

I've just noticed we have 3 issues that this will close:

So to get them off the board I've been a bit heavy handed in here and did a bunch of clean up, expanded tests, got the prefix correct (I think it got messed up somewhere in a merge/rebase) and a --raw flag working.

Thanks for the work on this @aceppaluni.

@github-project-automation github-project-automation Bot moved this from 🔎 Awaiting Review to ✔️ Approved by reviewer in FilOz Jan 19, 2026
@rvagg rvagg merged commit fc09aeb into filecoin-project:master Jan 19, 2026
95 checks passed
@github-project-automation github-project-automation Bot moved this from ✔️ Approved by reviewer to 🎉 Done in FilOz Jan 19, 2026
nijoe1 added a commit to nijoe1/lotus that referenced this pull request Jan 26, 2026
* fix(grammar): fix article usage in comments (filecoin-project#13465)

fix grammar in comments

* chore: bump filecoin-ffi to v1.34.5 (filecoin-project#13466)

chore: bump filecoin-ffi to v1.34.5

* chore: fix method name (filecoin-project#13468)

Signed-off-by: oncecelll <oncecell@outlook.com>

* feat(cli): implement FRC-0102 signing envelope for wallet sign/verify (filecoin-project#13388)

Apply the FRC-0102 "Filecoin Signed Message" envelope by default when
signing arbitrary messages, ensuring compatibility with Ledger, FilSnap,
and iso-filecoin. Add --raw flag to preserve raw signing for backward
compatibility.

Fixes filecoin-project#13256
Fixes filecoin-project#13373

---------

Signed-off-by: Angelina <aceppaluni@gmail.com>
Co-authored-by: Rod Vagg <rod@vagg.org>

* feat: add ordering by nonce flag to get sequential messages (filecoin-project#13394)

* fix: skip sender

* feat: remove maybe-modify-actor

* chore: removed unused args

* chore: updated filecoin-ffi gitmodule with new apply message for simulation function https://github.com/nijoe1/filecoin-ffi/tree/feat/apply-message-for-simulation

---------

Signed-off-by: oncecelll <oncecell@outlook.com>
Signed-off-by: Angelina <aceppaluni@gmail.com>
Co-authored-by: Aliz Fara <alizfaraafa@gmail.com>
Co-authored-by: Phi-rjan <orjan.roren@gmail.com>
Co-authored-by: oncecelll <oncecell@outlook.com>
Co-authored-by: aceppaluni <113948612+aceppaluni@users.noreply.github.com>
Co-authored-by: Rod Vagg <rod@vagg.org>
Co-authored-by: Sambhav Jain <136801346+DarkLord017@users.noreply.github.com>
nijoe1 added a commit to nijoe1/lotus that referenced this pull request Jan 26, 2026
* fix(grammar): fix article usage in comments (filecoin-project#13465)

fix grammar in comments

* chore: bump filecoin-ffi to v1.34.5 (filecoin-project#13466)

chore: bump filecoin-ffi to v1.34.5

* chore: fix method name (filecoin-project#13468)

Signed-off-by: oncecelll <oncecell@outlook.com>

* feat(cli): implement FRC-0102 signing envelope for wallet sign/verify (filecoin-project#13388)

Apply the FRC-0102 "Filecoin Signed Message" envelope by default when
signing arbitrary messages, ensuring compatibility with Ledger, FilSnap,
and iso-filecoin. Add --raw flag to preserve raw signing for backward
compatibility.

Fixes filecoin-project#13256
Fixes filecoin-project#13373

---------

Signed-off-by: Angelina <aceppaluni@gmail.com>
Co-authored-by: Rod Vagg <rod@vagg.org>

* feat: add ordering by nonce flag to get sequential messages (filecoin-project#13394)

* fix: skip sender

* feat: remove maybe-modify-actor

* chore: removed unused args

* chore: updated filecoin-ffi gitmodule with new apply message for simulation function https://github.com/nijoe1/filecoin-ffi/tree/feat/apply-message-for-simulation

---------

Signed-off-by: oncecelll <oncecell@outlook.com>
Signed-off-by: Angelina <aceppaluni@gmail.com>
Co-authored-by: Aliz Fara <alizfaraafa@gmail.com>
Co-authored-by: Phi-rjan <orjan.roren@gmail.com>
Co-authored-by: oncecelll <oncecell@outlook.com>
Co-authored-by: aceppaluni <113948612+aceppaluni@users.noreply.github.com>
Co-authored-by: Rod Vagg <rod@vagg.org>
Co-authored-by: Sambhav Jain <136801346+DarkLord017@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🎉 Done

Development

Successfully merging this pull request may close these issues.

5 participants