Skip to content

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

Merged
rvagg merged 6 commits into
filecoin-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 into
filecoin-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

rvagg commented Nov 7, 2025

Copy link
Copy Markdown
Member

@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

hugomrdias commented Nov 7, 2025

Copy link
Copy Markdown

@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

rvagg commented Nov 24, 2025

Copy link
Copy Markdown
Member

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

BigLep commented Dec 1, 2025

Copy link
Copy Markdown
Member

@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

rvagg commented Jan 19, 2026

Copy link
Copy Markdown
Member

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>
0xDevNinja added a commit to 0xDevNinja/forest that referenced this pull request May 13, 2026
`forest-wallet sign` and `forest-wallet verify` now wrap the decoded
message with the FRC-0102 Filecoin signing envelope
(`\x19Filecoin Signed Message:\n<len>`) before handing it to the signer
/ verifier. This aligns Forest with the Ledger Filecoin app, Filsnap,
iso-filecoin and Lotus (filecoin-project/lotus#13388), so signatures
produced by any of these wallets over the same bytes now round-trip.

A new `--raw` flag restores the prior raw-bytes behaviour on both
commands. `--raw` is also the correct choice when signing on-chain
Filecoin messages, which must not be wrapped.

The envelope is applied client-side only; the Forest and Lotus
`WalletSign` / `WalletVerify` RPCs treat their input as opaque bytes,
so a single wrap here is correct against today's daemons.

BREAKING CHANGE: signatures produced by the default invocation are not
verifiable by pre-FRC-0102 Forest or Lotus releases without `--raw` on
the verifier side.

Refs ChainSafe#6442
0xDevNinja added a commit to 0xDevNinja/forest that referenced this pull request May 13, 2026
`forest-wallet sign` and `forest-wallet verify` now wrap the decoded
message with the FRC-0102 Filecoin signing envelope
(`\x19Filecoin Signed Message:\n<len>`) before handing it to the signer
/ verifier. This aligns Forest with the Ledger Filecoin app, Filsnap,
iso-filecoin and Lotus (filecoin-project/lotus#13388), so signatures
produced by any of these wallets over the same bytes now round-trip.

A new `--raw` flag restores the prior raw-bytes behaviour on both
commands. `--raw` is also the correct choice when signing on-chain
Filecoin messages, which must not be wrapped.

The envelope is applied client-side only; the Forest and Lotus
`WalletSign` / `WalletVerify` RPCs treat their input as opaque bytes,
so a single wrap here is correct against today's daemons.

BREAKING CHANGE: signatures produced by the default invocation are not
verifiable by pre-FRC-0102 Forest or Lotus releases without `--raw` on
the verifier side.

Refs ChainSafe#6442
0xDevNinja added a commit to 0xDevNinja/forest that referenced this pull request May 14, 2026
`forest-wallet sign` and `forest-wallet verify` now wrap the decoded
message with the FRC-0102 Filecoin signing envelope
(`\x19Filecoin Signed Message:\n<len>`) before handing it to the signer
/ verifier. This aligns Forest with the Ledger Filecoin app, Filsnap,
iso-filecoin and Lotus (filecoin-project/lotus#13388), so signatures
produced by any of these wallets over the same bytes now round-trip.

A new `--raw` flag restores the prior raw-bytes behaviour on both
commands. `--raw` is also the correct choice when signing on-chain
Filecoin messages, which must not be wrapped.

The envelope is applied client-side only; the Forest and Lotus
`WalletSign` / `WalletVerify` RPCs treat their input as opaque bytes,
so a single wrap here is correct against today's daemons.

BREAKING CHANGE: signatures produced by the default invocation are not
verifiable by pre-FRC-0102 Forest or Lotus releases without `--raw` on
the verifier side.

Refs ChainSafe#6442
0xDevNinja added a commit to 0xDevNinja/forest that referenced this pull request May 14, 2026
`forest-wallet sign` and `forest-wallet verify` now wrap the decoded
message with the FRC-0102 Filecoin signing envelope
(`\x19Filecoin Signed Message:\n<len>`) before handing it to the signer
/ verifier. This aligns Forest with the Ledger Filecoin app, Filsnap,
iso-filecoin and Lotus (filecoin-project/lotus#13388), so signatures
produced by any of these wallets over the same bytes now round-trip.

A new `--raw` flag restores the prior raw-bytes behaviour on both
commands. `--raw` is also the correct choice when signing on-chain
Filecoin messages, which must not be wrapped.

The envelope is applied client-side only; the Forest and Lotus
`WalletSign` / `WalletVerify` RPCs treat their input as opaque bytes,
so a single wrap here is correct against today's daemons.

BREAKING CHANGE: signatures produced by the default invocation are not
verifiable by pre-FRC-0102 Forest or Lotus releases without `--raw` on
the verifier side.

Refs ChainSafe#6442
0xDevNinja added a commit to 0xDevNinja/forest that referenced this pull request May 14, 2026
`forest-wallet sign` and `forest-wallet verify` now wrap the decoded
message with the FRC-0102 Filecoin signing envelope
(`\x19Filecoin Signed Message:\n<len>`) before handing it to the signer
/ verifier. This aligns Forest with the Ledger Filecoin app, Filsnap,
iso-filecoin and Lotus (filecoin-project/lotus#13388), so signatures
produced by any of these wallets over the same bytes now round-trip.

A new `--raw` flag restores the prior raw-bytes behaviour on both
commands. `--raw` is also the correct choice when signing on-chain
Filecoin messages, which must not be wrapped.

The envelope is applied client-side only; the Forest and Lotus
`WalletSign` / `WalletVerify` RPCs treat their input as opaque bytes,
so a single wrap here is correct against today's daemons.

BREAKING CHANGE: signatures produced by the default invocation are not
verifiable by pre-FRC-0102 Forest or Lotus releases without `--raw` on
the verifier side.

Refs ChainSafe#6442
0xDevNinja added a commit to 0xDevNinja/forest that referenced this pull request May 18, 2026
`forest-wallet sign` and `forest-wallet verify` now wrap the decoded
message with the FRC-0102 Filecoin signing envelope
(`\x19Filecoin Signed Message:\n<len>`) before handing it to the signer
/ verifier. This aligns Forest with the Ledger Filecoin app, Filsnap,
iso-filecoin and Lotus (filecoin-project/lotus#13388), so signatures
produced by any of these wallets over the same bytes now round-trip.

A new `--raw` flag restores the prior raw-bytes behaviour on both
commands. `--raw` is also the correct choice when signing on-chain
Filecoin messages, which must not be wrapped.

The envelope is applied client-side only; the Forest and Lotus
`WalletSign` / `WalletVerify` RPCs treat their input as opaque bytes,
so a single wrap here is correct against today's daemons.

BREAKING CHANGE: signatures produced by the default invocation are not
verifiable by pre-FRC-0102 Forest or Lotus releases without `--raw` on
the verifier side.

Refs ChainSafe#6442
0xDevNinja added a commit to 0xDevNinja/forest that referenced this pull request May 19, 2026
`forest-wallet sign` and `forest-wallet verify` now wrap the decoded
message with the FRC-0102 Filecoin signing envelope
(`\x19Filecoin Signed Message:\n<len>`) before handing it to the signer
/ verifier. This aligns Forest with the Ledger Filecoin app, Filsnap,
iso-filecoin and Lotus (filecoin-project/lotus#13388), so signatures
produced by any of these wallets over the same bytes now round-trip.

A new `--raw` flag restores the prior raw-bytes behaviour on both
commands. `--raw` is also the correct choice when signing on-chain
Filecoin messages, which must not be wrapped.

The envelope is applied client-side only; the Forest and Lotus
`WalletSign` / `WalletVerify` RPCs treat their input as opaque bytes,
so a single wrap here is correct against today's daemons.

BREAKING CHANGE: signatures produced by the default invocation are not
verifiable by pre-FRC-0102 Forest or Lotus releases without `--raw` on
the verifier side.

Refs ChainSafe#6442
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