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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Add self.address to the Aleo instructions #2372

Open
snowtigersoft opened this issue Feb 24, 2024 · 0 comments
Open

[Feature] Add self.address to the Aleo instructions #2372

snowtigersoft opened this issue Feb 24, 2024 · 0 comments

Comments

@snowtigersoft
Copy link

馃殌 Feature

Add self.address to the Aleo instructions & Leo

Motivation

The ability to reference a program's own address within its instructions is a crucial feature that's currently missing in snarkVM. As it stands, to utilize a program's address within the program itself, one must pre-calculate this address before deployment. This process is prone to errors, especially during program upgrades, where there's a risk of mistakenly using an old program's address. Incorporating a self.address feature directly into the instructions would significantly streamline development, reduce errors, and facilitate smoother program upgrades.

This feature request is motivated by the practical need to reference the deploying program's address more dynamically and accurately within the Aleo ecosystem. It relates to the broader goal of enhancing developer experience and program reliability on the platform.

Implementation

To support this feature in snarkVM:

  • Introduce a new instruction, self.address, that when called, returns the address of the current program.
  • This addition would require modifications to the snarkVM instruction set and possibly the execution environment to correctly interpret and execute this new instruction.
  • Ensure that self.address an be seamlessly integrated into existing and future Aleo programs without breaking changes.
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

No branches or pull requests

1 participant