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

legacy: Update op_return max size to 150 bytes #1559

Merged
merged 1 commit into from
Apr 6, 2021
Merged

legacy: Update op_return max size to 150 bytes #1559

merged 1 commit into from
Apr 6, 2021

Conversation

AlexITC
Copy link
Contributor

@AlexITC AlexITC commented Apr 2, 2021

The goal is to allow Trezor 1 to create TPoS contracts for Stakenet.

Last year, Stakenet introduced a hard-fork 1 to change the way TPoS contracts
are created, instead of a custom signature method, now it works with the
output from the signMessage method, while this works for Trezor T, it doesn't
work for Trezor 1 due to the 80 bytes limit on the OP_RETURN output while
Stakenet allows up to 150 bytes 2, in a gitter discussion 3 we concluded that
the change should be fine.

The hard-fork was introduced because we couldn't got our TPoS contracts PR accepted 4,
the OP_RETURN still contains the same data, its just stored in a different way:

  • The TPoS address, where the coins to stake are stored, and where rewards are received.
  • The merchant address, where the merchant receives its commission.
  • The contract commission.
  • The TPoS collateral signature (this is what uses the signMessage now).

At last, there is an example transaction creating a TPoS contract 5.

The goal is to allow Trezor 1 to create TPoS contracts for Stakenet.

Last year, Stakenet introduced a hard-fork [1] to change the way TPoS contracts
are created, instead of a custom signature method, now it works with the
output from the signMessage method, while this works for Trezor T, it doesn't
work for Trezor 1 due to the 80 bytes limit on the OP_RETURN output while
Stakenet allows up to 150 bytes [2], in a gitter discussion [3] we concluded that
the change should be fine.

The hard-fork was introduced because we couldn't got our TPoS contracts PR accepted [4],
the OP_RETURN still contains the same data, its just stored in a different way:
- The TPoS address, where the coins to stake are stored, and where rewards are received.
- The merchant address, where the merchant receives its commission.
- The contract commission.
- The TPoS collateral signature (this is what uses the signMessage now).

At last, there is an example transaction creating a TPoS contract [5].

[1]: X9Developers/XSN#154
[2]: https://github.com/X9Developers/XSN/blob/master/src/script/standard.h#L34
[3]: https://gitter.im/trezor/community?at=6064c41e940f1d555e2ea670
[4]: #140
[5]: https://xsnexplorer.io/transactions/858feb31097501cf68d698cde104cf778ec51ff3668e943404b549a5dd2f5792
@AlexITC AlexITC requested a review from prusnak as a code owner April 2, 2021 14:45
@prusnak prusnak removed their request for review April 2, 2021 14:51
@matejcik matejcik merged commit bb1c638 into trezor:master Apr 6, 2021
@AlexITC AlexITC deleted the trezor-1-update-bitcoin-op-return-max-size branch April 6, 2021 14:04
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

Successfully merging this pull request may close these issues.

None yet

2 participants