Skip to content

Enable Caller Context Preservation in Chain Extension for Staking Operations #2549

@khemrajregmi

Description

@khemrajregmi

Is your feature request related to a problem? Please describe.

At present, whenever a contract invokes the chain extension, the extension assigns the contract itself as the caller. This results in:

  • Loss of the original transaction sender context
  • Inability for users to move or manage their stake via contract calls
  • Limited composability for DeFi and staking abstractions

Describe the solution you'd like

Expected Behavior

The chain extension should support preserving or forwarding the original caller context (msg.sender equivalent), allowing:

  • Users to interact with staking logic through contracts
  • Stake operations to be executed on behalf of the actual caller, not the contract
  • More flexible and composable contract-based staking mechanisms

Proposed Solution

Introduce a modified or new chain extension that:

  • Allows passing the original caller as the effective actor in staking operations
  • Alternatively, provides a mechanism to explicitly specify the caller context when invoking the extension
  • Ensures proper authorization and security checks to prevent misuse

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions