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

New encoding for P2SH address containing ErgoTree version #959

Open
aslesarenko opened this issue Apr 2, 2024 · 0 comments
Open

New encoding for P2SH address containing ErgoTree version #959

aslesarenko opened this issue Apr 2, 2024 · 0 comments
Labels
C-planning Category: Planning and roadmaps P2-medium Priority: Medium

Comments

@aslesarenko
Copy link
Member

Motivation

The current p2sh address implementation itself doesn't depend on ErgoTree version. Means the actual script can include anything supported by current (at the time of spending) network protocol. For example it can contain codes not yet implemented in v5.0, but those to be implemented in v6.0. In this case the box will be unspendable until v6.0 is activated.

The actual scriptbytes come from the context variable at the time of spending. Those are not ErgoTree (but serialized Value expression), thus don't have header and version. They can contain any bytes as long as deserialization is successfull. When a p2sh box is created, there is no check of those scriptbytes.

[by kushti in Discord]

I think tree version should be fixed for P2SH script.
Otherwise, with having the same P2SH I will get payments to different scripts before and after ErgoTree update.
Trackers will have to check all the tree versions then.
Another option is to include tree version byte to P2SH address, but then all the documentation around to be updated.

@aslesarenko aslesarenko added P2-medium Priority: Medium C-planning Category: Planning and roadmaps labels Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-planning Category: Planning and roadmaps P2-medium Priority: Medium
Projects
None yet
Development

No branches or pull requests

1 participant