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

Protocol 19 - CAP-40 Signed Payload Signer #414

Merged
merged 7 commits into from
Mar 24, 2022

Conversation

sreuland
Copy link
Contributor

have reviewed these changes for CAP-40 Signed Payload Signer on PR #413. renamed source repo branch to 'protocol-19', triggered 413 to close, opened this PR on new branch name.

Update the Java SDK to have the new XDR schema for Protocol 19

this change focuses on supporting CAP-40 , namely the new Signed Payload Signer as new StrKey.

Update the StrKey encoding/decoding to include the new Signed Payload Signer, add more tests where signed payload signer could appear such as SetOptionsOperation and AccountEntry.

Closes #412
Closes #410

can ignore all changed files in src/main/java/org/stellar/sdk/xdr, they are generated code from xdrgen tool against the latest xdr schema files.

This is first half of Protocol 19 support, a follow-on PR will be coming for remaining Protocol 19 support of CAP-21 which introduces new tx pre-conditions on of which is extraSigners which this new Signed Payload Signer can be used.

Copy link
Contributor

@leighmcculloch leighmcculloch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ Did we, or are we, adding a function for signing a payload and generating a decorated signature to attach to a transaction? I couldn't see that functionality in this PR.

@sreuland
Copy link
Contributor Author

sreuland commented Apr 7, 2022

❓ Did we, or are we, adding a function for signing a payload and generating a decorated signature to attach to a transaction? I couldn't see that functionality in this PR.

Ok, have not done that aspect, just have the StrKey encode/decode updated for payload signer. Is that signature generation in the go client sdk for reference? I can get that in here. The encoded payload signer should go right into the Precondtions.ExtraSigners correct? And then I think need to add a AbstractTransaction.sign(SignedPayloadSigner signedPayloadSigner) to encapsulate both generation and adding the signedpayload decorated sig to the tx in one.

@leighmcculloch
Copy link
Contributor

The signing operation should be independent of a transaction, then let people add the signature manually. That's how the Go SDK works anyway.

https://github.com/stellar/go/blob/horizon-protocol-19/keypair/full.go#L115-L123
https://github.com/stellar/go/blob/master/txnbuild/transaction.go#L332-L341

@sreuland
Copy link
Contributor Author

sreuland commented Apr 8, 2022

The signing operation should be independent of a transaction, then let people add the signature manually. That's how the Go SDK works anyway.

@leighmcculloch , thanks for the references, I added similar convention into Java SDK, up for review on PR #415

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants