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

change constants to bytearray as g1/g2 elements are not in flat encoding #108

Closed

Conversation

perturbing
Copy link
Contributor

Hi,

Since the flat encoding of plutus does not allow the direct use of G1/G2 elements, any script will have to use the byte array representation of their points.

Since this is the case, this lib needs to export their constants as byte arrays and not G1/G2 elements.

@KtorZ
Copy link
Member

KtorZ commented Feb 20, 2025

Hey, this is already handled by the compiler just fine. So no worries, the points are uncompressed at runtime and hoisted where needed to be in scope.

@KtorZ KtorZ closed this Feb 20, 2025
@perturbing
Copy link
Contributor Author

AH okay, that's cool :)

And so it automatically changes any g1 / g2 point to a call to bls12_381_{G1/G2}_uncompress? And I assume this is also done in the costing of scripts and tests?

@KtorZ
Copy link
Member

KtorZ commented Feb 20, 2025

And I assume this is also done in the costing of scripts and tests

Kind of, it's part of the normal costing a UPLC program. It's just that Aiken guarantees uncompress is called only once per element and hoisted as "global constants" throughout the rest of the UPLC progam. This is simply "invisible" to you as a developer.

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.

2 participants