I am using the Coinbase Multisig Vault and would like to build something similar that is able to replicate the entire HDM wallet using bitcore instead of bitcoinjs. The idea is: input xpubs, output addresses. I would eventually like to do this for the Copay wallet as well.
Most services (e.g. bitgo, bip32.org etc) use the compressed pubkey to create a multisig redeem script because you can pack more pubkeys into the script (limit 500 bytes iirc)
Ah thank you so much. There’s no way I would have figured that out unless I knew the bitcoin scripting language and what arguments it accepted for public keys.
For anyone who runs into this problem into the future, here is a quick way to generate uncompressed public keys using bitcore!
var pub = new bitcore.HDPublicKey('xpub661MyMwAqRbcEk2YrSM37a5skePAXy1CDyyKKBbVBvu6BxKqGb4C7WMFzrwEFHV3b9gQHy9oQVAf19Uw3SG5by68bM22HsHgC7zEZCr1EsC');
var derivedHdPublicKey = pub.derive('m/0');
var derivedPublicKey = derivedHdPublicKey.publicKey;
/* Derive bitcoin uncompressed public key from compressed public key */
'04' + derivedPublicKey.point.x.toString('hex') + derivedPublicKey.point.y.toString('hex')