<p>Testnet adddresses start with <code>m</code> or <code>n</code>, for public key hashes, and <code>9</code> for script hashes.</p>
<p>There are no known scripts for addresses starting with <code>c</code>.</p>
<p>See more at <a href="https://en.bitcoin.it/wiki/List_of_address_prefixes" rel="nofollow noreferrer">Bitcoin's wiki - List of address prefixes</a></p>

CC BY-SA 4.0
2022-06-15T13:58:41.173Z
rookie mistake by me. Thanks.
jiamijiang
CC BY-SA 4.0
2022-06-14T17:13:37.333Z
2022-06-14T17:13:37.333Z
bordalix
<p>Here is my code to create a PSBT on the testnet:</p>
<pre><code>const bitcoin = require(&quot;bitcoinjs-lib&quot;)

const privKey1 = &quot;...&quot;
const address1 = &quot;mkVPHMR5euGTcvpFj6tfyVERstDdH4RtQs&quot;

const theKeyPair = bitcoin.ECPair.fromWIF(privKey1, bitcoin.networks.testnet)

const psbt = new bitcoin.Psbt({ network: bitcoin.networks.testnet })

psbt.addInput({
  hash: &quot;c77821e0565d17e857994b1e026d2cf382ef84b53fca76d1d4b63ce9ee645290&quot;,
  index: 0,
  nonWitnessUtxo: Buffer.from(&quot;02000000000101170e07c2351440cb0938947c3a41dddbbbe8aa80d44cdcaf6ea0f2b385abf9d20000000000feffffff02400d0300000000001976a914368ca7e5ed3e4c362cc89d65ea5377e4500a797988ac0c235b7500000000160014b31af8dfde1e14e2ac989fc8b166d8132e510d1a0247304402200cbcbdc329254f8bb179b994a60adba7b6015902eb88a7ee805db679f9538ee40220755a3ed40edcf94a31f13af9f30e84179eb5e672f0d7b2aeb2c6e0b46578c037012103c4f71eb5e4d36c44e6551d874bae0948cc7c06685c7198b174ce298538232c13f56a2200&quot;, &quot;hex&quot;)
})

psbt.addInput({
  hash: &quot;194e0a0bdb2d0ff22ede8c4eefe6b84419064c919b08ea5e656582e8d12c1b42&quot;,
  index: 1,
  nonWitnessUtxo: Buffer.from(&quot;0200000001f690b8dfd90ee3a8cf146b51c1f5d3180f2a58e997c2fd5aa10428f46b0fcd6d000000006b483045022100ae38259cf1643e8092ea2eade8de51bbbe0c48cac958f450619fa109616e85c0022046f57444fa3b6e05cb14499d302f19172f1a9db0af380ff1c8a36a6c0bb67e5e012102bc65de8691ff3a63c032aa3bde43acc4b22302a28d4554035a1e5791affd28bbffffffff0288130000000000001976a9140a27eeaabbb78515d92ac4237de4c75d5a7e047c88ac905f0100000000001976a914368ca7e5ed3e4c362cc89d65ea5377e4500a797988ac00000000&quot;, &quot;hex&quot;)
})

psbt.addOutput({
  address: &quot;cQqgBiALkRLfbc17BUJWjUSpKJzgumLP1utkZNJE5yiUcrAa6&quot;,
  value: 289000
})

psbt.signInput(0, theKeyPair)
psbt.validateSignaturesOfInput(0)
psbt.signInput(1, theKeyPair)
psbt.validateSignaturesOfInput(1)
psbt.finalizeAllInputs()

psbt.extractTransaction().toHex()
</code></pre>
<p>When I try to run the code I get the error below:</p>
<pre><code>  throw new Error(address + ' has no matching Script');
  ^

Error: cQqgBiALkRLfbc17BUJWjUSpKJzgumLP1utkZNJE5yiUcrAa6 has no matching Script
</code></pre>
<p>Any help? Could it be the way I instantiate my key pair?</p>

<raw-transaction><bitcoinjs><bip174-psbt>
testnet output address has no matching Script?
jiamijiang
# testnet output address has no matching Script?

(Asked by: username_0 on 2022-06-14)

Here is my code to create a PSBT on the testnet:
const bitcoin = require("bitcoinjs-lib")

const privKey1 = "..."
const address1 = "mkVPHMR5euGTcvpFj6tfyVERstDdH4RtQs"

const theKeyPair = bitcoin.ECPair.fromWIF(privKey1, bitcoin.networks.testnet)

const psbt = new bitcoin.Psbt({ network: bitcoin.networks.testnet })

psbt.addInput({
  hash: "c77821e0565d17e857994b1e026d2cf382ef84b53fca76d1d4b63ce9ee645290",
  index: 0,
  nonWitnessUtxo: Buffer.from("02000000000101170e07c2351440cb0938947c3a41dddbbbe8aa80d44cdcaf6ea0f2b385abf9d20000000000feffffff02400d0300000000001976a914368ca7e5ed3e4c362cc89d65ea5377e4500a797988ac0c235b7500000000160014b31af8dfde1e14e2ac989fc8b166d8132e510d1a0247304402200cbcbdc329254f8bb179b994a60adba7b6015902eb88a7ee805db679f9538ee40220755a3ed40edcf94a31f13af9f30e84179eb5e672f0d7b2aeb2c6e0b46578c037012103c4f71eb5e4d36c44e6551d874bae0948cc7c06685c7198b174ce298538232c13f56a2200", "hex")
})

psbt.addInput({
  hash: "194e0a0bdb2d0ff22ede8c4eefe6b84419064c919b08ea5e656582e8d12c1b42",
  index: 1,
  nonWitnessUtxo: Buffer.from("0200000001f690b8dfd90ee3a8cf146b51c1f5d3180f2a58e997c2fd5aa10428f46b0fcd6d000000006b483045022100ae38259cf1643e8092ea2eade8de51bbbe0c48cac958f450619fa109616e85c0022046f57444fa3b6e05cb14499d302f19172f1a9db0af380ff1c8a36a6c0bb67e5e012102bc65de8691ff3a63c032aa3bde43acc4b22302a28d4554035a1e5791affd28bbffffffff0288130000000000001976a9140a27eeaabbb78515d92ac4237de4c75d5a7e047c88ac905f0100000000001976a914368ca7e5ed3e4c362cc89d65ea5377e4500a797988ac00000000", "hex")
})

psbt.addOutput({
  address: "cQqgBiALkRLfbc17BUJWjUSpKJzgumLP1utkZNJE5yiUcrAa6",
  value: 289000
})

psbt.signInput(0, theKeyPair)
psbt.validateSignaturesOfInput(0)
psbt.signInput(1, theKeyPair)
psbt.validateSignaturesOfInput(1)
psbt.finalizeAllInputs()

psbt.extractTransaction().toHex()

When I try to run the code I get the error below:
  throw new Error(address + ' has no matching Script');
  ^

Error: cQqgBiALkRLfbc17BUJWjUSpKJzgumLP1utkZNJE5yiUcrAa6 has no matching Script

Any help? Could it be the way I instantiate my key pair?

**Tags:** raw-transaction, bitcoinjs, bip174-psbt


---

## 1 answers

### Answer by username_1 on 2022-06-14. Score: 1

Testnet adddresses start with `m` or `n`, for public key hashes, and `9` for script hashes.

There are no known scripts for addresses starting with `c`.

See more at [Bitcoin's wiki - List of address prefixes](https://en.bitcoin.it/wiki/List_of_address_prefixes)

> **Comments:**
> **username_0**: rookie mistake by me. Thanks.  

---

