Explore Courses Blog Tutorials Interview Questions
0 votes
in Blockchain by (4.1k points)

Blockchains such as Ethereum use a stack-register based language on their smart-contract processing virtual machines. That model is very convenient because it provides a simple mechanism to measure the amount of work required to run programs: just fix a cost for each primitive operation and sum.

Suppose that, instead of virtual machines, a blockchain featuring smart-contracts used a functional programming language such as Haskell's core. Is there any simple, accurate way to measure the amount of work required to execute a functional program - keeping in mind that nodes are able to use any evaluation strategy, so such measurement must be universal.

1 Answer

0 votes
by (14.4k points)
edited by

It should be known to the reader that a blockchain network determines the true value of its token dynamically. To accurately measure the effort spent by the network to ensure the unit value of its token, all we need is a DMMS algorithm which is simply a proof-of-work blockchain.

When multiple tokens are implemented on a single blockchain, the ledger is not able to accurately measure the value of a unit. However, in the case of functional languages, users could imagine a lisp blockchain with paul graham's 7 primitives which are implemented as an opcode. This would be Turing complete but will adhere to the problem of determining the true value of each opcode and the cheapest one will always be abused.

For achieving a functional Turing complete blockchain, users need a braided network of 7 blockchains, each of which can independently determine the true value of effort required for that primitive calculation.

Know the blockchain better through Blockchain Certification by Intellipaat.

Browse Categories