Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merkle inputs #8

Open
coderofstuff opened this issue Apr 23, 2023 · 1 comment
Open

Merkle inputs #8

coderofstuff opened this issue Apr 23, 2023 · 1 comment

Comments

@coderofstuff
Copy link
Owner

coderofstuff commented Apr 23, 2023

With a limited amount of memory in a ledger device, we cannot have more than some small number of inputs. In testing, a Nano S will only allow us to have 14 UTXOS in a transaction.

To support more UTXOs (an arbitrary number, so we're only limited by mass limit), use Merkle Trees.

Reference: https://www.youtube.com/watch?v=n6nEPaE7KZ8

Change in sign_tx APDU:

  1. First APDU will receive the version, output length, input length and merkle root
  2. For {0...input_length}: ask the client to give provide the input along with the merkle proof. Verify the merkle proof to legitimize the input.
  3. Request approval from user to continue with signing
  4. After all inputs are verified this way, For {0..input_length}: ask the client to give provide the input along with the merkle proof. This time, sign them then ask for the next input.
@coderofstuff coderofstuff converted this from a draft issue Apr 23, 2023
@coderofstuff
Copy link
Owner Author

This can be deferred since the input limit looks to only apply to a Nano S.

A Nano SP and Nano X can take up to 128 inputs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant