filecoin-project / lotus

Reference implementation of the Filecoin protocol, written in Go
https://lotus.filecoin.io/
Other
2.83k stars 1.26k forks source link

Can not create a deal from a Ledger address #5386

Closed zhaoleistar closed 1 year ago

zhaoleistar commented 3 years ago

Describe the bug Can not create a deal from a Ledger address, get error with Ledger-Nano-S.

To Reproduce Steps to reproduce the behavior:

  1. Run './lotus client deal from=fXXXX'
  2. See error ERROR: failed to start deal: signing deal proposal failed: ledger can only sign chain messages

Expected behavior Using the ledger to create a deal

Version (run lotus version): Daemon: 1.4.0+git.e9989d0e4+api1.0.0 Local: lotus version 1.4.0+git.e9989d0e4

Additional context Add any other context about the problem here.

jennijuju commented 3 years ago

Blocked by https://github.com/Zondax/ledger-filecoin/issues/65

Beanow commented 2 years ago

The blocker seems to be merged, are there any other blockers? (Related #6960)

Beanow commented 2 years ago

Quoting from #6960

both are going to be cbor blobs and I don't see why the signing code couldn't handle deal proposals

While I don't know if this is what's actually blocking the issue, I do know Ledger apps are not supposed to do "blind signing" https://developers.ledger.com/docs/nano-app/functional-requirements/#blind-signing (not without explicit warnings anyway). For your own safety the messages are supposed to be interpreted and shown in human readable form on the Ledger display, so you can review what you're about to sign.

Edit: indeed it seems like the Ledger app implements a transaction parser https://github.com/LedgerHQ/app-filecoin/blob/3b213b3009f1e7395de258b9cc0140b71f8005c6/app/src/parser_impl.c#L368

But no UI action to blind sign something. Or sign deals. While of course the actual signing code is generic. https://github.com/LedgerHQ/app-filecoin/blob/3b213b3009f1e7395de258b9cc0140b71f8005c6/app/src/crypto.c#L109

rllola commented 2 years ago

I am looking into this issue. Could you specify which method it is calling ?

rjan90 commented 2 years ago

Hey @rllola!

Comment I got from Magik on this issue:

As a client you're not signing the PSD message, you're signing a DealProposal, and sending that to the miner.
Ledger currently can only sign messages, and DealProposal isn't a message

The Storage Provider then signs the PublishStorageDeals which is method number 4: https://github.com/filecoin-project/specs-actors/blob/0afe155bfffa036057af5519afdead845e0780de/actors/builtin/market/market_actor.go#L38 and https://github.com/filecoin-project/specs-actors/blob/0afe155bfffa036057af5519afdead845e0780de/actors/builtin/methods.go#L54-L64

TippyFlitsUK commented 1 year ago

Hi 👋

The Legacy Lotus Markets sub-system reached EOL at the end of the 31st January 2023.

This ticket is being marked as won't fix and closed as the Lotus Team will no longer be making any further fixes or enhancements to the legacy markets subsystem.

Please feel free to re-open this ticket in the new Boost markets sub-system repository at https://github.com/filecoin-project/boost if you feel that it is still relevant.

Many thanks 🙏