Skip to content

Latest commit

 

History

History
148 lines (99 loc) · 4.58 KB

README.md

File metadata and controls

148 lines (99 loc) · 4.58 KB

dType

Join the chat at https://gitter.im/pipeos-one/dType

dType is a Decentralized Type System for a Global OS, for Ethereum. A global type system enables independently built system parts to interoperate. Developers should agree on standardizing common types and a type registry, continuously working on improving them, to become part of the Global OS. Ethereum could become the origin for defining types for other programming languages.

dType supports any Solidity type, including functions, along with custom user types. dType assigns a unique global identifier for each type and stores data needed to recompose the type's ABI. Various storage mechanism extensions can be optionally integrated with dType, enabling efficient blockchain data analysis, especially by blockchain explorers, without relying on off-chain centralized services to provide ABI data.

ERCs

  1. EIP-1900: dType - Decentralized Type System for EVM, discussions here
  2. EIP-2157: dType Storage Extension - Decentralized Type System for EVM
  3. EIP-2193: dType Alias Extension - Decentralized Type System
  4. EIP-xxxx: dType - Extending the Decentralized Type System for Functions
  5. dType Language Extension, Data Bridging

Ethereum 2.0

In research: dType on Ethereum 2.0.

Demos

Playlist: https://www.youtube.com/playlist?list=PL323JufuD9JC46yClCf5fdaEX17kocem7

For an overview, see dType 101 - A Developer Guide - 1. The Anatomy of a dType

Vision

Specs

dType

dType Registry Contract

Types are registered in the dType contract. See dType.sol.

struct dType {
    address contractAddress;
    bytes32 source;
    string name;
    string[] types;
    string[] labels;
}

Type Contract

A type must implement a library and a contract that stores the Ethereum address of that library, along with other contract addresses related to that type (e.g. smart contract for storing the data entries for that type).

contract TypeRootContract {
  address public libraryAddress;
  address public storageAddress;

  constructor(address _library, address _storage) public {
    require(_library != address(0x0));
    libraryAddress = _library;
    storageAddress = _storage;
  }
}

A type library contains the definition of the type, along with helper functions. Example typeALib.sol.

A type storage contract contains data entries for the type. Example typeAContract.sol.

Functional Programming Pattern

Example for functional programming with dType.run().

runExample

Development

Contracts

Prerequisites:

npm install -g truffle

Compile:

cd contracts
truffle compile

Test:

truffle test
truffle test test/dtype.js

Deployment prerequisites:

mkdir private
cd private
touch infuraKey.txt
touch privateKey.json

Deployment commands:

Ganache is set on port 8545.

truffle migrate --network ganache

Client App

Build dType UI Packages

Contains core packages for dType and example packages for each type.

Future plans:

  • type packages will be published on Swarm/IPFS and loaded on demand in the client app
cd dType
npm install
lerna bootstrap
lerna run build

Run Client

cd client
# Remove dType/client/package-lock.json if npm install fails, and try again
npm install
npm run start

For the client app to run correctly, you need to first deploy the contracts with truffle migrate and connect with Metamask to the testnet/private network.