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

SIP-37: Exposing ProgrammableTransaction data in TxContext in Move #37

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

thounyy
Copy link

@thounyy thounyy commented Jul 30, 2024

No description provided.

@wriches wriches changed the title Exposing ProgrammableTransaction data in TxContext in Move SIP-37: Exposing ProgrammableTransaction data in TxContext in Move Aug 7, 2024
@wriches wriches added the active Active SIPs that are either in Draft, Review, Fast Track or Last Call status. label Aug 7, 2024
@sblackshear
Copy link
Contributor

Thanks for writing this up! One question, would adding a function to TxContext returning a hash that commits to:

  • Commands
  • Non-gas input object ID's

also satisfy the requirement? This (of course) wouldn't give you the PTB itself on-chain--you'd have to post it elsewhere. But it would expose a lot less of the internal structure of PTBs, which is desirable for a number of reasons (more flexibility to extend/change, smaller protocol footprint, less invitation to write fragile Move code).

@thounyy
Copy link
Author

thounyy commented Aug 8, 2024

Yes for sure that's an option, only the pure arguments would be missing but I don't think it is a big issue. It also removes the goal of making the proposal human readable but it's not a primary requirement.

@sblackshear
Copy link
Contributor

Ah, I think we can (and probably should) include pure arguments in the hash as well

@thounyy
Copy link
Author

thounyy commented Aug 16, 2024

bcs serialized then hashed or you're thinking of something else?

@tnowacki
Copy link

bcs serialized then hashed or you're thinking of something else?

Pure arguments are simply a series of bytes with no type information, so we would use the bytes as is.
We would likely also just use the Object IDs, but we might maintain some of the object information in the hash, i.e. all of the information present in the argument structure (object ref, shared immutable, shared mutable, etc)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
active Active SIPs that are either in Draft, Review, Fast Track or Last Call status.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants