Blockstream / Jade

Jade hardware wallet
MIT License
322 stars 50 forks source link

Compatibility of Jade with externally blinded txs on Liquid #21

Open stepansnigirev opened 3 years ago

stepansnigirev commented 3 years ago

It looks like Jade only can sign transactions that were blinded by Jade itself - values and assets are displayed correctly only if I pass commitments that contain hmac field received from Jade during blinding.

If I pass None for all commitments it displays garbage on screen and then throws an error:

JadeError: -32602 - Failed to verify asset_generator from commitments data

If I pass correct commitments but without hmac field - it throws a different error:

JadeError: -32602 - Failed to extract trusted commitments from parameters

This means that:

  1. It's not possible to use Jade in multisig unless Jade is creating the transactions (so 2 Jades will never be able to sign multisig transaction)
  2. It's not possible to use Jade for transactions containing outputs that are blinded by someone else (for example swaps, coinjoins or payjoins)

I suggest that you allow commitments that do not contain hmac field because HW still can verify correctness of asset commitment and value commitment just by running secp256k1_generator_generate_blinded and secp256k1_pedersen_commit.

Also would be nice if blinded outputs with unknown blinding factors are displayed as ??? for values and assets, not some random values.

JamieDriver commented 3 years ago

Acknowledged. Will add to backlog.

JamieDriver commented 3 years ago

I agree that the showing of junk outputs and only raising the error later is suboptimal.
In the interim I may just tidy it up to raise the error earlier if commitments are missing for blinded outputs.

Not arguing with the longer-term item to handle externally blinded outputs/txs - just until then probably cleaner/safer to error early.

JamieDriver commented 2 years ago

@stepansnigirev [Some of] this should be included in the next Jade fw release - 0.1.34. ie. sign-liquid-tx:

get-commitments:

[update 10th May] Also for this next fw release (0.1.34):

Outstanding atm:

JamieDriver commented 2 years ago

FYI 0.1.34 is now released, and should support generic liquid multisig and external blinding.