xgov

1.0.10 • Public • Published

xGovern (XGOV)

Javascript-based decentralized group governance and data layer
(Utilizing NaCl library with x25519 elliptic curve cryptography)

LICENSE (Proprietary; For Audit-only Code Disclosure)

© 2018 xGovern Inc., all rights reserved.
Unauthorized copying of this file, via any medium is strictly prohibited.

API Usage & Documentation

Address Creation with generate_address

xgov.generate_address(
        {domain:(str,''), group:(str,''), async_interval:(+int,300)},
        {callback:(func), onprogress(func)}
);

//
// Address generation with default protocol and no group membership
// the first argument '{domain:'', group:''}' can be '{}', still the same result;
//
xgov.generate_address({domain:'', group:''},{
    callback:function(e,data){
        if(e) return; //Error case;
        var address = data.address //e.g. starts with x_ (x_XzOw9o048uk5jwSqKE1rUpASe8plQCKEG3JreiUHU0r)
        var secret = data.secret //e.g. 42~43 character long base62_encoded private key (string)
    }
});
 
//
// Address generation with default protocol and U.S. group membership signifier
// takes about 1~7 seconds to generate one keypair with US header (with a single-thread 2Ghz core)
// async_interval: how many new key pairs try after 'onprogress' triggers and process rests; 
//  e.g. 500, after 500 new key pairs tried, onprogress is triggered and process rests to pass other executions
//
xgov.generate_address({domain:'', group:'US', async_interval:500},{
    callback:function(e,data){
        if(e) return; //Error case;
        var address = data.address //e.g. starts with xUS_ (xUS_XzOw9o048uk5USSqKE1rUpASe8plQCKEG3JreiUHU0r)
        var secret = data.secret //e.g. 42~43 character long base62_encoded private key (string)
    },
    onprogress:function(meta){
        meta.count; //how many new key pairs have been tried so far to match something that starts with group header 'xUS';
        meta.domain; //Target protocol domain
        meta.group; //target group
    }
});
 

Authors

Written by:
Joe K. Kim (jkk@xgovern.com)

Package Sidebar

Install

npm i xgov

Homepage

xgovern.com

Weekly Downloads

9

Version

1.0.10

License

Proprietary

Unpacked Size

273 kB

Total Files

8

Last publish

Collaborators

  • xgovern
  • xdlt
  • joekkim-git