This is a work-in-progress documentation page for Nuclux components and modules. Basic structure and features of each component is presented here .

More details will be added as time goes by so we recommend checking this page from time to time. Feel free to contact the team in case of doubts. The pseudocodes on the right are just orientative and are NOT fit for production uses.

The codes on the right side are written in Solidity the recommended Language for writing smart contracts in Ethereum. Solidity is a contract-oriented, high-level language whose syntax is similar to that of JavaScript and it is designed to target the Ethereum Virtual Machine (EVM). Solidity is statically typed, supports inheritance, libraries and complex user-defined types among other features. Full solidity Documentation can be found here.

//Simple Solidity sourcecode structure

pragma solidity ^0.4.19; contract Helloworld { address creator; string greeting; function Helloworld(string _greeting) public { creator = msg.sender; greeting = _greeting; } function greet() public constant returns (string) { return greeting; } function getBlockNumber() public constant returns (uint) { return block.number; } function setGreeting(string _newgreeting) public { greeting = _newgreeting; } function kill() private { if (msg.sender == creator) selfdestruct(creator); } }

Nuxcoin | Token

Nux token will serve as the primary object for exchange of goods and services inside the Nuclux ecosystem. Subscribers can exchange Ethereum , Bitcoin or paper currency for a sum of Nuxcoin. The value of Nuxcoin will be independent of the fluctuations of other currencies to avoid typical hyper-inflation associated with virtual currencies.

pragma solidity ^0.4.19;

contract NuxCoin {
    // The keyword "public" makes those variables
    // readable from outside.
    address public minter;
    mapping (address => uint) public balances;

    // Events allow light clients to react on
    // changes efficiently.
    event Sent(address from, address to, uint amount);

    // This is the constructor whose code is
    // run only when the contract is created.
    function NuxCoin() {
        minter = msg.sender;

    function mint(address receiver, uint amount) {
        if (msg.sender != minter) return;
        balances[receiver] += amount;

    function send(address receiver, uint amount) public {
        if (balances[msg.sender] < amount) return;
        balances[msg.sender] -= amount;
        balances[receiver] += amount;
        Sent(msg.sender, receiver, amount);

Nodes and Users

The ecosystem will eventually consist of non-technical users who just want to consume certain services offered on the platform and technical users who assist to maintain the whole infrastructure and network. Ineffect a market economy of demand and supply will be created wherein any user can play either or both roles of a buyer or seller of some service.

pragma solidity ^0.4.19;

contract ClientReceipt {
    event Deposit(
        address indexed _from,
        bytes32 indexed _id,
        uint _value

    function deposit(bytes32 _id) public payable {
        // Any call to this function (even deeply nested) can
        // be detected from the JavaScript API by filtering
        // for `Deposit` to be called.
        Deposit(msg.sender, _id, msg.value);

DAPPS Integration

Nuclux will integrate other decentralized services like wallets ,market places , exchanges etc, inside the Nuclux browser. Non-technical users can discover and access decentralized services and backends through a sleek Graphical User Interface. Decentralized Applications (DAPPS) can leverage the Nuclux client to offer services to clients on the frontend.

pragma solidity ^0.4.19;

contract ClientReceipt {
    event Deposit(
        address indexed _from,
        bytes32 indexed _id,
        uint _value

    function deposit(bytes32 _id) public payable {
        // Any call to this function (even deeply nested) can
        // be detected from the JavaScript API by filtering
        // for `Deposit` to be called.
        Deposit(msg.sender, _id, msg.value);

Public Identity

Users and participates on the platform are represented and addressed by a unique hash string which can be conveniently exchanged among peers. Messages can be sent via pmail a decentralized messaging service built into the platform.

pragma solidity ^0.4.19;

contract owned {
    function owned() { owner = msg.sender; }
    address owner;

// Use `is` to derive from another contract. Derived
// contracts can access all non-private members including
// internal functions and state variables. These cannot be
// accessed externally via `this`, though.
contract mortal is owned {
    function kill() {
        if (msg.sender == owner) selfdestruct(owner);

// These abstract contracts are only provided to make the
// interface known to the compiler. Note the function
// without body. If a contract does not implement all
// functions it can only be used as an interface.
contract Config {
    function lookup(uint id) public returns (address adr);

contract NameReg {
    function register(bytes32 name) public;
    function unregister() public;

// Multiple inheritance is possible. Note that `owned` is
// also a base class of `mortal`, yet there is only a single
// instance of `owned` (as for virtual inheritance in C++).
contract named is owned, mortal {
    function named(bytes32 name) {
        Config config = Config( 0x5EA2036A661DaE64dD0F0cc70F673CBF7DB8B985);

    // Functions can be overridden by another function with the same name and
    // the same number/types of inputs.  If the overriding function has different
    // types of output parameters, that causes an error.
    // Both local and message-based function calls take these overrides
    // into account.
    function kill() public {
        if (msg.sender == owner) {
            Config config = Config( 0x5EA2036A661DaE64dD0F0cc70F673CBF7DB8B985);
            // It is still possible to call a specific
            // overridden function.

// If a constructor takes an argument, it needs to be
// provided in the header (or modifier-invocation-style at
// the constructor of the derived contract (see below)).
contract PriceFeed is owned, mortal, named("GoldFeed") {
   function updateInfo(uint newInfo) public {
      if (msg.sender == owner) info = newInfo;

   function get() public view returns(uint r) { return info; }

   uint info;

Consensus & Voting

Decisions that affect a large majority of users will be subject to public voting and majority consensus to ensure smooth operatin of the platform. Voting is strictly by invitation based on proof-of-identity mechanisms. This serves to limit double-voting or impersonation of identity.

pragma solidity ^0.4.11;

/// @title Voting with delegation.
contract Ballot {
    // This declares a new complex type which will
    // be used for variables later.
    // It will represent a single voter.
    struct Voter {
        uint weight; // weight is accumulated by delegation
        bool voted;  // if true, that person already voted
        address delegate; // person delegated to
        uint vote;   // index of the voted proposal

    // This is a type for a single proposal.
    struct Proposal {
        bytes32 name;   // short name (up to 32 bytes)
        uint voteCount; // number of accumulated votes

    address public chairperson;

    // This declares a state variable that
    // stores a `Voter` struct for each possible address.
    mapping(address => Voter) public voters;

    // A dynamically-sized array of `Proposal` structs.
    Proposal[] public proposals;

    /// Create a new ballot to choose one of `proposalNames`.
    function Ballot(bytes32[] proposalNames) {
        chairperson = msg.sender;
        voters[chairperson].weight = 1;

        // For each of the provided proposal names,
        // create a new proposal object and add it
        // to the end of the array.
        for (uint i = 0; i < proposalNames.length; i++) {
            // `Proposal({...})` creates a temporary
            // Proposal object and `proposals.push(...)`
            // appends it to the end of `proposals`.
                name: proposalNames[i],
                voteCount: 0

    // Give `voter` the right to vote on this ballot.
    // May only be called by `chairperson`.
    function giveRightToVote(address voter) {
        // If the argument of `require` evaluates to `false`,
        // it terminates and reverts all changes to
        // the state and to Ether balances. It is often
        // a good idea to use this if functions are
        // called incorrectly. But watch out, this
        // will currently also consume all provided gas
        // (this is planned to change in the future).
        require((msg.sender == chairperson) && !voters[voter].voted && (voters[voter].weight == 0));
        voters[voter].weight = 1;

    /// Delegate your vote to the voter `to`.
    function delegate(address to) {
        // assigns reference
        Voter storage sender = voters[msg.sender];

        // Self-delegation is not allowed.
        require(to != msg.sender);

        // Forward the delegation as long as
        // `to` also delegated.
        // In general, such loops are very dangerous,
        // because if they run too long, they might
        // need more gas than is available in a block.
        // In this case, the delegation will not be executed,
        // but in other situations, such loops might
        // cause a contract to get "stuck" completely.
        while (voters[to].delegate != address(0)) {
            to = voters[to].delegate;

            // We found a loop in the delegation, not allowed.
            require(to != msg.sender);

        // Since `sender` is a reference, this
        // modifies `voters[msg.sender].voted`
        sender.voted = true;
        sender.delegate = to;
        Voter delegate = voters[to];
        if (delegate.voted) {
            // If the delegate already voted,
            // directly add to the number of votes
            proposals[].voteCount += sender.weight;
        } else {
            // If the delegate did not vote yet,
            // add to her weight.
            delegate.weight += sender.weight;

    /// Give your vote (including votes delegated to you)
    /// to proposal `proposals[proposal].name`.
    function vote(uint proposal) {
        Voter storage sender = voters[msg.sender];
        sender.voted = true; = proposal;

        // If `proposal` is out of the range of the array,
        // this will throw automatically and revert all
        // changes.
        proposals[proposal].voteCount += sender.weight;

    /// @dev Computes the winning proposal taking all
    /// previous votes into account.
    function winningProposal() constant
            returns (uint winningProposal)
        uint winningVoteCount = 0;
        for (uint p = 0; p < proposals.length; p++) {
            if (proposals[p].voteCount > winningVoteCount) {
                winningVoteCount = proposals[p].voteCount;
                winningProposal = p;

    // Calls winningProposal() function to get the index
    // of the winner contained in the proposals array and then
    // returns the name of the winner
    function winnerName() constant
            returns (bytes32 winnerName)
        winnerName = proposals[winningProposal()].name;