npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@libonomy/secp256k1-keys

v1.0.1

Published

libonomy JS standard for address generation and offline signature support

Downloads

5

Readme

Overview

It should be acknowledged that the libraries that your are going to be interacting with are just the application level implementation with similar standards. Libonomy shouldnt be confused with COSMOS, Polkadot,Ethereum or others.

As the consensus run by libonomy is Aphelion: AI based protocol in its initial Coin Support with staking systems i.e DPOS(Tendermint), POS.

Aphelion runs multiple pooling networks within its AI core so its strongly recommended when exploring the system you utilize the relevant pool or keep your self updated with our github or educate yourself through our whitepaper or development team.

@libonomy/secp256k1-keys is based on elliptic curve cryptography is used for generating keypairs,message signing and bech32prefix addressed standard followed commonly by blockchains.

This library gives the ability for offline message signing with the relevant private key and than broadcasting the signed transaction using the RPC or REST calls

Note: The library is compatible/can be integrated with any JS implementation of frontend/backend. This library deals with tasks that are considered security-critical and should be used very carefully.

Usage

The examples of using the library are given below.

Create a wallet

import { generateWallet } from "@libonomy/secp256k1-keys"

const { libonomyAddress, privateKey, publicKey } = generateWallet()
// Attention: protect the `privateKey` at all cost and never display it anywhere!!

Generating the wallet with key pairs

//import the generate wallet function
import { generateWallet } from "@libonomy/secp256k1-keys"
//extract the necessary usage keys
const { libonomyAddress, privateKey, publicKey } = generateWallet() 
// Attention: protect the `privateKey` at all cost and never display it anywhere!!

Import a seed for generating wallet

import { generateWalletFromSeed } from "@libonomy/secp256k1-keys"
//generate the 24 byte length seed phrase or translate it to mnemonic using mnemonic translater
const seed = ...24 byte seed phrase
//bech32prefix is being used in libonomy for easily moving assets between different sidechains
const bech32prefix = 'libonomy';
const { libonomyAddress, privateKey, publicKey } = generateWalletFromSeed(seed, bech32prefix)

Transaction Signing

//import the function to sign the message with the private key
import { signWithPrivateKey } from "@libonomy/secp256k1-keys"
//drive the private keyconst privateKey = Buffer.from(...)
//create the message for signing it with the private key
//you can see different rpc messages examples and sign with the private keys
const signMessage =
{
account_number:"0",
chain_id:"main-beta-v1",
fee:{amount:[{amount:"37",denom:"ulby"}],
gas:"11600"},
memo:"(test beta transaction)",
msgs:[{type:"aphelion/MsgSend",value:{amount:[{amount:"1900000000",
denom:"ulby"}],
from_address:"libonomy89olempempp92x9hyzz**********",
to_address:"libonomy89olempempp92x9hyzz**********"}}],
sequence:"0"
},
//Sign the message
const signature = signWithPrivateKey(signMessage, privateKey)