Add documentation for instantiating P2SH multisig

There is documentation available at
http://bitcore.io/api/#Create_a_Multisig_Address but I think it would
also be useful in the address.md document.
This commit is contained in:
Trevin Hofmann 2015-02-03 21:18:42 -06:00
parent 970bf12df8
commit 7fd9e8ee64
1 changed files with 7 additions and 0 deletions

View File

@ -34,6 +34,13 @@ var publicKey = new PublicKey(privateKey);
var address = new Address(publicKey, Networks.testnet);
```
A pay-to-script-hash multisignature Address can be instantiated from an array of [PublicKeys](publickey.md).
```javascript
// a 2-of-3 address from public keys
var P2SHAddress = new Address([publicKey1, publicKey2, publicKey3], 2);
```
## Validating an Address
The main use that we expect you'll have for the `Address` class in Bitcore is validating that an address is a valid one, what type of address it is (you may be interested on knowing if the address is a simple "pay to public key hash" address or a "pay to script hash" address) and what network does the address belong to.