Midnight dey Plan Make Smart Contract Fit Call Each Other Inside One Single Transaction
The upcoming upgrade would let developers connect reusable contract functions. The network’s roadmap lists private composability for the first quarter of 2027.
By SongMarketCap
Updated:
Midnight don announce say upgrade dey come wey go allow smart contracts to dey call each other inside the same transaction. Dem call the planned feature contract-to-contract execution, and e go give developers another way to join functions across applications wey dem build on top the privacy-focused network.
Midnight dey expect say the change go help builders extend the functionality wey contracts already get and reuse components when dem dey create more sophisticated contracts. The announcement no give activation date.
How Midnight Contracts Go Take Work Together
Smart contract na code wey define the operations wey one application fit perform. With the planned feature, one contract go fit call function inside another contract and use the result as part of the transaction.
The ability to join separate components together na wetin dem dey call composability. Developer fit design one application wey go make one contract check condition, then another contract go use the result to carry out operation. This one na just example of possible application design, no be product wey Midnight don announce.
Midnight Compact documentation include simpler example: one function go double the number wey person supply and then pass the result give function wey dey inside another contract. The example dey show how one contract fit call operation wey another define and provide the information wey e need.
The network still dey check say the calls wey contract declare match the calls wey dey inside the transaction. The calling contract go identify the expected target, entry point and cryptographic commitment wey tie to the inputs and outputs of the call. For the transaction to meet the correct validity condition, each declared call must match exactly one call for the same transaction segment.
Ledger 9 and Compact Development Tools
Cross-contract calls need Ledger 9 and Compact toolchain wey compatible, na the set of tools wey dem dey use compile Midnight contracts. The documentation talk say toolchains wey target Ledger 8 go reject these calls during compilation.
As the documentation last update reach, Midnight Preview, Preprod and Mainnet networks dey run Ledger 8. Because of that, contracts wey use the new calls never fit deploy for those public networks. Compact toolchain 0.35.0 dey target Ledger 9 and e include changes to the runtime interface for cross-contract calls.
The current Compact reference still describe restrictions on top how contracts fit call each other. Circular sequence, like contract A calling contract B and B come call A again, go fail at runtime. The documentation identify this one as current ledger limitation.
Midnight don release Ledger 9.1.0.0 for the next network hard fork. Software release and the tools wey target am different from activation of the corresponding capabilities for inside network.
[NEWSBREAK]
Privacy and the Roadmap for Composability
Midnight dey use zero-knowledge proofs to support applications wey fit verify conditions without showing all the information wey dey under. E contracts fit include public state wey dem record for the ledger plus private state wey dem keep for user device.
The contract design go determine the information wey go dey visible. Midnight Compact reference note say cross-contract call go reveal the address of the called contract and e require make developers consider disclosure when dem dey pass arguments between contracts. Connected application fit therefore include both public information and private data wey dem handle outside the public ledger.
Midnight roadmap list Private Composability for the first quarter of 2027. The project describe the goal as to make contracts fit call each other while dem still keep privacy for their respective data, so developers fit join private applications together to build bigger products.