protected function createAddress($path) {
        $path = BIP32Path::path($path)->publicPath();

        $multisig = ScriptFactory::scriptPubKey()->multisig(2, BlocktrailSDK::sortMultisigKeys([
            $this->primaryPrivateKey->buildKey($path)->publicKey(),
            $this->backupPrivateKey->buildKey($path->unhardenedPath())->publicKey(),
            $this->getBlocktrailPublicKey($path)->buildKey($path)->publicKey()
        ]), false);

        if ($this->network !== "bitcoincash" && (int) $path[2] === 2) {
            $witnessScript = new WitnessScript($multisig);
            $redeemScript = new P2shScript($witnessScript);
            $address = $this->addressReader->fromOutputScript($redeemScript->getOutputScript())->getAddress();
        } else {
            $witnessScript = null;
            $redeemScript = new P2shScript($multisig);
            $address = $this->addressReader->fromOutputScript($redeemScript->getOutputScript())->getAddress();
        }

        return [$address, $redeemScript, $witnessScript];
    }