Both! Glow is a DSL, a domain-specific language. It is also a platform with libraries. In the long-run, we might name these two differently to avoid confusion.
Writing it once, and having it work everywhere, and not just on EVM blockchains. You don’t have to guess where the liquidity will be and then bank on a technology that only works on one network or family of networks.
Generating not just the "smart contract", but the client and server code that exactly matches it for each participant.
Having a chance at formal methods.
Glow currently runs on blockchains using the Ethereum Virtual Machine (EVM). These blockchains of course include Ethereum and Ethereum Classic, but also many other blockchains, including but not limited to Binance Coin, VeChain, TRON, etc.
However, the default blockchain used by Glow today is the Cardano EVM Devnet. That blockchain is the developer network in preparation for the launch of the Cardano KEVM side-chain. This is the blockchain against which we currently run our tests. Glow can easily be made to run on any blockchain that supports the EVM, but we are not currently testing against them, though MuKn will gladly sell you contracts for such maintenance service.
Glow will also support Plutus as a backend when it launches on the Cardano network. And Glow in the future can potentially run your applications identically on any and all blockchains on which you can write smart contracts. If you want Glow to support a particular blockchain, MuKn will gladly help make it happen.
Yes, the EVM is the primary target for Glow at the moment, and Glow should run on all EVM blockchains.
If you’re worried because you saw an announcement about Glow being launched on Cardano, fear not: we will support Plutus on Cardano, but the chain we did launch on previously was a devnet for the upcoming Cardano KEVM sidechain.
Yes, we directly generate EVM bytecodes.
An early prototype in 2019 for what would later become Glow did compile to Solidity, but we found that the Solidity compiler was not robust enough to handle what we were throwing at it, except in the simplest of cases. Our compiler is currently lacking in micro-optimizations, but we’re more than making it up with macro-optimizations instead: the code generated by Solidity is bad enough that micro-optimizations make no big difference, and the ABI, calling conventions and encodings used by Solidity are so inefficient and costly that we can easily do better, with plenty of ideas how to do even better.
That depends on the blockchain.
For most EVM blockchains, all it takes for Glow to support it might be changing a few lines in a configuration file.
Some blockchains that sport their own extensions to the EVM, or have serious restrictions on usage of a not-so-compatible EVM, may require a month of work, maybe two.
For most non-EVM yet smart-contract-capable blockchains, such as PolkaDot, EOS, Nervos, Algorand, Tezos, etc., it should take about two to three months of work for Glow to support it.
We have to set up the Blockchain’s development environment, learn the details of their virtual machine and transaction APIs, make experiments to determine their precise semantics, determine how it does or does not fit the expectations of Glow, and as we do, write suitable backends for Glow’s smart contract compiler and client runtime. This is full time work for two people.
And then, it may take more time and effort to add optimizations, support new features, prevent the code-base from bitrotting, etc.
MuKn will happily sell development and maintenance contracts to blockchain companies and foundations to ensure that Glow keeps running smoothly on their platform of choice.
Bitcoin was never designed for smart contracts, and will require much more resources to support.
Bitcoin script and the size limits on its usage provide a hostile environment to general smart contracts. What more, BTC is missing some opcodes that its network explicitly disabled, and some more opcodes of which it explicitly rejected the adoption. This makes BTC in particular an even more challenging target platform for Glow than the other forks and clones of Bitcoin that have adopted those missing opcodes. (Adoption of these opcodes was even one of the notable points of contention that led to the BCH fork; BCH leaders do actively support “covenants”).
In the end, it will take roughly 6 months of work to initially support BCH and other similar contract-ready Bitcoin forks and clones. Indeed, in addition to work required on any blockchain, we will need to work around the quirks and limitations of the platform, and add extra optimization passes just to fit in the extremely limited transaction size limits. Furthermore, the ongoing development and maintenance costs will be larger than for more modern blockchains with virtual machines designed for contracts. But it is all possible, and we wrote experiments to confirm that it is possible.
By contrast, it will take at least double the time and effort to initially support BTC and similarly contract-hostile Bitcoin forks and clones. Indeed, a lot of additional tricks are required to overcome BTC’s limitations, and these tricks may involve dividing contracts in even more sub-contracts (e.g. one per bit of the output) and transactions into even more transactions (e.g. many partial transactions to emulate the missing opcodes the hard way). In the end, the fees required to execute such contracts might be prohibitive, especially at the levels currently seen on Bitcoin. Even more elaborate optimizations might be necessary just to keep these fees affordable for the highest value contracts. The amount of engineering efforts required, combined with the economic limits of its applicability, put BTC support low on our priority list. It is definitely not a juicy low-hanging fruit. But we will gladly work on this support if some Bitcoin whales fund us.
Glow produces interactions. For instance, the closing of a sale; a optional future purchase of some digitalized commodity; the delivery of some physical good all along a supply chain; an online auction; a barter swap between two baskets of digital assets; an insurance contract; a loan and its repayment; a game tournament; a sponsorship contract; etc.
No file as such is created along the way, though many entries in blockchains and local databases are generated.
First, two (or more) participants create an agreement.
After they precisely agree on all the terms of the agreement, Glow generates the code for each participant to execute the agreement, which they each run on their local machines.
The interaction code in turn may create or use smart contracts on agreed-upon blockchains to hold each other accountable for doing their part of the agreement.
Often, one participant is a “merchant” or “market-maker” whose website or servers publicly offers deals for other people to take. The terms of the agreement are listed, and all the other participants have to do is fill in their name and address and the desired quantity (within allowed limits), and sign the offer before it expires.
In other cases, two participants try to reach a private agreement, wherein they exchange tentative terms for a deal, making offers and counter-offers, until the terms offered by one party are accepted by the other party.
In either case, this negotiation happens “offchain”. Each participant’s client or server software helps them browse the market or publish offers, seek partners and negotiate terms, etc. The participant’s software will also filter out undesired sollicitations, reject offers with obviously unacceptable terms, assist participants in defining and maintaining parameter limits, and help them optimize their yield, profits, risks, etc.
Once an agreement was reached, its execution takes the form of steps each taken by a participant or the other.
For instance, in an asset swap, a first participant puts his basket of assets in escrow, then the other participants puts theirs, and when they all did, the assets are distributed to their new owners according the agreed upon formulas. There is one step by participant, and the last step includes the distribution. Between two participants, that’s two steps.
In a futures contract, some assets are escrowed by each participant in the beginning (one step per participant); then, at some due date, one participant may exercise an option (one step, or no step if he waits until the option expires); finally, the contract is settled. Between two participants, that’s typically three or four steps.
In a game tournament, participants initially deposit their stakes (one step per participant); then there will be at least one step by one participant at each “turn” of each game, sometimes many or all participants contributing steps to complete each “turn” depending on the game, and when a game is complete, another game may start, until the tournament reaches its conclusion, and prizes are distributed per the agreed-upon formula. There can easily be hundreds or thousands of steps.
Agreements include promises by each participant to act according to the interaction’s rules. At the beginning of the interaction, one or many smart contracts are created or used on some blockchain, that encodes the rules of the interaction. Each participant who has any opportunity to fail to follow the rules in the future will typically deposit some collateral assets in escrow, in addition to the main assets at stake, to hold them accountable should they defect.
When a participant acts outside of the parameters, or fails to act in a timely fashion within those parameters, the other participants can invoke the smart contracts as recourse; the assets escrowed as collateral by the defecting participant will be distributed to the other participants to make them whole for any loss, according to the agreed upon formula.
Glow is rapidly acquiring more features, enabling users to enter more elaborate interactions.
When Glow was initially launched, it could only handle interactions between two participants trading a single asset class in a finite number of steps. Furthermore, it only executing interactions in "direct-style": a smart contract would oversea the execution of each and every step of the interaction.
Support for more than one asset class in a given interaction
Support for more than two participants in a given interaction
Support for more than more complex interaction flows
Support for generalized state channels as a more efficient backend
Glow’s standard library at launch included the following contracts:
"Buy Signature", a general atomic closing contract for a sale, wherein a Buyer purchases the signature of a specific document by a Seller. The document can be a legal document, a transaction that completes a transfer on another blockchain, an digital certificate of some sort, etc.
"Coin Flip", based on a general technique to produce mutually random numbers, that can be reused in the many situations where such mutually random numbers are useful.
"Rock Paper Scissors", a simple game that illustrates more elaborate interactions with escrowed collaterals.
We are currently working to add support for tokenized assets (whether fungible or not) natively to Glow. This means that you will be able to manipulate those assets explicitly as part of the language, rather than as function calls that implicitly transfer tokens. This also means that as we develop formal methods to prove correctness of interactions, these proofs will be able to directly account for value of those assets.
Generalized State Channels are a generalization of the State Channels as made famous by the Bitcoin Lightning Network. While the simple State Channels of the Lightning Network only allow for simple one-way payments, Generalized State Channels allow for arbitrary smart contracts to be executed via State Channels.
State Channels and Generalized State Channels allow for an unlimited number of fast and cheap transactions between a small number of cooperating participants who have created those special contracts on the blockchain, even when transactions on the blockchain itself may be limited in volume and incur high transaction fees.
The downside of State Channels and Generalized State Channels is that if one participant stops cooperating for whatever reason, it may take a relatively long time and high fees (typically a week and at 2021 prices tens of dollars maybe hundreds) for other participants to properly close the channel and recover funds.
Yes, as it executes DApp interactions, Glow compiles their specifications on the fly into suitable blockchain smart contracts. It does not at any point create a file for these smart contracts: there is no point whatsoever in files that only risk being lost or corrupted. Instead, it directly creates a contract on the blockchain when needed, or reuses an existing blockchain contract when possible.
Typically, the on-chain smart contract is created or invoked as the first participant as the first step in executing the agreement. If a new contract was created, it may typically be destroyed by the last participant in the last step of the agreement execution. In between the first and last steps, the Glow clients for each participant will handle all interaction with the blockchain and other participants, so you don’t have to interact with them yourself, which is a very error-prone and completely unforgiving yet safety-critical activity.
As it executes interactions, Glow also runs every step on each participant’s local computer. This part is compiled to a virtual machine then interpreted as virtual machine code. So there are both a compiler and an interpreter involved.
Certainly, we could possibly make the participant-side code 10x to 100x faster by compiling it further rather than interpreting code. But there is little economic incentive for that: running an interaction at all means that you’re paying or ready to pay blockchain fees for that, and these are millions (and now billions?) of times more expensive than it costs to run the code on the participants’ machines. Spending our time optimizing client-side evaluation is completely worthless when instead there are so many useful features to add to the language.
There may come a time in some future when the language grows to support more complex computations on the participants’ computers. At that point, client-side optimization may become a sensible activity; but that is not now, and probably not in the next year or two (as of 2021).
Yes, on each participant’s computer, Glow creates, maintains and uses various configuration files, as well as a small database and log files, to track the identities managed for the user, the contacts known to the user, and the progress of the interactions the user is partaking in, so as to ensure they are conducted to completion.
None of that corresponds to generating compiled files from source code (compilation is done in-memory), but it does count as generating and using files on the participants’ machines.
When you install Glow according to our instructions, all the dependencies you need are also installed with it.
The Gerbil Scheme compiler, and several libraries written in Gerbil that Glow depends on.
The Gambit Scheme compiler, that compiles the compilation output of Gerbil Scheme.
The GNU C compiler (GCC), that compiled the compilation output of Gambit Scheme.
Ultimately, you will be able to use the Glow language to build all the parts of a DApp that touch the blockchain. Furthermore, the Glow compiler will automatically generate API descriptions for each entry point of those DApps, from which you will be able to generate API functions on the programming language of your choice.
But Glow is not and will not be a substitute for a general-purpose programming language
for all the other parts of your application that do not touch the blockchain:
fulfilling orders, managing inventory, computing rates,
making economic models or physics engines,
offering a shopping interface to end-users, or a management interface to team members,
We will do our best so your Glow applications keep working as we evolve our language, or to offer you a simple way to automatically update your programs so they work with the next version of Glow.
To ensure that any problem you have is handled in a timely fashion, be sure to either contribute your application to the community, or have a maintenance contract with MuKn to keep it running at all times.
Etherscan provides verification services, wherein you can compare a binary contract as created on-chain to what the contract is supposed to be if it were indeed compiled from the declared source code with the declared compiler and declared parameters. This service kind of makes sense for those who use a language such as Solidity. then again, one must beware that Etherscan is itself a centralized authority.
But this workflow does not make sense to us. Instead, the Glow execution environment directly verifies the contracts it deals with. Glow requires participants to already have shared, off-chain, all the interaction source code they rely on, before they even begin to execute the interaction on-chain. The Glow client will plainly refuse to participate in any interaction that it cannot verify itself, without the need of any centralized authority.
Of course, you must make sure to certify your Glow client itself. If possible, you should have Glow audited by multiple suitable parties you trust, and only use versions that exactly match the one used by auditors, within the parameters recommended by those auditors. You can, of course, choose to trust or not trust each of the previous public opinions of auditors already paid by other people.
But that is no different from having to certify the combination of the Solidity source code used by a contract, Solidity compiler used to compile it, the "wallet" or "DApp" interface you use to interact with it, the "browser" on top of which you use these interface, the "operating system" on top of which the browser runs, the "hardware design and implementation" under that operating system, etc. You should not hold the components used by the competitors of Glow to a lower (or higher) standard than you hold Glow itself. But at least, in the code audit wars, Glow has much fewer lines of code to audit.
Yes, Glow is and will forever remain Free Software, Open Source Software, or however you like to call it: everyone is free to copy, use, modify and redistribute Glow. Indeed, we believe this is an essential feature of a decentralized system that anyone should be able to see and audit, use and adapt, to fix and improve its code. Without these freedoms, it is impossible to trust the code as an ongoing system to use and keep using. Do not trust any software that claims to be decentralized yet isn’t Free Software.
Now, Glow has so far been developed by US-based company Mutual Knowledge Systems, Inc., also known as MuKn (pronounced “Moon”). We will gladly sell our services to improve Glow, help you use and deploy it; and we will also gladly sell our services to help you integrate it to your proprietary systems or to your software systems that you keep as trade secrets.
No, Glow is not Turing-Complete at this point.
We do see value in being able to express more elaborate computations, but we value safety over versatility. Thus, we won’t compromise on safety, and we will instead enable more advanced formal methods so you can keep proving your DApps correct as they get more elaborate. So while we will eventually reach a point when you can express arbitrary computations in Glow, along the way we will keep ensuring that Glow is and remains at any moment the best environment to develop safe DApps.