Development Update #33

Skywire Repo Moved:

The Skywire repository has been merged into the main Skycoin repository. Still being integrated to replace visor and daemon.

Skycoin Cryptography Standard Library

All the cryptography, hashing and address operations have been moved into github.com/skycoin/skycoin/src/cipher

https://github.com/skycoin/skycoin/tree/master/src/cipher

The library is in progress. It will be common core for addresses, hashing and cryptography across Skycoin, distributed applications and wallets.

The new library will support:

Project Management: Dependency Difficulties

Golang is a new language and dependency management is still difficult. We have different developers using different versions of different libraries in different repositories.

A typical scenario:

Library A and B have to updated in lockstep, but library A will not get updated to use the new interface for B until B pushes his changes and A breaks. The developer of A gets notification from someone using his library that the library is broken and will then update A.

In response we have been:

Unit Testing:

We had 100% coverage testing. The unit tests were extremely tedious and did not tell us if program was working. The complexity of the unit tests, helped simplify the program however. If something was difficult to unit test, it should probably be moved out or eliminated (such as time dependencies in the blockchain parser).

A few thousand lines have been gutted from project. Flow paths are being eliminated throughout the project. This will reduce the size of the unit tests. Features such as testnet addresses and rarely used command line options are being gutted to eliminate program flow paths.

We are moving away from 100% coverage testing and will probably focus more on functional and integration testing that can be done from outside of the module.

Deterministic Build Road Map: Autonomous Corporations

Four major security requirements for future altcoins:
Deterministic builds mean:
Program determinism means:
Process isolation means:

Digital Autonomous Corporations: Technical Requirements

In the long term:

The source code is the bylaws of the corporation. The bylaws specify corporate governance (who can do what, who can change the bylaws and under what conditions).

So for instance, you may require that the source code for the coin be in the blockchain itself and that any changes to the source code require agreement of half the coin holders in a proof of stakes election. With the source code itself enforcing the vote counting and update. That is an alternative to a “foundation” controlling the source code and repository.

Bitcoin skirts the digital governance issue. Each participant in the network is allowed to choose a different implementation. Bitcoin is “decentralized” in theory, but in reality a small group of developers controls and owns the standard. Control of coins is decentralized and network operation is decentralized but control of the source code and the governance of Bitcoin is centralized.

If the implementations Bitcoin differ, the attitude of the foundation is “the majority of miners will just decide which implementation is correct. The miners control the blockchain and in theory have veto over changes to the source code, but in reality are helpless. The coin-holders (the stakeholders) have no representation in the governance.

The veto in corporate governance over the souce code and changes should be in the hands of the coinholders (the stakeholders).

We cannot have Digital Autonomous Corporations until deterministic builds, program determism and process isolation are technically feasible.

Digital Autonomous Corporations: Seperation of Blocks Contents from Block Consensus Mechanisms

Bitcoin combines blockchain consensus and parsing of blocks (transaction). The consensus mechanism in Bitcoin is the block headers along with transaction information. From Skycoin’s perspective the contents of the blocks (the transactions) should be logically separate from the mechanism used to determine consensus between blocks. Consensus determining information should wrap and be independent of the block contents.

Skycoin carefully separates out the blockchain format from how consensus is determined. This means: - Stakeholder elections may elect to change the blockchain format power and how the blocks are parsed (Which may affect number of coins, types of transactions types supported and other information) - Stakeholder elections may elect to change the consensus mechanism

In Bitcoin, there are multiple competing implementation of both the blockchain parser. There is a chance a block might be valid on one implementation and not valid on another, causing a fork. Multiple concurrent version of the chain parser are in the wild, with different ideas about what constitutes a valid block.

For digital governance the blockchain parser itself is the first target for placing its source code within the blockchain itself and amendments or changes becoming subject to stakeholder elections.

In Skycoin the blockchain parser must be standard and deterministic and agreed upon by all parties, while the current consensus mechanism is currently allowed to be varied on an individual basis in the network consensus system (which may change).

Digital Autonomous Corporations: Functional Unspent Output State

In Skycoin the state of the unspent outputs is U and a block (list of transaction) is applied to that state B(U) to yield a new state.

B(U) -> U

A block is a function from an unspent output state to a new unspent output state. There are conditions that must be true of each transaction in a block and conditions that must be true of the transactions jointly.

This is similar to Bitcoin, but conceptually more advanced in that it was designed to accommodate the direction crytocurrencies will take in the future.

Digital Autonomous Corporations: Mathematical Notes, Object Process Algebra

Bitcoin type systems are specific examples of very specific types of mathematical constructions. There are transactions and transactions take unspent outputs and destroy them, creating new unspent outputs. Access control is by signature, only the person whose the private key can use the object.

Outputs are objects with state, which have methods and the methods describe who can call the methods. A method might say “Only the person with the privatekey can call me”. The state of the object does not exist on the blockchain, the blockchain only records the methods or transactions which act upon the state.

Bitcoin’s operator

Each output is destroyed when used. To send $20 if you have $30 in an output, you send $20 and send $10 back to yourself (your output is destroyed by the transaction and two new outputs are created). Bitcoin objects are immutable.

Bitcoin objects are immutable because they are named by the SHA256 of their binary serialization. Modifying the object would change its hash and therefore its “identity” (which is the hash). Therefore you can only destroy, but not modify the object.

There is a more general construction than Bitcoin, which is:
For instance for methods on an object you could have different program preconditions, that determine if a call on that object is valid:
Chain Visibility:

The whole Bitcoin is just an instance of one of these systems, with a special singleton that takes in lists of outputs, destroys them and creates new outputs. So Bitcoin is just a singleton object with a method that has a creation/destruction operator on another type of object (which it creates and destroys). Once you have a public ledger and you have this type of “Object Process Algebra” then Bitcoin is just 30 lines of code. There is no reason you could not have a billion Bitcoins or everyone could not have their own Bitcoin. There are systems that are apparently more general and powerful than Bitcoin, but its not clear what they do or how people will use them.

Etheurem is closing in on this idea, but choosing to do all the computation on a single chain. We have no idea what people will use these systems for, but believe people need personal blockchains.

We were thinking of scripting languages like this, but decided to keep them off the Skycoin blockchain, which should only be for coins and payments. This kind of blockchain is for something else entirely. Of course we are going to implement this, but its not priority compared to other things. It distracts from more important and urgent development priorities. Its more like a developer toy right now.

Digital Autonomous Corporations: Implementation

The Skycoin Project is drafting a standard for a minimal virtual machine which will allow program determinism, process isolation and deterministic builds for golang and a restricted subset of C.

Golang’s compiler is currently written in C. Golang is getting a new compiler written in Golang. The library allows us to parse golang modules into an AST representation. We are then able to convert the golang program AST into the deterministic IR representation.

Steps:
Result:

The non-deterministic parts outside of the IR are the system dependent file system, networking and the interpreter (we will call this “the runtime”). However, this part is very small. Since networking and file system access go through the runtime, we are able achieve process isolation.

This is a long term goal, but something that

Eventually a strict subset of C and minimalist subset of C++ could be compiled to the IR representation. This would allow migration of the Bitcoin source, after deprecation of dependencies. Bitcoin’s qt-depedency, idiosyncractic wallet storage format and dependence on OpenSSL, mean that a Bitcoin port is unlikely. The C standard does not define integer overflows and other behavior required for Bitcoin to achieve determinism.

However, Dogecoin or new altcoins prepared to make radical changes to the Bitcoin source code would be able to take advantage of deterministic builds and improved security.

No translation bounty

Discuss this post on telegram

Skycoin Telegram