Composability vs. Security: Rethinking contract-caller Restrictions in Stacks DeFi


Update: Good progress on the composability front.

Spoke with a lending protocol on Stacks — they’re planning to open up modularity paths, allowing third-party contracts to integrate more freely. Details TBD but promising direction.

Also flagged the contract-caller gating pattern to a BTC yield-bearing vault — they use it in their deposit function.

This ties into the broader Security Template discussion here: https://forum.stacks.org/t/security-trait-standards-for-clarity-access-control-pausable-contracts-more/18640 @Terese

The tension is real: gating to contract-caller is a sensible security default, but when every protocol adopts it, we end up with siloed DeFi that can’t compose. Ethereum’s strength wasn’t just smart contracts — it was permissionless composability. We should aim for that on Stacks while finding security patterns that don’t sacrifice it.

Friedger’s suggestion about using FT mint/burn as a guard (leveraging post-conditions) is interesting. Besides the xBTC retiring contract and Pillar’s smart wallet for extension calls, has anyone else implemented this pattern in production? @friedger

1 Like