An Introduction to Nano Contracts

Hathor Labs
5 min readFeb 10, 2023

--

Complexity vs functionality

Have you tried creating a digital asset on another platform before and failed? Do you think developing your own smart contracts is too risky, but you might give it a try if it was simple enough and affordable? Do you have an idea for a use case that requires zero fees? Then Hathor Network and Nano Contracts could be ideal for you.

Feature creep can be dangerous if you allow it into your product. As some of the older blockchain networks are now beginning to realize, an ever-increasing protocol complexity is difficult to stop, almost impossible to reverse, and could eventually become a serious threat to the network. Because adding complexity adds risk. Creating workarounds to temporarily solve scalability issues and allow you to keep growing as a network adds complexity and, thereby, also, risks.

EVM compatibility and Turing completeness are features you will probably need if your aim is to support every single use case out there. However, common for both of them is they add complexity and risk.

At Hathor, we want to move in the opposite direction from most other networks. We believe there is a gap in the market today that we can fill by striking the right balance between complexity and functionality and delivering user and developer experiences that far exceed what is available in the market today. Nano Contracts should be simple, safe, secure, and composable.

To achieve this, we need to minimize complexity and risk while still building solutions that are useful to the majority of people. This requires difficult and constant tradeoffs between complexity and protocol functionality. However, we understand our main purpose well and can manage our complexity accordingly.

What are Nano Contracts?

Our vision at Hathor is to provide plug-and-play blockchain solutions and be the first choice for builders. What does that mean? And who are the builders? To ensure that we’re all on the same page, let’s start by explaining the concept of Nano Contracts.

Nano Contracts are simplified smart contracts that won’t require any coding knowledge to set up in their simplest form. A simple user interface in the wallet will enable anyone to configure a contract to add logic and a use case to their token. This can all be done in minutes.

There will be a set of pre-made Nano Contract blueprints that anyone can configure. A Nano Contract is an instance of a blueprint, like an object is an instance of a class in object-oriented programming languages.

Software often comes with templates for common types of documents, presentations, or tasks, and Nano Contracts are no different. These blueprints will be like templates for Nano Contracts, and using them will be as simple as selecting a blueprint and configuring the variables for your contract. There will be a selection of blueprints available catered toward different use cases.

We are also considering letting developers write their own blueprints in Python. This means a more accessible entrance for established non-blockchain developers who won’t have to learn any new blockchain-specific languages. Creating your own blueprints will allow for more flexibility and complex custom logic when the pre-made templates don’t entirely cover the needs of your specific use case.

Like custom tokens on Hathor, Nano Contracts will be native, built into the protocol itself. Having native tokens and contracts means you get the same level of security for all assets issued on the network, mitigating the risk of bugs and security issues that we often see with custom development on other platforms.

Every Nano Contract on the network will have been verified, and this approach will eliminate rugs and exploits caused by contract vulnerabilities, whether intentional by the developer or not. In addition, by only allowing verified contracts, we remove the possibility of any ill-intentioned developers replacing secure and audited contracts with malicious ones.

We have seen this happen with projects on other platforms. In a successful hack on Ethereum, the project developers swapped the safe contract — which had passed a security audit — with a malicious one where they had snuck in a call function, allowing them to withdraw all funds. That was just one of many examples of how smart contract audits often aren’t enough (for the record, in this case, the vulnerability was flagged in the audit, but the developers were still able to pull the rug).

The level of transparency and pre-configured, native functionality we aim for leaves much less room for exploits and developer blunders, creating a safer, more user-friendly ecosystem for all participants.

The legacy industries

Perhaps most importantly, we believe this approach to smart contracts will be a door opener for risk-averse legacy companies looking for a safe way to explore blockchain technology.

These are businesses operating across different industries and sectors, usually with limited technical resources and an understanding of the technology. They often find themselves in an exploratory phase, seeking information about blockchain and how other businesses are using it to solve similar problems.

Often uneducated and with tight budgets, they prefer to do as little development as possible and keep the focus on their core activities and business value. The technical complexities and operational overhead involved in creating, configuring, and operating a blockchain integration and maintaining its infrastructure often act as a barrier for these companies.

Launching their project in Hathor’s low/no-code environment lets these less technical businesses launch an MVP with minimal hassle and quickly test their hypothesis. At low and predictable costs, they can experiment with how their software can integrate with a blockchain and where the intersections could lead.

Who are the builders?

Going back to our vision of attracting builders to Hathor, with Nano Contracts, it seems clear that the definition of a builder is about to be expanded. A builder on Hathor is no longer just the engineer working at a big enterprise, or the hobby developer working out of his mom’s basement, it’s literally any crypto enthusiast who has a few HTRs in the Hathor Wallet.

This puts pressure on us to deliver the APIs and documentation needed for developers to bring complex use cases to life. We must also create a great, simple UX in the wallet that anyone can use to launch their blockchain project. The creator tools must be top-notch for all types of builders.

What’s next?

We are currently working with selected use case partners who are helping us test the features available so far, and together we will learn, adapt, and improve. Once we feel comfortable and ready, we will make the testnet publicly available so that everyone can join the fun and get a glimpse of the future of smart contracts.

Stay tuned for the next articles in this series, where we will look at various technical aspects of Nano Contracts, such as data models, blueprints, economics, UI/UX, wallets, APIs, etc. We will also present some of the testing partners who want to tell you all about what they are building!

Hathor Network is a PoW-based novel distributed ledger architecture that combines DAG and blockchain data structures. Our network’s unique design is built with scalability, usability, and decentralization in mind and solves significant bottlenecks preventing the broad adoption of the technology.

Hathor Network has been on mainnet since January 2020, experiencing exponential growth in the number of custom tokens, active wallets, and mining hash rate.

Please visit our Website, Twitter, Discord, and Telegram channel for more information.

--

--