Giter VIP home page Giter VIP logo

jsbgl's Introduction

JavaScript Bitgesell library

travis build codecov coverage version

Crypto secp256k1 + wasm. Implemented: bip32, bip39, bip44, bip49, bip84, bip141. NIST random generation tests on the fly for entropy. Shamir's secret sharing for mnemonic.

Build

npm install jsbgl.js
npm run build:wasm:prebuild
npm run build:wasm
npm run build
npm run build:web

Use in browser

<script src="jsbgl.web.min.js"></script>
<script> ...
// inside async function 
var jsbgl = await jsbgl.asyncInit();
... </script>

Tests

https://github.com/bitaps-com/jsbgl/blob/master/test/jsbgl.test.js

Documentation

Documentation is available at https://jsbgl.readthedocs.io

Example of usage

Create address
  > let a= new Address()
  > a.address
  'bgl1qdzjn6rd7e84lt2m5d3yf9jcg42ncdje7vhp4rl'
  > a.privateKey.wif
  'L1LAHLFBWcW2E1xRsUooVL9ajxJXtsAUjJJ4GuPTgHKAKNhy6fsD'
  > let a = new Address('L1LAHLFBWcW2E1xRsUooVL9ajxJXtsAUjJJ4GuPTgHKAKNhy6fsD')
  > a.address
  'bgl1qdzjn6rd7e84lt2m5d3yf9jcg42ncdje7vhp4rl'
Create private key
  > createPrivateKey()
  'L1Gc4WGJWbH4HwjeHiBibyDRP3HRK2GvutXH2dhhJTxxE35uGwt6'
  > createPrivateKey(compressed=False)
  '5J54rpM5FW84bNAuoxf566rPsFYGmSYtvVcT4RjKKeX5PVwqu37'
Create wallet
  > let w = new Wallet({path_type:'BIP84'})
  > w.mnemonic
  'spell scrap legend skin witness inherit gadget resource control replace nothing suspect picnic open letter regret great video voice media bridge walnut parade write'
  > w.accountXPublicKey
  'zpub6rz33FnVq7Gk5zwSHFmU2JyS3TTxJcsidBkSYYEirtrrEYiWNoEVWTicx9AQFxBLgYqNjJRSWGmzGcAqYnXSGwBBj66SUDDoZwjMFdR1dCX'
  > let w = new Wallet({from:'spell scrap legend skin witness inherit gadget resource control replace nothing suspect picnic open letter regret great video voice media bridge walnut parade write'},path_type='BIP84')
  > w.Wallet.accountXPublicKey
  'zpub6rz33FnVq7Gk5zwSHFmU2JyS3TTxJcsidBkSYYEirtrrEYiWNoEVWTicx9AQFxBLgYqNjJRSWGmzGcAqYnXSGwBBj66SUDDoZwjMFdR1dCX'
   > w.getAddress(0).address
  'bgl1qn54eph87wl54atvctxmvvcqs707lwmw4x8pumc'
   > w.getAddress(0).privateKey
  'L3Rf12jKkYXwv8PTVbfi1JmYQMpe2VKKf94KB4ysrDnN2yFQAn9q'
   > w.getAddress(0).publicKey
  '03f8e334ae6dd193eba99220efc8b56e0b9d1a82a4f626c43da4f5a37e630f8e8b'

How to Contribute

In order to make a clone of the GitHub repo: open the link and press the β€œFork” button on the upper-right menu of the web page.

Workflow is pretty straightforward:

  1. Clone the GitHub
  2. Make a change
  3. Make sure all tests passed
  4. Add a record into file into change.log.
  5. Commit changes to own jsbgl clone
  6. Make pull request from github page for your clone against master branch

jsbgl's People

Contributors

4tochka avatar madnadyka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.