-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Description
The reasoning for this is to get a msg.sender-like signing flow in soroban, allowing a user to sign a single payload.
- The
HostFunctionenum will get two new values-HOST_FN_CALL_WITH_SOURCE- Same asHOST_FN_CALL, but will also pass along the source account to the host. Contracts can treat this source as msg.sender since it already passed signature verification in stellar-core.HOST_FN_CREATE_CONTRACT_WITH_SOURCE- This will create a contract using the newHashIDPreimage::ENVELOPE_TYPE_CONTRACT_ID_FROM_SOURCE, which will use the source account and a user provided salt.
The new xdr should look like -
enum HostFunction
{
HOST_FN_CALL = 0,
HOST_FN_CREATE_CONTRACT = 1,
// New
HOST_FN_CALL_WITH_SOURCE = 2,
HOST_FN_CREATE_CONTRACT_WITH_SOURCE = 3,
};
union HashIDPreimage switch (EnvelopeType type)
...
case ENVELOPE_TYPE_CONTRACT_ID_FROM_ED25519:
struct
{
uint256 ed25519;
uint256 salt;
} ed25519ContractID;
case ENVELOPE_TYPE_CONTRACT_ID_FROM_CONTRACT:
struct
{
Hash contractID;
uint256 salt;
} contractID;
//New
case ENVELOPE_TYPE_CONTRACT_ID_FROM_SOURCE:
struct
{
AccountID sourceAccount;
uint256 salt;
} sourceContractID;
};
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels