user89216: I'm fighting with PSBT to do a 2: 2 multisig with bitcoin-cli on testnet. Those are the steps I follow:

Create a multisig with bitcoin-cli createmultisig 2 "["pubkey1", "pubkey2"]"

Create the psbt with createpsbt:
bitcoin-cli createpsbt '[{"txid": "578b667a5b2498bce06cf4b31e027a5a045af321f2465d3a7d8f302ac61759e6", "vout": 1 }, { "txid": "237bda433527d32ddce8da640e96efcbf3fddc1fbde8add362abe197cc3c151f", "vout": 0 }]' '{"data": "49879816ffbca992d07559d56c0cb8cbc14aa7eb896bc79f532d272595b5906f", "tb1q369frc2yk5vfly8ya57ed2qr7p3jef6fzaqyz6": 0.00009500 }'

On one signer, call to walletprocesspsbt: bitcoin-cli walletprocesspsbt $psbt

If I call here to analyzepsbt $psbt, this is what I get:


{
  "inputs": [
    {
      "has_utxo": true,
      "is_final": false,
      "next": "updater",
      "missing": {
        "redeemscript": "e6b13137de705c19718f1aaf6f80709a9e6c1a7c"
      }
    },
    {
      "has_utxo": true,
      "is_final": false,
      "next": "updater",
      "missing": {
        "redeemscript": "e6b13137de705c19718f1aaf6f80709a9e6c1a7c"
      }
    }
  ],
  "fee": 0.00000500,
  "next": "updater"
}

To add the redeemscript it says is missing, ¿can I use walletcreatefundedpsbt? I try this:
bitcoin-cli walletcreatefundedpsbt '[{"txid": "578b667a5b2498bce06cf4b31e027a5a045af321f2465d3a7d8f302ac61759e6", "vout": 1, "scriptPubKey": "a914e6b13137de705c19718f1aaf6f80709a9e6c1a7c87", "witnessScript": "5221021efcdb8d9afb724ae7c58a3886656b56e3311e26f80a1d88e5f1f49e04d30d4b210345beb99ed5fd6ecad0e4a26b797b604495ebf85630c34e126a83c110b76dffdd52ae","amount":0.00005000}, {"txid": "237bda433527d32ddce8da640e96efcbf3fddc1fbde8add362abe197cc3c151f", "vout": 0, "scriptPubKey": "a914e6b13137de705c19718f1aaf6f80709a9e6c1a7c87", "witnessScript": "5221021efcdb8d9afb724ae7c58a3886656b56e3311e26f80a1d88e5f1f49e04d30d4b210345beb99ed5fd6ecad0e4a26b797b604495ebf85630c34e126a83c110b76dffdd52ae","amount":0.00005000}]'  '[{"data": "49879816ffbca992d07559d56c0cb8cbc14aa7eb896bc79f532d272595b5906f"}, {"tb1q369frc2yk5vfly8ya57ed2qr7p3jef6fzaqyz6": 0.00009500 }']

but I get "Insufficient funds" (error -4) ¿What I' missing or put it wrong on walletcreatefundedpsbt command?
Thank you very much! :-D

user208: 
Create a multisig with bitcoin-cli createmultisig 2 "["pubkey1", "pubkey2"]"

Here is your problem. createmultisig is a utility function that only computes the multisig address. It doesn't store or otherwise add that address to your wallet. As a result, when you invoke walletprocesspsbt to update/sign, the wallet has no idea what that address is, or how to sign for it.
You want to use addmultisigaddress instead.

To add the redeemscript it says is missing, can I use walletcreatefundedpsbt?

walletcreatefundedpsbt is an RPC to construct a PSBT from scratch; it's an alternative to the more manual createpsbt call, not a way to update an existing PSBT. You need to use walletprocesspsbt PSBT for that, but as I said, you first need to teach the wallet about the address you're using.

89216: <p>I'm fighting with PSBT to do a 2: 2 multisig with bitcoin-cli on testnet. Those are the steps I follow:</p>
<ul>
<li><p>Create a multisig with bitcoin-cli createmultisig 2 &quot;[&quot;pubkey1&quot;, &quot;pubkey2&quot;]&quot;</p>
</li>
<li><p>Create the psbt with createpsbt:</p>
<p>bitcoin-cli createpsbt '[{&quot;txid&quot;: &quot;578b667a5b2498bce06cf4b31e027a5a045af321f2465d3a7d8f302ac61759e6&quot;, &quot;vout&quot;: 1 }, { &quot;txid&quot;: &quot;237bda433527d32ddce8da640e96efcbf3fddc1fbde8add362abe197cc3c151f&quot;, &quot;vout&quot;: 0 }]' '{&quot;data&quot;: &quot;49879816ffbca992d07559d56c0cb8cbc14aa7eb896bc79f532d272595b5906f&quot;, &quot;tb1q369frc2yk5vfly8ya57ed2qr7p3jef6fzaqyz6&quot;: 0.00009500 }'</p>
</li>
<li><p>On one signer, call to walletprocesspsbt: bitcoin-cli walletprocesspsbt $psbt</p>
</li>
<li><p>If I call here to analyzepsbt $psbt, this is what I get:</p>
</li>
</ul>
<pre><code>{
  &quot;inputs&quot;: [
    {
      &quot;has_utxo&quot;: true,
      &quot;is_final&quot;: false,
      &quot;next&quot;: &quot;updater&quot;,
      &quot;missing&quot;: {
        &quot;redeemscript&quot;: &quot;e6b13137de705c19718f1aaf6f80709a9e6c1a7c&quot;
      }
    },
    {
      &quot;has_utxo&quot;: true,
      &quot;is_final&quot;: false,
      &quot;next&quot;: &quot;updater&quot;,
      &quot;missing&quot;: {
        &quot;redeemscript&quot;: &quot;e6b13137de705c19718f1aaf6f80709a9e6c1a7c&quot;
      }
    }
  ],
  &quot;fee&quot;: 0.00000500,
  &quot;next&quot;: &quot;updater&quot;
}
</code></pre>
<p>To add the redeemscript it says is missing, ¿can I use walletcreatefundedpsbt? I try this:</p>
<pre><code>bitcoin-cli walletcreatefundedpsbt '[{&quot;txid&quot;: &quot;578b667a5b2498bce06cf4b31e027a5a045af321f2465d3a7d8f302ac61759e6&quot;, &quot;vout&quot;: 1, &quot;scriptPubKey&quot;: &quot;a914e6b13137de705c19718f1aaf6f80709a9e6c1a7c87&quot;, &quot;witnessScript&quot;: &quot;5221021efcdb8d9afb724ae7c58a3886656b56e3311e26f80a1d88e5f1f49e04d30d4b210345beb99ed5fd6ecad0e4a26b797b604495ebf85630c34e126a83c110b76dffdd52ae&quot;,&quot;amount&quot;:0.00005000}, {&quot;txid&quot;: &quot;237bda433527d32ddce8da640e96efcbf3fddc1fbde8add362abe197cc3c151f&quot;, &quot;vout&quot;: 0, &quot;scriptPubKey&quot;: &quot;a914e6b13137de705c19718f1aaf6f80709a9e6c1a7c87&quot;, &quot;witnessScript&quot;: &quot;5221021efcdb8d9afb724ae7c58a3886656b56e3311e26f80a1d88e5f1f49e04d30d4b210345beb99ed5fd6ecad0e4a26b797b604495ebf85630c34e126a83c110b76dffdd52ae&quot;,&quot;amount&quot;:0.00005000}]'  '[{&quot;data&quot;: &quot;49879816ffbca992d07559d56c0cb8cbc14aa7eb896bc79f532d272595b5906f&quot;}, {&quot;tb1q369frc2yk5vfly8ya57ed2qr7p3jef6fzaqyz6&quot;: 0.00009500 }']
</code></pre>
<p>but I get &quot;Insufficient funds&quot; (error -4) ¿What I' missing or put it wrong on walletcreatefundedpsbt command?</p>
<p>Thank you very much! :-D</p>
 208: <blockquote>
<p>Create a multisig with bitcoin-cli createmultisig 2 &quot;[&quot;pubkey1&quot;, &quot;pubkey2&quot;]&quot;</p>
</blockquote>
<p>Here is your problem. <code>createmultisig</code> is a utility function that only computes the multisig address. It doesn't store or otherwise add that address to your wallet. As a result, when you invoke <code>walletprocesspsbt</code> to update/sign, the wallet has no idea what that address is, or how to sign for it.</p>
<p>You want to use <code>addmultisigaddress</code> instead.</p>
<blockquote>
<p>To add the redeemscript it says is missing, can I use walletcreatefundedpsbt?</p>
</blockquote>
<p><code>walletcreatefundedpsbt</code> is an RPC to construct a PSBT from scratch; it's an alternative to the more manual <code>createpsbt</code> call, not a way to update an existing PSBT. You need to use <code>walletprocesspsbt</code> PSBT for that, but as I said, you first need to teach the wallet about the address you're using.</p>
