<p>you need to be  passing the  network parameter as the tuple and thus you forgot to put the {} on them . the link on github repo (<a href="https://github.com/bitcoinjs/bip174" rel="nofollow noreferrer">https://github.com/bitcoinjs/bip174</a>) explains the proposition in correct way.</p>

CC BY-SA 4.0
2019-09-27T13:18:46.453Z
2019-09-27T13:18:46.453Z
dhruv malik
<p>The example code for psbt.addOutput() with address '1KRMKfeZcmosxALVYESdPNez1AP1mEtywp' works as expected. But if I change this to an testnet address I get this error: ' has no matching script'. I expect I need to specify testnet somewhere, but do not know where.   </p>



<pre><code>    const psbt = new bitcoin.Psbt();
    psbt.addInput({
        hash: 'b881ecef041a7396f3c225644507955732ae98d4a736de7b9ac235c69e1eb182',  
        nonWitnessUtxo: Buffer.from(
        '020000000001012aa24043833303b066cf10...1a1800',
        'hex',
       ),

    });

    psbt.addOutput({
      //address: '1KRMKfeZcmosxALVYESdPNez1AP1mEtywp', &lt;- works
      address: 'mhm89vYkAjmU3MWUtyCUcsYYUvkgXT1FAw',
      value: 7240446,     //was 7250446

    });
</code></pre>

CC BY-SA 4.0
2019-09-27T12:07:07.993Z
Ok found it: const psbt = new bitcoin.Psbt({ network: testnet })
NoudS
<bitcoinjs><bip174-psbt>
Why do I get: Error: <address> has no matching Script
NoudS
# Why do I get: Error: <address> has no matching Script

(Asked by: username_0 on 2019-09-27)

The example code for psbt.addOutput() with address '1KRMKfeZcmosxALVYESdPNez1AP1mEtywp' works as expected. But if I change this to an testnet address I get this error: ' has no matching script'. I expect I need to specify testnet somewhere, but do not know where.   
    const psbt = new bitcoin.Psbt();
    psbt.addInput({
        hash: 'b881ecef041a7396f3c225644507955732ae98d4a736de7b9ac235c69e1eb182',  
        nonWitnessUtxo: Buffer.from(
        '020000000001012aa24043833303b066cf10...1a1800',
        'hex',
       ),

    });

    psbt.addOutput({
      //address: '1KRMKfeZcmosxALVYESdPNez1AP1mEtywp', <- works
      address: 'mhm89vYkAjmU3MWUtyCUcsYYUvkgXT1FAw',
      value: 7240446,     //was 7250446

    });

**Tags:** bitcoinjs, bip174-psbt

> **Comments:**
> **username_0**: Ok found it: const psbt = new bitcoin.Psbt({ network: testnet })  

---

## 1 answers

### Answer by username_1 on 2019-09-27. Score: 1

you need to be passing the network parameter as the tuple and thus you forgot to put the {} on them . the link on github repo (<https://github.com/bitcoinjs/bip174>) explains the proposition in correct way.


---

