Good day.
I've created 2 addresses from the same private key. One address is of course compressed, while the other isn't.
compressed_public_key = "025d9a1a0a5dab7e3e4a84c30a42ddc0d71b2da0fa1f3b99fbda9fc03eb8c75cd5"
corresponding_address = "mfjRUvWr9QZadpiRnbRfHS4UDSxdR9FE75"
uncompressed_public_key = "045d9a1a0a5dab7e3e4a84c30a42ddc0d71b2da0fa1f3b99fbda9fc03eb8c75cd535a0b893f20338d37d20eebe2941859dfe53b175f0bb24a27bc77741f0bb8cac"
uncompressed_address = "mi4kMd3HcLUGJSouNdJZ87eUBbi7cNE6C3"
I've also send some coins to each address.
utxo_to_compressed = "963baf6eb615a09afcb05ebcdbd3db05a163994dd2035002477c753ba3281eff"
utxo_to_uncompressed = "08a1286bb379f6eb5151828505b934c1b917201592bb76bd252a53b7a3009b17"
Using bitcore I've created the private_key to sign the transactions and the utxos as follow:
privateKey = new bitcore.PrivateKey(BN, "testnet")
scriptSig = "76a914" + hashedPubKey + "88ac";
And the hashed public keys are:
1bf398bb044e55f1971e384cc1e6d861dca3adb9 for the uncompressed
025bafbac8a8a1fcbae04f9a6aa8b6f968c9d145 for the compressed
utxo_compressed = new bitcore.Transaction.UnspentOutput({
"txId": "08a1286bb379f6eb5151828505b934c1b917201592bb76bd252a53b7a3009b17",
"outputIndex": 0,
"address": "mi4kMd3HcLUGJSouNdJZ87eUBbi7cNE6C3",
"script": scriptSig,
"satoshis": 5000000000
});
utxo_uncompressed = new bitcore.Transaction.UnspentOutput({
"txId": "963baf6eb615a09afcb05ebcdbd3db05a163994dd2035002477c753ba3281eff",
"outputIndex": 0,
"address": "mfjRUvWr9QZadpiRnbRfHS4UDSxdR9FE75",
"script": scriptSig,
"satoshis": 5000000000
});
Signing the compressed utxo isn't a problem. But once I'm trying to sign the uncompressed transaction I receive an error message.
compressedTx = new bitcore.Transaction();
uncompressedTx = new bitcore.Transaction();
compressedTx.from(utxo).to(some output).sign(privateKey); <-This one works fine
uncompressedTx.from(utxo).to(some output).sign(privateKey); <-This one fails
//Some inputs have not been fully signed Use//
In the past, I've sent and redeemed transactions from uncompressed public key (I did it manually, using a simple python code). I can't seem to find any reason why the inputs weren't signed.
I'll highly appreciate any help you might have to offer