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

Provide a getter host function for the contract executable #1509

Open
dmkozh opened this issue Jan 14, 2025 · 2 comments
Open

Provide a getter host function for the contract executable #1509

dmkozh opened this issue Jan 14, 2025 · 2 comments
Assignees
Labels
hostfunction Work on specific host functions

Comments

@dmkozh
Copy link
Contributor

dmkozh commented Jan 14, 2025

Currently it's impossible for a contract to learn anything about another contract's executable. There are several use cases for that, for example:

  • Bridge protocols might need to be able to distinguish between SAC and custom tokens when deploying tokens from Stellar on other chains (e.g. to handle SAC metadata in a special way)
  • Custom wallets might want to limit trust only to certain implementations. This is especially useful for the extensible, signature-less smart wallet implementations

In order to solve this, we can just provide a new host function that returns the executable (Wasm hash, or flag telling that this is SAC).

@dmkozh dmkozh added the hostfunction Work on specific host functions label Jan 14, 2025
@dmkozh dmkozh self-assigned this Jan 14, 2025
@leighmcculloch
Copy link
Member

This should be a github discussion in the stellar-protocol repo? so as to focus first on the use case and impact, rather than the implementation.

Bridge protocols might need to be able

The 'might need' makes it sound really unclear if this is needed, or what exactly the requirements would be.

@dmkozh
Copy link
Contributor Author

dmkozh commented Jan 15, 2025

This should be a github discussion in the stellar-protocol repo? so as to focus first on the use case and impact, rather than the implementation.

Sure, this is an issue to not forget about this. I'm planning to sketch a CAP and open a discussion. I don't think though there is much to discuss in terms of use cases, there have been a few already and in general this was something that was on the plate since even the Soroban launch.

The 'might need' makes it sound really unclear if this is needed, or what exactly the requirements would be.

What I meant to convey that some protocols need it, but I can't claim that all of them do. E.g. Axelar creates metadata for a token to be deployed on the other chain and needs to massage the SAC metadata bit to make it compatible with other chains' requirements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hostfunction Work on specific host functions
Projects
None yet
Development

No branches or pull requests

2 participants