-
Notifications
You must be signed in to change notification settings - Fork 356
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
Allow external signers to modify the payload #6030
Conversation
Yea I agree with the general sentiment above. When I first wrote this it was to maintain some level of integrity around the original Call Data (so that the original validation before all the changes wouldn't be to drastic). That being said I think it's okay to move forward with this change, and accept that the control should really be on the wallet/extension.
Side note: I believe this was already available. |
I would like to note as well - this was discussed in the past with the PAPI team, and internal teammates. We did favor this general direction but in the future. Now that the future is here and the topic is put forth I am backing it. That being said - should be NOTED that this is a BREAKING CHANGE. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Holding off on merging until there is a bit more discussion - I am in favor but believe I shouldn't be the only one who decides here.
Papi has this by default, this is something I discussed with the team, @josepot can confirm. |
Definitely in favor of this ❤️ |
I’ve always been vocal about the importance of enabling extensions to alter the payload of call-data. However, as @Tbaut rightly pointed out:
Indeed, from the perspective of a PJS DApp developer, this change represents a significant shift in behavior, breaking the expectations that the library has established since its inception. Here are my thoughts on the possible paths forward:
Among these, my preferred approach is Option 2, while my least favorite is Option 3 (what this PR is currently doing). Although I’m not a user of PJS myself, I believe it’s important to uphold the guarantees that the library has provided to its consumers from day one. Completely removing a guarantee without offering a fallback feels like a misstep in terms of DX and expectations. |
Thanks for the feedback. Option 2 is the best IMHO so that nobody has to chase Dapps dev to add a flag. I'll change the PR. |
I have seen certain "DApps" (like the ones used for inscriptions and stuff like that), which included a tip in the form of a transfer inside a batch_all, for example. I think that those DApps would use the I don't know, maybe I'm reading too much into it. However, it feels right to leave that option somewhere, just in case. |
I added an optional |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 👍 - this will reflect as a Major Change in the next release.
I just realized that changing default behavior could lead to issues out there. if wallet changes anything to the payload before signing, dapps that didn't upgrade their pjs library to next release yet will break. Or did i miss something ? |
Nevermind, read it again and we re good. |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This is a tiny change, that has a lot of consequences.
I want to allow extensions and generally external signers, to change the payload. This way, wallets can have much more complex structure, and knowledge about accounts, e.g, it allows wallets to support proxies and multisigs, without the Dapp to know about it. Extensions can now wrap the payload with
proxy.proxy
, ormultisig.asMulti
This seems to be a failsafe, and I'd argue that the feature to check the payload isn't actually that important:
This also allows wallets to let users change the tip, nonce etc.. like in the Ethereum ecosystem.