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

Add support for memos in Soroban auth (CAP-64). #229

Merged
merged 1 commit into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Stellar-ledger-entries.x
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,8 @@ enum EnvelopeType
ENVELOPE_TYPE_OP_ID = 6,
ENVELOPE_TYPE_POOL_REVOKE_OP_ID = 7,
ENVELOPE_TYPE_CONTRACT_ID = 8,
ENVELOPE_TYPE_SOROBAN_AUTHORIZATION = 9
ENVELOPE_TYPE_SOROBAN_AUTHORIZATION = 9,
ENVELOPE_TYPE_SOROBAN_AUTHORIZATION_V2 = 10
};

enum BucketListType
Expand Down
27 changes: 26 additions & 1 deletion Stellar-transaction.x
Original file line number Diff line number Diff line change
Expand Up @@ -569,10 +569,22 @@ struct SorobanAddressCredentials
SCVal signature;
};

struct SorobanAddressCredentialsV2
{
ExtensionPoint ext;

SCAddress address;
int64 nonce;
uint32 signatureExpirationLedger;
Memo txMemo;
SCVal signature;
};

enum SorobanCredentialsType
{
SOROBAN_CREDENTIALS_SOURCE_ACCOUNT = 0,
SOROBAN_CREDENTIALS_ADDRESS = 1
SOROBAN_CREDENTIALS_ADDRESS = 1,
SOROBAN_CREDENTIALS_ADDRESS_V2 = 2
};

union SorobanCredentials switch (SorobanCredentialsType type)
Expand All @@ -581,6 +593,8 @@ case SOROBAN_CREDENTIALS_SOURCE_ACCOUNT:
void;
case SOROBAN_CREDENTIALS_ADDRESS:
SorobanAddressCredentials address;
case SOROBAN_CREDENTIALS_ADDRESS_V2:
SorobanAddressCredentialsV2 addressV2;
};

/* Unit of authorization data for Soroban.
Expand Down Expand Up @@ -729,6 +743,17 @@ case ENVELOPE_TYPE_SOROBAN_AUTHORIZATION:
uint32 signatureExpirationLedger;
SorobanAuthorizedInvocation invocation;
} sorobanAuthorization;
case ENVELOPE_TYPE_SOROBAN_AUTHORIZATION_V2:
struct
{
ExtensionPoint ext;

Hash networkID;
int64 nonce;
uint32 signatureExpirationLedger;
Memo txMemo;
SorobanAuthorizedInvocation invocation;
} sorobanAuthorizationV2;
};

enum MemoType
Expand Down