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

elements: support explicit transaction signing #473

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

romanz
Copy link
Contributor

@romanz romanz commented Aug 31, 2019

Implements initial support for Elements' transaction signatures (following #66).

Most of the code is similar to Bitcoin's, but there are a few deviations:

  • amount serialization is different (to support explicit & confidential assets).
  • segwit is enabled for all transactions and witness marker is not used.
  • BIP-143 serialization is a bit different (new issuance field and different amount type).
  • nLockTime is serialized before the witness.
  • there are more input-related witnesses (issuance, re-issuance & peg-in).
  • there are output-related witnesses (range-proof & surjection-proof).

In order to make the review easier, this PR adds supports only the explicit assets & values, without blinding/unblinding (depends on #317), peg-in & issuance support.

TODOs:

  • the UI is currently doesn't show the asset type being transacted.
  • uint64 amount and TxConfidentialValue confidential_value are not verified for equivalence.

@prusnak prusnak added this to the backlog milestone Aug 31, 2019
@prusnak prusnak added altcoin Any non-Bitcoin coins core Trezor Core firmware. Runs on Trezor Model T and T2B1. firmware labels Aug 31, 2019
Trusts the user to provide the correct confidential assets' values.
@ZdenekSL ZdenekSL added the feature Product related issue visible for end user label Nov 7, 2019
@romanz
Copy link
Contributor Author

romanz commented Feb 14, 2020

We have a PoC for signing Elements transactions (both explicit & confidential) at elements/wip branch, whose device tests work well on the emulator and the TREZOR model T device:

$ pipenv shell
$ pip install install 'git+https://github.com/romanz/python-elementstx@trezor'  # for Elements' transactions
$ PYOPT=0 make -C core clean build_unix build_firmware

$ (cd core; build/unix/micropython src/main.py &)  # Load emulator
$ py.test tests/device_tests/ -vvxsk elements

$ trezorctl firmware-update -f core/build/firmware/firmware.bin  # Load device
$ sudo cat /dev/ttyACM0 &
$ py.test tests/device_tests/ -vvxsk elements

Should I close this PR and open a new one?

@tsusanka tsusanka added the liquid label Aug 3, 2020
@tsusanka
Copy link
Contributor

tsusanka commented Aug 4, 2020

Hi there, thank you for your PR. I just wanted to give you a quick update from our side. We are interested in adding this to our firmware but we just don't have enough capacity to review it right now. We would be more than happy to take a closer look at it later, when our capacity frees up a little, likely during the course of 2021. Thank you for your understanding.

@tsusanka tsusanka removed the feature Product related issue visible for end user label Aug 4, 2020
@tsusanka tsusanka removed this from the backlog milestone Oct 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
altcoin Any non-Bitcoin coins core Trezor Core firmware. Runs on Trezor Model T and T2B1.
Projects
Status: 🔎 Needs review
Development

Successfully merging this pull request may close these issues.

4 participants