---
eip: 1491
title: Human Cost Accounting Standard (Like Gas but for humans)
author: Iamnot Chris (@cohabo)
discussions-to: https://github.com/freeworkculture/kazini/issues/11
status: Stagnant
type: Standards Track
category: ERC
created: 2018-10-12
---

## Simple Summary
A standard interface for Human Capital Accounting tokens.

## Abstract
The following standard allows for the implementation of a standard API for HUCAP tokens within smart contracts. This standard provides basic functionality to discover, track and transfer the motivational hierarchy of human resources. While blockchain architecture has succeeded in the financialisation of integrity by way of transparency; correspondingly real world outcomes will be proportional to the degree of individualisation of capital by way of knowledge.

## Motivation
The Ethereum protocol architecture has a deterministic world-view bounded to the random reality of the human domain that supplies the intentions and logic. The yellow paper formally defines the EVM as a state machine with only deterministic parameters and state transition operators. Oracle requests to another on-chain contract, and/or off-chain HTTP lookups still make for multiple deterministic transactions.

A standard interface that allows the appraisal of individual capabilities concurrently with output and the overall knowledge-base will reduce market search costs and increase the autonomous insertion of mindful innovation into the blockchain ecosystem. We provide for simple smart contracts to define and track an arbitrarily large number of HUCAP assets. Additional applications are discussed below.

The Belief-Desire-Intention model is a plan-theoretic framework for establishing means-end coherence in agent based modelling system.
The blockchain's cryptographic security architecture reliably scales to a blockchain based PKI web-of-trust hierarchies.
ERC-20 token standard allows any tokens on Ethereum to be re-used by other applications: from wallets to decentralized exchanges.
ERC-721 token standard allows wallet/broker/auction applications to work with any NFT on Ethereum.
ERC-1155 Crypto Item standard allows a smart contract interface where one can represent any number of ERC-20 and ERC-721 assets in a single contract.

This standard is inspired by the belief–desire–intention (BDI) model of human practical reasoning developed by Michael Bratman as a way of explaining future-directed intention. A BDI agent is a particular type of bounded rational software agent, imbued with particular mental attitudes, viz: Beliefs, Desires and Intentions (BDI). The model identifies commitment as the distinguishing factor between desire and intention, and a noteworthy property that leads to (1) temporal persistence in plans and in the sense of explicit reference to time, (2) further plans being made on the basis of those to which it is already committed, (3) hierarchical nature of plans, since the overarching plan remains in effect while subsidiary plans are being executed.

The BDI software model is an attempt to solve a problem of plans and planning choice and the execution thereof. The complement of which tenders a sufficient metric for indicating means-end coherence and ascribing cost baselines to such outcomes.

## Specification

#### Main Interface
```solidity
pragma solidity ^0.4.25;
pragma experimental ABIEncoderV2;

/**
    @title ERC-**** Human Capital Accounting Standard
    @dev See https://github.com/freeworkculture/kazini/issues/11
    Note: the ERC-165 identifier for this interface is 0xf23a6e61.
 */

interface IERC_HUCAP {

    /**
        @notice Compute the index value of an Agents BDI in the ecosystem.
        @param _address Set the stance of an agent
        @dev For the purpose of 
        Throws on any error rather than return a false flag to minimize user errors
    */
    function updateIndex() internal returns (bool);

    /**
        @notice Get the active/inactive and states of an Agent in the ecosystem.
        @param _address Set the stance of an agent
        @dev For the purpose of 
        Throws on any error rather than return a false flag to minimize user errors
    */
    function iam() view public returns (bool iam_, IERC_HUCAP_TYPES.IS state_);

    /**
        @notice Fetch the bdi index value of an Agent in the ecosystem.
        @param _address Set the stance of an agent
        @dev For the purpose of 
        Throws on any error rather than return a false flag to minimize user errors
    */
    function index() view public returns (uint8 index_);
    
    /**
        @notice Count of Public Keys in key ring of an Agent in the ecosystem.
        @param _address Set the stance of an agent
        @dev For the purpose of 
        Throws on any error rather than return a false flag to minimize user errors
    */
    function ringLength() view public returns (uint ringlength_);

    /**
        @notice Get the PGP Public Key Id of an Agent in the ecosystem.
        @param "" Set the stance of an agent
        @dev For the purpose of 
        Throws on any error rather than return a false flag to minimize user errors
    */  
    function keyId() view public returns (bytes32 KEYID_);

     /**
        @notice Get the merit data of an Agent in the ecosystem.
        @param "" Set the stance of an agent
        @dev For the purpose of 
        Throws on any error rather than return a false flag to minimize user errors
    */   
    function merits() view public returns (
        uint experience_,
        bytes32 reputation_,
        bytes32 talent_,
        uint8 index_,
        bytes32 hash_);

    /**
        @notice Get the accreditation of an Agent in the ecosystem.
        @param "" Set the stance of an agent
        @dev For the purpose of 
        Throws on any error rather than return a false flag to minimize user errors
    */
    function kbase() view public returns (IERC_HUCAP_TYPES.KBase kbase_);

    /**
        @notice Get the desire of an Agent in the ecosystem.
        @param _desire    Pro-attitude
        @dev For the purpose of 
        Throws on any error rather than return a false flag to minimize user errors
        
    */
    function desire(bytes1 _desire) view external returns (bytes32);

    /**
        @notice Get the intention of an Agent in the ecosystem.
        @param _intention    Conduct-controlling pro-attitude
        @dev For the purpose of 
        Throws on any error rather than return a false flag to minimize user errors
        
    */
    function intention(bool _intention) view external returns  (bytes32);
    
    /**
        @notice Cycle the intention of an Agent in the ecosystem.
        @param _intention    Conduct-controlling pro-attitude
        @dev For the purpose of 
        Throws on any error rather than return a false flag to minimize user errors
    */
    function flipIntention() external returns  (bool);
    

    /**
        @notice Get the user data of an Agent in the ecosystem.
        @param ""    Conduct-controlling pro-attitude
        @dev For the purpose of 
        Throws on any error rather than return a false flag to minimize user errors
    */
    function getDoer() view external returns  (
        bytes32 fPrint,
        bool iam_,
        bytes32 email,
        bytes32 fName,
        bytes32 lName,
        uint age,
        bytes32 data_);

    /**
        @notice Get the belief data of an Agent in the ecosystem.
        @param _kbase    Source address
        @dev For the purpose of 
        Throws on any error rather than return a false flag to minimize user errors
        
    */
    function getBelief(IERC_HUCAP_TYPES.KBase _kbase) view external returns  (
        bytes32 country_,
        bytes32 cAuthority_,
        bytes32 score_);

    /**
        @notice Get the desire data of an Agent in the ecosystem.
        @param _desire    Pro-attitides
        @dev For the purpose of 
        Throws on any error rather than return a false flag to minimize user errors
        
    */
    function getDesire(bytes1 _desire) view external returns  (bytes32,bool);

    /**
        @notice Get the intention of an Agent in the ecosystem.
        @param _intention    Conduct-controlling pro-attitude
        @dev For the purpose of 
        Throws on any error rather than return a false flag to minimize user errors
        
    */
    function getIntention(bool _intention) view external returns  (IERC_HUCAP_TYPES.IS,bytes32,uint256);

    /**
        @notice Sign the Public Key of an Agent in the ecosystem.
        @param _address    Address of key to sign, must belong to an Agent 
        @dev For the purpose of 
        Throws on any error rather than return a false flag to minimize user errors
        
    */
    function sign(address _address) public onlyOwner returns (uint, bool signed);

    /**
        @notice Sign the Public Key of an Agent in the ecosystem.
        @param ""    internal helper function to add key in keyring
        @dev For the purpose of 
        Throws on any error rather than return a false flag to minimize user errors
    */
    function sign() external onlyDoer returns (uint, bool signed);

    /**
        @notice Revoke the Public Key of an Agent in the ecosystem.
        @param _address    Address of key to revoke, must belong to an Agent
        @dev For the purpose of 
        Throws on any error rather than return a false flag to minimize user errors
        
    */
    function revoke(address _address) external onlyDoer returns (uint, bool revoked);

    /**
        @notice Revoke the Public Key of an Agent in the ecosystem.
        @param ""    internal helper function to remove key from keyring
        @dev For the purpose of 
        Throws on any error rather than return a false flag to minimize user errors
    */
    function revoke() external onlyDoer returns (uint, bool revoked);

    /**
        @notice Set the trust level for a Public Key of an Agent in the ecosystem.
        @param _level    Degree of trust
        @dev For the purpose of 
        Throws on any error rather than return a false flag to minimize user errors
        
    */
    function trust(Trust _level) returns (bool);

    /**
        @notice Increment the number of keys in the keyring of an Agent in the ecosystem.
        @param _keyd    Target key
        @dev For the purpose of 
        Throws on any error rather than return a false flag to minimize user errors
        
    */
    function incSigns(bytes32 _keyd) external ProxyKey returns (uint);

    /**
        @notice Decrement the number of keys in the keyring of an Agent in the ecosystem.
        @param _keyd    Target key
        @dev For the purpose of 
        Throws on any error rather than return a false flag to minimize user errors
        
    */
    function decSigns(bytes32 _keyd) external ProxyKey returns (uint);

    /**
        @notice Set the knowledge credentials of an Agent in the ecosystem.
        @param _kbase    Level of accreditation
        @param _country      Source country
        @param _cAuthority     Accreditation authority
        @param _score  Accreditation 
        @param _year Year of Accreditation
        @dev For the purpose of 
        Throws on any error rather than return a false flag to minimize user errors
    */
    function setbdi(
        KBase _kbase,
        bytes32 _country,
        bytes32 _cAuthority,
        bytes32 _score,
        uint _year
        ) external ProxyBDI returns (bool qualification_);

    /**
        @notice Set the SNA metrics of an Agent in the ecosystem
        @param _refMSD    Minimum shortest distance
        @param _refRank      Rank of target key
        @param _refSigned     No of keys signed I have signed
        @param _refSigs  No. of keys that have signed my key
        @param _refTrust Degree of tructThrows on any error rather than return a false flag to minimize user errors
        @dev For the purpose of 
        Throws on any error rather than return a false flag to minimize user errors
    */
    function setbdi(
        uint _refMSD,
        uint _refRank,
        uint _refSigned,
        uint _refSigs,
        bytes32 _refTrust
        ) external ProxyBDI returns (bool reputation_);

    /**
        @notice Set the talents of an Agent in the ecosystem
        @param _talent    Agent's talent
        @dev For the purpose of 
        Throws on any error rather than return a false flag to minimize user errors
    */
    function setbdi(bytes32 _talent) external ProxyBDI returns (bool talent_);

    /**
        @notice Set the desires of an Agent in the ecosystem
        @param _desire    Pro-attitude
        @param _goal      A goal is an instatiated pro-attitude
        @dev For the purpose of 
        Throws on any error rather than return a false flag to minimize user errors
    */
    function setbdi(bytes1 _desire, Desire _goal) public onlyDoer returns (bool);

    /**
        @notice Set the intention of an Agent in the ecosystem
        @param _service    Conducting-controlling pro-attitude
        @dev For the purpose of 
        Throws on any error rather than return a false flag to minimize user errors
    */
    function setbdi(Intention _service) public onlyDoer returns (bool);
    
    /**
        @notice Set the targeted intention of an Agent in the ecosystem.
        @param _intention    Conduct-controlling pro-attitude
        @param _state      Agent stance       
        @dev For the purpose of 
        Throws on any error rather than return a false flag to minimize user errors

    */
    function intention(bool _intention, IERC_HUCAP_TYPES.IS _state) external returns  (IERC_HUCAP_TYPES.IS);

/* End of interface IERC_HUCAP */
}


```
#### User Defined Types Extension Interface

```solidity

interface IERC_HUCAP_TYPES {

/* Enums*/

    // Weights	   1,		2,		 4,		    8,		   16,	    32,		64,	    128    256
    enum KBase {PRIMARY,SECONDARY,TERTIARY,CERTIFICATION,DIPLOMA,LICENSE,BACHELOR,MASTER,DOCTORATE}
    
    
    enum IS { CLOSED, CREATOR, CURATOR, ACTIVE, INACTIVE, RESERVED, PROVER }

/* Structus */

        struct Clearance {
        bytes32 Zero;
        bytes32 Unknown;
        bytes32 Generic;
        bytes32 Poor;
        bytes32 Casual;
        bytes32 Partial;
        bytes32 Complete;
        bytes32 Ultimate;
    }
/* End of interface IERC_HUCAP_TYPES */
}

```
#### Web-of-trust Extension Interface

```solidity
pragma solidity ^0.4.25;
pragma experimental ABIEncoderV2;

interface IERC_HUCAP_KEYSIGNING_EXTENSION {

    bytes32 constant public _InterfaceId_ERC165_        = "CREATOR 0.0118 XOR OF ALL FUNCTIONS IN THE INTERFACE";   // Complies to ERC165

//  KEY MASKING TABLE
//  bytes32 constant public MASK 			   		    = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff;
//  bytes32 constant public KEYID                       = 0xffffffffffffffffffffffffffffffffff90EBAC34FC40EAC30FC9CB464A2E56; // EXAMPLE PGP PUBLIC KEY ID
//  bytes32 constant public KEY_CERTIFICATION 		    = 0x01ffffffffffffff << 192; // “C”	Key Certification
//  bytes32 constant public SIGN_DATA   			    = 0x02ffffffffffffff << 192; // “S”	Sign Data
//  bytes32 constant public ENCRYPT_COMMUNICATIONS 	    = 0x04ffffffffffffff << 192; // “E”	Encrypt Communications
//  Clearance constant public Trust                     = 0x03ff << 192; // Trust: Unknown
                                                        // BYTES32 Value with 
                                                        // Public Key Id, masking
                                                        // Key Certification masking
                                                        // Split Key masking
                                                        // Generic masking
                                                        // Ordinary masking
                                                        //  Trust.Unknown masking
                                                        //  bytes32 constant public DOER = 0x11ff10ff100f03ffff00ffffffffffffffff90EBAC34FC40EAC30FC9CB464A2E56;

    bytes32 constant public KEY_CERTIFICATION 		    = 0x01ffffffffffffff << 192; // “C”	Key Certification
    bytes32 constant public SIGN_DATA   			    = 0x02ffffffffffffff << 192; // “S”	Sign Data
    bytes32 constant public ENCRYPT_COMMUNICATIONS 	    = 0x04ffffffffffffff << 192; // “E”	Encrypt Communications
    bytes32 constant public ENCRYPT_STORAGE  		    = 0x08ffffffffffffff << 192; // “E”	Encrypt Storage
    bytes32 constant public SPLIT_KEY   			    = 0x10ffffffffffffff << 192; // Split key
    bytes32 constant public AUTHENTICATION   		    = 0x20ffffffffffffff << 192; // “A”	Authentication
    bytes32 constant public MULTI_SIGNATURE			    = 0x80ffffffffffffff << 192; // Held by more than one person
    bytes32 constant public TRUST_AMOUNT                = 0xffffffffffff00ff << 192;
    bytes32 constant public BINARY_DOCUMENT             = 0xffff00ffffffffff << 192; // 0x00: Signature of a binary document.
    bytes32 constant public CANONICAL_DOCUMENT          = 0xffff01ffffffffff << 192; // 0x01: Signature of a canonical text document.
    bytes32 constant public STANDALONE_SIGNATURE        = 0xffff02ffffffffff << 192; // 0x02: Standalone signature.
    bytes32 constant public GENERIC                     = 0xffff10ffffffffff << 192; // 0x10: Generic certification of a User ID and Public-Key packet.
    bytes32 constant public PERSONA                     = 0xffff11ffffffffff << 192; // 0x11: Persona certification of a User ID and Public-Key packet.
    bytes32 constant public CASUAL                      = 0xffff12ffffffffff << 192; // 0x12: Casual certification of a User ID and Public-Key packet.
    bytes32 constant public POSITIVE                    = 0xffff13ffffffffff << 192; // 0x13: Positive certification of a User ID and Public-Key packet.
    bytes32 constant public SUBKEY_BINDING              = 0xffff18ffffffffff << 192; // 0x18: Subkey Binding Signature
    bytes32 constant public PRIMARY_KEY_BINDING         = 0xffff19ffffffffff << 192; // 0x19: Primary Key Binding Signature
    bytes32 constant public DIRECTLY_ON_KEY             = 0xffff1Fffffffffff << 192; // 0x1F: Signature directly on a key
    bytes32 constant public KEY_REVOCATION              = 0xffff20ffffffffff << 192; // 0x20: Key revocation signature
    bytes32 constant public SUBKEY_REVOCATION           = 0xffff28ffffffffff << 192; // 0x28: Subkey revocation signature
    bytes32 constant public CERTIFICATION_REVOCATION    = 0xffff30ffffffffff << 192; // 0x30: Certification revocation signature
    bytes32 constant public TIMESTAMP                   = 0xffff40ffffffffff << 192; // 0x40: Timestamp signature.
    bytes32 constant public THIRD_PARTY_CONFIRMATION    = 0xffff50ffffffffff << 192; // 0x50: Third-Party Confirmation signature.
    bytes32 constant public ORDINARY   				    = 0xffffffff100fffff << 192;
    bytes32 constant public INTRODUCER 				    = 0xffffffff010fffff << 192;
    bytes32 constant public ISSUER	   				    = 0xffffffff001fffff << 192;

//  EDGES MASKING TABLE
    Clearance internal TRUST = Clearance({
        Zero:       0x01ff << 192,
        Unknown:    0x03ff << 192,
        Generic:    0x07ff << 192,
        Poor:       0xF0ff << 192,
        Casual:     0xF1ff << 192,
        Partial:    0xF3ff << 192,
        Complete:   0xF7ff << 192,
        Ultimate:   0xFFff << 192
        });

    /**
    /// @notice Cycle through state transition of an Agent in the ecosystem.
    /// @param _address toggle on/off a doer agent
    //  @dev `anybody` can retrieve the talent data in the contract
    */
    function flipTo(address _address) external onlyOwner returns (IS);

    /**
    /// @notice Turn Agent in the ecosystem to on/off.
    /// @param _address toggle on/off a doer agent
    //  @dev `anybody` can retrieve the talent data in the contract
    */
    function toggle(address _address) external onlyOwner returns (bool);

    /**
    /// @notice Set the trust level of an Agent in the ecosystem.
    /// @param _level toggle on/off a doer agent
    //  @dev `anybody` can retrieve the talent data in the contract
    */
    function trust(Trust _level) returns (bytes32 Trust);

    event LogCall(address indexed from, address indexed to, address indexed origin, bytes _data);

/* End of interface IERC_HUCAP_KEYSIGNING_EXTENSION */
}

```
#### Human Capital Accounting Extension Interface

```solidity
pragma solidity ^0.4.25;
pragma experimental ABIEncoderV2;

interface IERC_HUCAP_TRACKUSERS_EXTENSION {

    /// @notice Instantiate an Agent in the ecosystem with default data.
    /// @param _address initialise a doer agent
    //  @dev `anybody` can retrieve the talent data in the contract
    function initAgent(Doers _address) external onlyControlled returns (bool);

    /// @notice Get the data by uuid of an Agent in the ecosystem.
    /// @param _uuid Get the address of a unique uid
    //  @dev `anybody` can retrieve the talent data in the contract
    function getAgent(bytes32 _uuid) view external returns (address);

    /// @notice Get the data of all Talents in the ecosystem.
    /// @param _address Query if address belongs to an agent
    //  @dev `anybody` can retrieve the talent data in the contract
    function iam(address _address) view public returns (bool);

    /// @notice Get the data of all Talents in the ecosystem.
    /// @param _address Query if address belongs to a doer
    //  @dev `anybody` can retrieve the talent data in the contract
    function isDoer(address _address) view public returns (IS);

    /// @notice Get the number of doers that can be spawned by a Creators.
    /// The query condition of the contract
    //  @dev `anybody` can retrieve the count data in the contract
    function getAgent(address _address)
    view public returns (bytes32 keyid_, IS state_, bool active_, uint myDoers_);

    /// @notice Get the data of all Talents in the ecosystem.
    /// @param _talent The talent whose frequency is being queried
    //  @dev `anybody` can retrieve the talent data in the contract
    function getTalents(bytes32 _talent)
    view external returns  (uint talentK_, uint talentI_, uint talentR_, uint talentF_);

    /// @notice Increment a kind of talent in the ecosystem.
    /// @param The talent whose frequency is being queried
    //  @dev `anybody` can retrieve the talent data in the contract
    function incTalent() payable public onlyDoer returns (bool);

    /// @notice Decrement a kind of talent in the ecosystem..
    /// @param The talent whose frequency is being queried
    //  @dev `anybody` can retrieve the talent data in the contract
    function decTalent() payable public onlyDoer returns (bool);

    /// @notice Set the Public-Key Id of an Agent in the ecosystem.
    /// @param _address Set the Public-key Id of an agent
    //  @dev `anybody` can retrieve the talent data in the contract
    function setAgent(address _address, bytes32 _keyId) external onlyControlled returns (bytes32);

    /// @notice Transition the states of an Agent in the ecosystem.
    /// @param _address Set the stance of an agent
    //  @dev `anybody` can retrieve the talent data in the contract
    function setAgent(address _address, IS _state) external onlyControlled returns (IS);

    /// @notice Set the active status of an Agent in the ecosystem.
    /// @param _address Toggle the true/false status of an agent
    //  @dev `anybody` can retrieve the talent data in the contract
    function setAgent(address _address, bool _active) external onlyControlled returns (bool);

    /// @notice Set the data of all Intentions of Agents in the ecosystem.
    /// @param _serviceId Track number of offers available
    //  @dev `anybody` can retrieve the talent data in the contract
    function setAllPromises(bytes32 _serviceId) external onlyControlled;

/* End of interface IERC_HUCAP_TRACKUSERS_EXTENSION */
}


```
## Rationale
[WIP]

## Backwards Compatibility
[WIP]

## Test Cases
[WIP]

## Implementation
[WIP]

## Copyright
Copyright and related rights waived via [CC0](../LICENSE.md).
