Zondax/ledger-stacks

Show amount while confirming Stacking delegation transaction

markmhendrickson opened this issue · 2 comments

The Stacks Wallet should cause the user's Ledger device to show the amount of STX they will be delegating for Stacking when confirming the transaction on their device.

See example of delegate-stx transaction with amount-ustx

Ledger is reporting that they need this enhancement in order to approve the Stacks app for removal of "developer mode".

From @tjulien-ledger at Ledger:

the actual amount staked when staking in a pool is not displayed on the device when signing the tx while users should be able to verify the amount they are staking.
we will require this feature for a public release.

From @jleni:

I think issue is that staking is a contract call and the amount is a kind of hidden argument of the call. Unless we know the destination hash is for staking.. we cannot guess the meaning of the arguments
we think it is relatively complex issue in the way Stacks work and it is not a bug or a small fix. Stacks contract calls contain this information and parsing depends on destination hashes. On a hardware wallet can be very hard to determine the semantics of a contract call parameters

@jleni please add any details about design changes needed for the Stacks Wallet to enable this

Following our call yesterday, and discussions on Slack, here are the requirements we've landed on:

For Ledger to remove the pending review warning, the device must:

  • Display argument index 0, labeled the amount of µSTX being stacked, of public function stack-stx on contract calls to contract addresses
    • SP000000000000000000002Q6VF78.pox mainnet
    • ST000000000000000000002AMW42H.pox testnet
  • Display argument index 0, labeled the amount of µSTX being delegated, of public function delegate-stx on contract calls to contract addresses:
    • SP000000000000000000002Q6VF78.pox mainnet
    • ST000000000000000000002AMW42H.pox testnet

The hash of the contract's address is 0000000000000000000000000000000000000000.

If possible, the device should display all contract arguments. These can only be labeled by index, as no purpose or description is included in the transaction's payload. This will give users additional confidence that the values they've entered are accurate.