KrypC builds award-winning taXchain for EU tax forms new case study >

Skip to main content
Hyperledger Foundation
search
Menu
  • Learn
    • Case Studies
    • White Papers
    • Training & Certification
    • Training Partners
    • Webinars
    • Research
    • Blockchain Showcase
    • Wiki
  • Use
    • Distributed Ledgers
    • Domain-Specific
    • Libraries
    • Tools
    • Tutorials
    • Hyperledger Certified Service Providers
    • Vendor Directory
  • Participate
    • Collaboration Tools
    • Contribute to Coding
    • Academic Collaboration
    • Find a Meetup
    • Regional Communities
    • Speakers Bureau
    • Join a Community Group
    • Labs
  • Events
  • News
    • Blog
    • Announcements
    • Newsletter
  • About
    • Join Hyperledger
    • Members
    • Leadership
    • Charter
    • Job Board
    • Contact Us
  • Join
  • English
    • 简体中文
    • Português
    • Français
    • Malayalam
    • 日本語
    • Español
  • search
Close Search
Tag

smart contracts

Jan 13
Love0

Driving new markets: The opportunities ahead for enterprise blockchain technologies

By Daniela Barbosa, Executive Director at Hyperledger Foundation and General Manager, Blockchain and Identity for the Linux Foundation Blog, Finance, Hyperledger Foundation Staff Corner

While volatility reigned supreme in 2022, here at Hyperledger Foundation we are looking ahead with great excitement to what is possible in 2023. When CEOs of companies like Goldman Sachs and BNY Mellon are penning articles on the long-term value of distributed ledger and blockchain technology, we know the work our community is doing is building markets and creating opportunities. Hyperledger Foundation has been at the forefront of advancing open-source technologies that are transforming the way businesses operate. Since 2016, organizations around the world have been deploying these technologies to optimize speed, security, efficiency and trust in global markets and industries.

Blockchain’s value has already been established in a number of enterprise use cases: provenance tracking, logistics, cross border payments and more, where it is adding efficiency and cutting costs, while saving time and labor. One such proven example is the application of Hyperledger technologies in the partnership between MineHub and KrypC that has utilized Hyperledger Fabric to drastically improve upon the infrastructure necessary to power the supply chain of the mining industry. GSBN has also built a Global Trade Operating Platform with Hyperledger Fabric as the foundation. The historical lack of on-demand data in the shipping industry left the supply chain vulnerable to disruptions such as the Covid-19 pandemic. But with a single, efficient, immutable source of on-demand data, such disruptions can be dealt with much more effectively. 

Now, there are a number of new and increasingly interesting markets and applications, especially tied to digital assets and tokenization, that are moving to the forefront of this market. The traditional infrastructure that powers the global financial system is slow, especially in comparison to the benefits blockchain technology provides. While data and information can already traverse the globe in seconds or less, value is not yet fully capable of moving at this speed or with the same efficiency. Although assets may appear to move instantaneously with the various online financial tools currently at our disposal, the movement of value itself is still quite slow. Settlement time for transactions still takes days and requires very expensive and lengthy processes in order to complete transactions properly. 

Blockchain technology’s ability to alleviate friction in our current regulatory, financial and operational systems is in its capabilities as a piece of highly effective transactional and record keeping machinery. Anything can be bought, sold, transferred and accounted for on a blockchain, with data pertaining to those transactions stored on a distributed and immutable ledger for everyone included in the network to see. Asset tokenization enables the purchase, sale and exchange of digital assets, representative of potentially any asset, traditional or otherwise. This process facilitates the transfer of off-chain real-world assets’ economic value and ownership onto the blockchain.

By accelerating and improving the fractionalization of new asset classes, tokenization will expand the range of available and acceptable collateral beyond traditional assets. Tokenized representations of traditional assets such as cash, bonds, securities and equities, and even physical commodities like gold, stand to be a crucial evolution that will underpin future market infrastructure, just as computerized ledgers were transformational to the previous paper-based generation. 

The progress made possible by distributed ledger technologies (DLTs) has enabled a much more capable and comprehensive system to verify assets and track their value. The foundational code of digital smart contracts, which automate the execution of an agreement between parties, are central to enabling this progress. Codified to self-verify and self-execute, smart contracts scale down on the time, formality and costs associated with traditional methods, without compromising on authenticity or credibility. In the past, banks have had to commit robust teams to uphold transactions from client to client, processing each piece of data manually and redirecting value as necessary. With smart contracts, that process occurs automatically, making them more effective and efficient than any traditional centralized entity while also fostering trust and presenting more transparent governance. 

The key to widespread adoption of new, automated systems as the rails for widespread, cross-market transactions is creating a trusted technology infrastructure. At Hyperledger Foundation, we believe that open, shared development of the foundational technologies are central to meeting diverse business, consumer, and regulatory needs. Only through the application of open-development and open-source DLTs can we create trusted technology to serve as the backbones for these new financial systems. 

Asset tokenization on open-source, open-governed distributed ledgers offers a solution to much of the inherent economic friction of the current global economy and has the potential to unlock a staggering amount of value. And the work has already begun. Using its new tokenization platform, Goldman Sachs arranged a €100 million two-year digital bond for the European Investment Bank with two other banks, all based on a private blockchain. Using traditional financial instruments, it would take a bond sale like this roughly five days to settle. It took just 60 seconds when tokenized on a private blockchain. Reducing settlement time will lower costs across the entire market for banks, customers and even regulators, making markets incredibly more efficient. 

The use cases for this technology extend into the public sector as well. Hyperledger’s DLTs have been at the forefront of innovation and tokenization in the global exploration and development of Central Bank Digital Currencies, or CBDCs. Our DLTs are built in the open, with vendor neutral governance and can be deployed in several production networks across sectors, including Central Banks. Central bank money traditionally takes the form of cash or reserves held by eligible financial institutions at the central bank. CBDCs, on the other hand, are a newly developed concept that could become a third version of a national currency that is tokenized and would rely on use of an electronic record or digital token to represent the digital form of a nation’s currency. There are a number of countries already working to develop CBDCs utilizing Hyperledger’s open-source, open-governance distributed ledgers Hyperledger Fabric, Hyperledger Besu and Hyperledger Iroha. 

Aside from transforming currencies and bonds, asset tokenization is being applied to a range of securities and other financial assets, including physical ones. Tokenized on-chain assets in particular have the potential to unlock access to liquidity in the market while increasing freedom and access for investor capital. Traditionally illiquid assets, such as real estate or fine art, can have their value unlocked through the process of tokenization, which opens the door to tremendous possibilities for new investment. Case in point: Global law firm DLA Piper recently launched its TOKO tokenization platform to issue non-fungible tokens across asset classes including real estate, fine art, debt and even intellectual property. Toko is a digital asset creation engine to solve inefficiencies in today’s capital markets by using DLTs to distribute, trade and settle transactions rapidly, bypassing the need for trusted third party intermediaries that are both expensive and slow. It is built using the combination of a permissioned Hyperledger Fabric network and the Hedera Token Service. 

The technology also facilitates positive environmental impacts and ESG reporting. For example, a recently concluded trial conducted by the United Nation, Bank of International Settlements (BIS) and the Hong Kong Monetary Authority successfully resulted in two separate prototypes of tokenized green bonds. Built using Hyperledger Besu along with technologies from Digital Asset and Allinfra Climate, the prototypes ensure the tracking of mitigation outcome interests (MOIs), an essential aspect of environmentally focused economic efforts. 

This is just a sampling of the growing impact of asset tokenization. A new report from Boston Consulting Group (BCG) and ADDX estimates that asset tokenization will reach $16 trillion by 2030, or 10% of global GDP. To put that figure in context, in 2020 the total assets under management for ETFs were $7 trillion, and total real estate investment trusts (REITs) were worth $2.5 trillion in 2021. As we already see across our community, the breadth of use cases for DLTs and tokenized assets stretches across industries, with the potential to dramatically improve upon much of the critical infrastructure that the global economy currently relies on. 

Despite industry disruptions and market fluctuations, we are continuing to build enterprise-grade DLT technology that unlocks a previously unimaginable amount of capital and value. As we move forward into the new year, the Hyperledger Foundation is committed more than ever to fostering a robust and diverse ecosystem for open-source enterprise-grade blockchain technologies that will power new financial systems and models, while serving markets around the world. It’s what we call building better together. Come join us. All are welcome. 

Dec 13
Love0

Hyperledger Solang Release v0.2.0 and what’s to come

By Cyrill Leutwiler, Lucas Steuernagel, Sean Young Blog, Hyperledger Solang

With great pleasure we announce our most recent Hyperledger Solang Release: v0.2.0 “Berlin.” This release marks an important milestone towards maturing and stabilizing our Substrate compilation target: we are leaving ink! version 3 behind us in favor of introducing compatibility with the recent ink! 4 beta release! 

Status update for our Substrate target

With the “Berlin” release, Hyperledger Solang substantially improved its compatibility with many existing Ethereum Dapps and concepts within the Polkadot and Kusama ecosystem. Porting from Ethereum to a Substrate Parachain is now easier since the compiler supports almost all language constructs as Ethereum Solidity 0.8. This release represents just the beginning of a series of upcoming achievements yet to unlock for the Substrate compilation target.

Getting started with Hyperledger Solang on Substrate

Running your first Solidity contract on Substrate Parachains should be a matter of minutes. In this section we walk you through the few steps, showcasing how to use a classic Solidity example on Substrate. Namely, we are going to deploy an unmodified version of the “Voting” example contract, directly out of the Solidity documentation itself. According to Solidity documentation, the “Voting” contract example showcases a lot of Solidity’s features.

Prerequisites

To follow along, you’ll need to install Solang version “0.2.0” on your system. We offer plenty of quick installation options, including Homebrew as well as pre-built binaries for all common platforms. Please consult our documentation for instructions specific to your platform. Impatient readers may as well just use our docker option, which doesn’t require installing anything, instead.

If you want to test contracts on a local node, you’ll need to run version “0.22.1” of “substrate-contracts-node” on your local machine. Installation instructions can be found here. Again, our impatient readers may use the “paritytech/contracts-ci-linux” Docker image instead as this image contains a compatible substrate node as well (at the time of writing).

Compiling the “Voting” Solidity contract to WASM

We start with saving the source code of the “Voting” example contract into a file called “ballot.sol.”. There is no need to make any modification to the code, unless you want to tinker around a bit on your own. Now we use “solang” to compile the contract as follows:

solang compile --target substrate ballot.sol

The contract should compile without any warnings. If you prefer docker, you can use the following command instead:

docker run --rm -it -v $(pwd):/sources ghcr.io/hyperledger/solang:v0.2.0 compile -o /sources --target substrate /sources/ballot.sol

Now, inside your current working directory, a new file called “Ballot.contract” should appear, containing the web assembly BLOB together with the metadata of the contract.

Testing on a local development node

Before deploying the compiled contract to a testnet, let’s try it out on a local node. If you are in a hurry, you may as well skip this section and proceed directly with a deployment to a testnet. Start a local node on your machine using the following command:

substrate-contracts-node --tmp --ws-external -lerror,runtime::contracts=debug

Alternatively, the equivalent command for our docker users is as follows:

docker run --rm -it -p9944:9944 paritytech/contracts-ci-linux substrate-contracts-node --tmp --ws-external -lerror,runtime::contracts=debug

The odd looking “-lerror,runtime::contracts=debug” CLI option will instruct the node to use the debugging log level for the “contracts” pallet. This might come in handy as it effectively enables using the debug buffer, which allows the contract to communicate with the developer at runtime.

Deploy the contract using the contracts UI

Now head over to the contracts-UI and make sure to select ”Local Node” in the top-left corner. Then click on “Add New Contract” just below, and choose “Upload New Contract Code.” As the Contract Bundle, choose the ”Ballot.contract” file from the previous section. The node we are using comes with some special built-in accounts, which come in very handy for development purposes. The “alice” account is one of them and it is fine to use that for contract instantiation.

Image 1: Choosing the compiled contract bundle in contracts-UI

In the next section, you’ll be presented with some options for contract instantiation. Primarily, you might want to add some more “proposalName”s to our voting Ballot by clicking the big “+” button on the right side, so that we can actually choose between different voting options later. The actual values for the ”proposalName” won’t matter at this point.

Image 2: Configuring constructor arguments for contract instantiation in contracts UI

When you are satisfied with your deployment options, scroll to the bottom of the page to click on “Next” and then “Upload and Instantiate.” Under the hood, this will call the intrinsic to instantiate the contract. As the node we are using is configured to have instant block finality, the operation should succeed immediately. You’ll find your freshly deployed contract on the left side and it will look like this:

Image 3: The solidity contract deployed to a local node

Interacting with the contract

Now we can start playing with the contract by calling some of its functions. For example, try calling the “giveRightToVote()” function using the “alice” account, to entitle “bob,” “dave” and “eve” with the rights to submit a vote. You’ll notice that, if you are trying to call the ”vote()” function using an account that was not given voting rights priorly, the contract will trap and the transaction reverts as a consequence. If you did set the log level for the contracts runtime to “debug” in the previous step, you will be able to observe failed “require” statements in your local nodes terminal output. You will find a message like this when trying to submit a “vote()” using a non-entitled account as the caller:

2022-12-07 18:45:46.496 DEBUG tokio-runtime-worker runtime::contracts: Execution finished with debug buffer: Has no right to vote

Deploying to a testnet

Finally, let’s see how we can deploy our ballot contract to the “Rococo” live testnet, turning it into a usable Dapp. For this we are going to use the polkadot JS browser extension to create some accounts. So make sure to install that in your browser if you don’t already have it.

Creating test accounts

While our local node conveniently provided us with accounts charged up with balance out of the box, this won’t be the case on any “real” network. Instead we will create dedicated accounts. Even though you could reuse any pre-existing value-bearing Accounts from polkadot.js for this experiment, it is considered best practice to always use dedicated throw-away accounts for any development purposes. In your browser, open the polkadot JS extensions and use “Create new Account,” accessible by clicking on the big  “+” button on the top right side.

Once you successfully created a new account, in the polkadot JS extension, click on the ”gear” sign on the top-right corner and choose “Substrate” under “DISPLAY ADDRESS FORMAT FOR.” This will make polkadot JS to represent your Account ID in the correct address format used on “Rococo.” Naturally, deploying and calling any contract on-chain will cost some value, which is “ROC” tokens in the case of Rococo specifically. You can get some “ROC” tokens for free as follows:

1. Visit the Rococo faucet channel on matrix here.
2. Copy your Account ID in the “Substrate” address format and send the following command inside the Rococo faucet channel: “!drip YOUR_WALLET_ADDRESS:1002” (the “:1002” appended to your address is important).
3. A bot will respond to you shortly, confirming your balance. After a short while, you should also be able to confirm your balance by visiting the polkadot JS apps using this link.

If something does not work out, you can find more detailed instructions related to the Rococo faucet here.

Deploying the contract to rococo

We are almost there! Back inside the contracts UI, you can switch to the “Contracts (Rococo)” network using the dropdown menu in the top left corner. Once connected, you are good to use your freshly created account, loaded up with some “ROC” tokens, to deploy the contract. From now on, instantiating your contract and interacting with it works in exactly the same way as on the local node.

Image Image 4: The solidity contract deployed to the contracts parachain on Rococo

Many congratulations! You have just successfully deployed your first Solidity Dapp to a substrate parachain ✨

What’s next for Substrate

Primarily, we aim to fully support cross-call support between contracts written in ink! and Solidity. At the time of writing, it is only possible to call Solidity contracts from the ink! side in a rather bare-bones way. By implementing all missing primitives and supporting interfaces for bidirectional calls between ink! and Solidity, interacting with both worlds eventually will become a natural thing to do for smart contract authors targeting Substrate-based parachains.

A future goal will be to provide Solidity contracts direct access to chain extensions. This will open up a variety of immense benefits. For example, it is the building block for accessing randomness through verifiable random functions without calling into an oracle contract. Ultimately, support for chain extensions will enable using XCM within Solidity contracts. So stay tuned for the future!

Hyperledger Solang brings Solidity to many blockchains

Hyperledger Solang is designed to bring Solidity support to many blockchains. In addition to introducing compatibility with ink! v4, this release contains many small fixes and improvements.

A brief Solana update

On the Solana side, we are focusing on Anchor integration. Our goal is to have this finished by the next Solana Foundation hackathon so that participants can build their projects using Solidity. We still need to generate Anchor IDLs from Solidity contracts and integrate Anchor discriminators with Solang so that Rust contracts can call Solidity and vice versa. Recent breaking changes made the compiler incompatible with previous versions, but we are progressively updating the existing tooling until we switch to Anchor client side libraries.

We are looking forward to hearing from you!

If any blockchain would like to add Solidity to its list of supported smart contract languages, please do not hesitate to get in touch with us. We are excited to help anyone interested in integrating with Hyperledger Solang. As we mature our existing compilation targets, any form of feedback is highly appreciated. Try out Solang now and let us know how you get on!

Sep 12
Love0

Meet Hyperledger Solang, a portable Solidity compiler

By Sean Young, Lucas Steuernagel, Cyrill Leutwiler Blog, Hyperledger Solang

We are excited to announce that Solang has been accepted as the latest Hyperledger® project and has been renamed as Hyperledger Solang™. The project is now formally being incubated as a top-level project by the Hyperledger Foundation™, hosted by the Linux Foundation, and has support from multiple sponsors.

Solang started in the Hyperledger Labs since we always wanted to work together with other Hyperledger projects. The very first ledger we supported was Hyperledger Burrow. Being part of Hyperledger Labs was a great way to give the project more visibility and ensure we could make use of the great tooling provided by Hyperledger. After tapping into those resources, Hyperledger Solang, a tool that enables smart contract portability, is now the newest Hyperledger project.

What is Hyperledger Solang

Hyperledger Solang is a compiler for Solidity source code and targets different blockchains.

The idea for Solang arose from early work on Hyperledger Burrow. We were trying to do things with Solidity that were not possible with the existing Ethereum Solidity compiler. Since that compiler is specific for Ethereum, there was no interest in supporting features for Hyperledger Burrow. From that problem, a portable Solidity compiler that could support many blockchains was born, making it possible to have different features depending on which blockchain is being targeted.

The Solidity programming language is the most popular language for smart contracts, and there is clear interest from many blockchains to have support for it. Although some blockchains emulate an EVM environment to maintain compatibility with Solidity built with Solc, they cannot access missing features from Ethereum that an emulated EVM environment cannot provide, such as cryptographic functions, like blake2, zero-knowledge proof and the ability to call native contracts or be called by them. Hyperledger Solang offers the ability to compile Solidity to native execution environments other than the EVM, allowing the language many new possibilities and innovations.

Currently, Hyperledger Solang supports Solana and Polkadot (Substrate).

How to use Hyperledger Solang

Hyperledger Solang compiles Solidity into a native contract and a corresponding metadata file. Deploying a compiled contract needs tooling from the corresponding target blockchain. 

First follow the installation guide for installing Solang: https://solang.readthedocs.io/en/latest/installing.html and then follow the steps for Solana https://solang.readthedocs.io/en/latest/targets/solana.html or Substrate https://solang.readthedocs.io/en/latest/targets/substrate.html

For Solana, we have the @solana/solidity npm package for deploying and interacting with Solang compiled contracts. To compile Solidity for Solana, use:

$ solang compile –target solana source.sol

This will produce an ABI file for each contract, and a single binary contract called `bundle.so`.

For Polkadot or Substrate, the native @polkadot/api-contract npm package can be used. The command line for compiling Solidity for Substrate is:

$ solang compile –target substrate source.sol

For each contract found in the file a `.contract` file is produced.

There are examples in the documentation and in the integration tests of how to run these contracts.

We also have a visual studio code extension, which provides real-time compiler warnings and errors as well as type information when you hover over variables and functions.

What’s next

  1. Language support: Hyperledger Solang already supports nearly all the syntax that Ethereum Solidity 0.8 supports. There are a few minor exceptions like slices. We intend to keep up with the latest Solidity developments as they are released.
  1. Stabilized targets: Both the Solana and Substrate targets are undergoing stabilization and are expected to be finished by the end of the year. Once this happens, we expect many more users. We are aware of blockchain development teams wanting to use Hyperledger Solang in production, which makes this point a priority.
  1. EVM support: Hyperledger Solang used to have an ewasm target. However, since ewasm is no longer going to happen on Ethereum, this target has been dropped. In fact, we have bigger plans: we renamed most of the ewasm target to EVM, and hope to have EVM support in the future. An EVM target would be an interesting development because it would bring Solang to Ethereum and any other EVM based chain. Many projects that are already developing for Ethereum are interested in running their contracts in multiple environments, using a single tool that compiles for EVM and other blockchains. We are considering running a Hyperledger mentorship for this difficult but rewarding task next year.
  1. Hyperledger projects: We have had conversations with Hyperledger Sawtooth, Hyperledger Fabric, and Private Data Objects, which expressed interest in having Solidity support, but there is still work to be done to implement a new target in Solang for these projects.

Where to get more information and how to get involved

Please head to the github d ocumenationpage https://github.com/hyperledger-labs/solang documentation page https://solang.readthedocs.io/en/latest/

If you want to get involved, we have a curated list of good first issues to work on in our github issue tracker: https://github.com/hyperledger/solang/labels/good%20first%20issue.

We are always available on the #solang channel on the hyperledger discord, and we run a daily discord meeting at 13:30 UTC in #solang-meetup.  For more details, see the Hyperledger calendar of public meetings: https://wiki.hyperledger.org/display/HYP/Calendar+of+Public+Meetings. We look forward to welcoming you.

Copyright © 2022 The Linux Foundation®. All rights reserved. Hyperledger Foundation, Hyperledger, and the other Hyperledger Foundation trademarks are trademarks of The Linux Foundation. For a list of Hyperledger Foundation trademarks, please see our Trademark Usage page. Linux is a registered trademark of Linus Torvalds. Privacy Policy and Terms of Use.

Close Menu
  • Learn
    • Case Studies
    • White Papers
    • Training & Certification
    • Training Partners
    • Webinars
    • Research
    • Blockchain Showcase
    • Wiki
  • Use
    • Distributed Ledgers
    • Domain-Specific
    • Libraries
    • Tools
    • Tutorials
    • Hyperledger Certified Service Providers
    • Vendor Directory
  • Participate
    • Collaboration Tools
    • Contribute to Coding
    • Academic Collaboration
    • Find a Meetup
    • Regional Communities
    • Speakers Bureau
    • Join a Community Group
    • Labs
  • Events
  • News
    • Blog
    • Announcements
    • Newsletter
  • About
    • Join Hyperledger
    • Members
    • Leadership
    • Charter
    • Job Board
    • Contact Us
  • Join
  • English
    • 简体中文
    • Português
    • Français
    • Malayalam
    • 日本語
    • Español