Creating new Addresses without using multichain-cli

+2 votes
Hi guys

I was wondering if you had any code snippets (preferably javascript) to create new multichain address outside of the wallet?

I'm looking at providing an API that will utilise a multichain blockchain behind it, but I need to be able the manage multiple keys and address without creating actual wallets for each user of the API.

Is this something you have or do you have any recommendations on approach?  I've read the page for how to build up multichain address http://www.multichain.com/developers/address-format/ which confirms it's not trivial :)

 

Thanks

 

Marty
asked Mar 27, 2016 by marty

1 Answer

0 votes

We don't have anything specifically ourselves, but my recommendation would be to find some code for generating bitcoin addresses such as bitcoinjs for Javascript, and make sure your MultiChain chain is configured to use bitcoin-compatible addresses. As stated on the page you linked, this means creating a blockchain whose params.dat has the following values:

address-pubkeyhash-version=00

address-scripthash-version=05

private-key-version=80

address-checksum-value=00000000

Later if you want to ensure your chain's addresses are not compatible with bitcoin's you can start to get more sophisticated about modifying the code to create addresses. But for many code snippets you'll find, you should already be able to choose different 1-byte values (2 chars of hex) for the first two parameters above and then set those in the code snippet. For example in the networks.js file in bitcoinjs.

answered Mar 27, 2016 by MultiChain
Does configuring for bitcoin address affect the use of custom assets on the multiChain instance??
No there's no relation, you can still use native assets with Bitcoin-style addresses so long as it's a MultiChain protocol blockchain.
Brilliant....thx!
...