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

bitcore-namecoin

v0.0.4

Published

Namecoin Support for Bitcore

Downloads

9

Readme

Namecoin Support Module for Bitcore

NPM Package Build Status Coverage Status

bitcore-namecoin adds namecoin support to bitcore for creating namecoin name_* transactions, private keys, and scripts in Node.js and web browsers.

Note: This is still experimental software. This module is not intended for use in production environments, or for use where real money is at stake, at this point.

See the main bitcore repo for more information.

Getting Started

npm install bitcore-namecoin
bower install bitcore-namecoin

To import a namecoin WIF (from vanitygen, for example):

// return bitcore with namecoin commands overlayed
var bitcore = require('bitcore-namecoin');
var privateKey = bitcore.PrivateKey.fromWIF('74pxNKNpByQ2kMow4d9kF6Z77BYeKztQNLq3dSyU4ES1K5KLNiz');
var address = privateKey.toAddress();
console.log( address.toString());
// NAMEuWT2icj3ef8HWJwetZyZbXaZUJ5hFT

To create a name_new transaction:

var bitcore = require('bitcore-namecoin');
var tx = new bitcore.Transaction()
  .from(utxo)
  .nameNew('d/name', 'randomvalue', 'mzGfeiJFdQyiuQnhB45aeBYefzHJSsiSfj')
  .change('mpe83RGRVWibHrdgfmkJwTxgufNs9quaZC')
  .fee(0.005)
  .sign(privKeySet); // utxo and nameNew output addrs need to have privKeys here
// now we can broadcast out to the network
var serialized = tx.serialize();

To create a name_firstupdate transaction:

var tx = new bitcore.Transaction()
  .from([utxo, nameNewUtxo])
  .nameFirstUpdate('d/name', '092abbca8a938103abcc', 'VALUE', 'mzGfeiJFdQyiuQnhB45aeBYefzHJSsiSfj')
  .change('mpe83RGRVWibHrdgfmkJwTxgufNs9quaZC')
  .fee(constants.NETWORK_FEE.satoshis)
  .sign([privKeys[inputAddr], privKeys[nameNewAddr]]);
var serialized = tx.serialize();

To create a name_update transaction:

var tx =  new bitcore.Transaction()
  .from(utxos)
  .nameUpdate('AAAAAAAAAA', 'CCCCCCCCCC', 'mkGdewyuvU13uHzpMUZe2t8ii4LKgKC8mE')
  .change('mkVNqbVqcYxi3zB2fRfiRQonf4JjwdAvnE')
  .fee(constants.NETWORK_FEE.satoshis)
  .sign([privKeys[outputAddr],privKeys[nameFirstUpdate]]);
var serialized = tx.serialize();

Details

bitcore-namecoin works by pulling in bitcore and then adding Namecoin-specific version constants, name operation functions onto Transaction, and patches a few bitcore functions that do not allow for altcoin compatability (specifically bitcore.Script.fromString and Transaction.prototype._fromNonP2SH). These will hopefully by replaced by native Bitcore functions as I work to improve Bitcore's altcoin compatability.

Contributing

Contributions are welcome! See CONTRIBUTING.md on the main bitcore repo for information about how to contribute.

License

Code released under the MIT license.

Written in 2015 by Brandon Robertz.