State to provide the following to hardware wallet clients:
- State transitions based on low level message events
The "confirm sign transaction" state occurs in response to a SIGN_TX message and handles
the ongoing button requests, success and failure messages coming from the device as it
signs the transaction presented.
A typical sequence for signing a transaction would be as follows:
hash 0 is current, prev hash 0 is hash of parent to input 0
addressN is the co-ordinates of a receiving address (e.g. [0,1] as chain, address index)
- > SIGN_TX (input count, output count)
- < PIN_MATRIX_REQUEST
- > PIN_ACK (pin)
- < TX_REQUEST (current input 0)
- > TX_ACK (input 0: addressN, prev hash, prev index, script type
- < TX_REQUEST (meta, prev hash 0)
- > TX_ACK (prev hash 0: lock time, input count, output count)
- < TX_REQUEST (hash 0, input 0)
- > TX_ACK (hash 0: input 0: addressN, prev hash, prev index, script type
- < TX_REQUEST (request hash 0, output 0)
- > TX_ACK (hash 0: output 0: address, amount, script type)
- < TX_REQUEST (hash 0: output 1)
- > TX_ACK (hash 0: output 1: address, amount, script type)