Engineering
Supercharge your Thought Machine Vault Core Smart Contract API v4 upgrades
Nov 17, 2023
5 min read
Background
Vault Core is a digital core banking system providing a real time ledger that maintain the current state of the bank’s account. Smart Contracts are internal code assets that run inside the Vault Core, containing the rules and logic of a financial product. They are self-executing, meaning that they run automatically when certain conditions are met, and to govern the product behaviour and the rules for modifying balances. They greatly enhanced flexibility through configuration updates without altering the underlying ledger platform code and allows banks to efficiently and safely create, test, and deploy new products into the market.
Benefit of Contract Language API 4
Since late 2022, Contract Language API 4 has been officially released and integrated into Vault Core 4.5. It represents a major update offering several key advantages for smart contract engineers:
- Improved Performance: This update significantly enhances the execution speed of the Smart Contract code, resulting in much faster performance. For instance, the
get_balance_timeseries
now executes almost twice as fast, andget_posting_instructions
is almost three times faster compared to API 3. - Enhanced Developer Experience: The Contracts Language API Python implementation code is now accessible through the
contracts_api
package. Developers can use it as regular Python modules, making them easy to import. Common coding tools like autocompletion, type annotations and linters are now supported during contrNact code development. - Accelerate Financial Product Development : The updated feature library in API 4 provide a richer and more powerful toolkit for contract writers, enhance code standardisation, promote reusability and improve testability of your code.
Considerations and Tips
To ensure a smooth transition of your smart contract to Contract Language API 4, there are several key considerations to keep in mind:
Considerations | Tips |
---|---|
Separate code migration work from BAU feature changes |
|
Invest in testing automation to streamline future upgrades |
|
Proactively managed Contract Language version to ensure continuous support and alignment to Vault Core releases |
|
Common Smart Contract Upgrade Patterns
Smart Contract upgrade is similar to other application upgrade projects, and below are some common patterns for considerations:
Pattern | Description | Pros | Cons | Effort Estimates |
---|---|---|---|---|
Selective Rewrite | Make changes to API 3 code on a need basis. Focus on replacing unsupported method to API 4 equivalent | Smallest rewrite effort compare to other two patterns | Not fully realising the benefits of API 4, including enhanced code structure, reusability and testability. | Low |
Function Wrapper | Implement a function wrapper to act as an adapter to the retired API 3 functions. The wrapper will translate the API 3 request and response to API 4 format. | Reduce the risk of changing the Smart Contract behaviour, as it retain the existing code structure | Mixing API 3 and 4 style formatting, could lead to code complexity and increased long term maintenance efforts | Medium |
Full Rewrite | Develop a new Smart Contract following API 4 best practice | Take full advantage of API 4 by embracing the new structure, better performance through utilisation of prebuilt libraries and guarantee compatibility for future upgrades | Higher effort to analyse the legacy code and refactor to API 4, for ensuring the same functional quality after the rewrite. | High |
What is Ikigai Digital Smart Contract Upgrade Accelerator?
Our accelerator aims to de-risk your delivery based on your needs and pattern selected.
We collaborate closely with our clients, prioritising a co-development strategy with their engineers, as we believe that knowledge transfer is fundamental for their long-term success.
In addition to that, we also provide a conversion package that contains:
- a standard project structure
- a comprehensive checklist with changes required for meta-data, import, data fetcher, hooks, internal functions and postings conversion
- an example function wrapper library
- a sample project plan and effort estimates
We consider Smart Contract upgrade is an opportunity to enhance development skillsets and align closer to the latest best practices.
How can we help?
Ikigai Digital has invested in technologies that enable us to deliver the latest Vault Core and Smart Contract version from planning to execution.
With a variety of engagement and service options, we can provide client with light touch for rapid delivery, through to establishing a Centre of Excellence (Vault Core CoE) to foster continuous engineering improvement and product innovation.
Find out more about how Ikigai Digital can help you with your next core banking adventure.
References
[1] Smart Contract and Vault Version Compatibility
Stay up to date
Every few weeks we share the latest insights and news from the world of fintech.
Enjoyed this post? Join our team
Join our team and help build the next generation of digital banks