From 7fd9e8ee64fce6bd99be2b1403a23181676abed8 Mon Sep 17 00:00:00 2001 From: Trevin Hofmann Date: Tue, 3 Feb 2015 21:18:42 -0600 Subject: [PATCH 1/2] 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. --- docs/address.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/address.md b/docs/address.md index fb1d942..26f40b6 100644 --- a/docs/address.md +++ b/docs/address.md @@ -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. From 99c88c440abc548e315b023f6f3c3163280a6a71 Mon Sep 17 00:00:00 2001 From: Trevin Hofmann Date: Wed, 4 Feb 2015 00:31:49 -0600 Subject: [PATCH 2/2] Apply lowerCamelCase to P2SHAddress in docs --- docs/address.md | 2 +- docs/index.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/address.md b/docs/address.md index 26f40b6..420eb23 100644 --- a/docs/address.md +++ b/docs/address.md @@ -38,7 +38,7 @@ A pay-to-script-hash multisignature Address can be instantiated from an array of ```javascript // a 2-of-3 address from public keys -var P2SHAddress = new Address([publicKey1, publicKey2, publicKey3], 2); +var p2shAddress = new Address([publicKey1, publicKey2, publicKey3], 2); ``` ## Validating an Address diff --git a/docs/index.md b/docs/index.md index 7bc1033..1a149dc 100644 --- a/docs/index.md +++ b/docs/index.md @@ -67,7 +67,7 @@ var address = privateKey.toAddress(); ```javascript // Build a 2-of-3 address from public keys -var P2SHAddress = new bitcore.Address([publicKey1, publicKey2, publicKey3], 2); +var p2shAddress = new bitcore.Address([publicKey1, publicKey2, publicKey3], 2); ``` ## Request a Payment