user128539: i transferred some coins to a testnet address 2MwP5KwNRsQV5cf3T7VcFU4Vhj2LcUeMiLM with a locking script just to play with scripts. the locking script is OP_1 OP_2 OP_ADD (always evaluates to true).
how can i get the coins from this address? (not for the coins, but to learn bitcoin script)
the address was made with bitcoin-cli decodescript 515293
...
  "p2sh-segwit": "2MwP5KwNRsQV5cf3T7VcFU4Vhj2LcUeMiLM"
...

(btw i know you can now claim the 1000 test sat, but please tell me how)

user129367: Take a look at the section about spending a p2sh in the learning bitcoin from the command line course. It mainly refers back to previous sections explaining the single steps but I think your question is about the variables that you need to put into the signing-transactions-command.
In the example it says:

[...] signing requires entering extra information for the (1)
scriptPubKey; (2) the redeemScript; and (3) any required private keys.
Here's the example of doing so for that P2SH-embedded multisig in
§6.2: $ bitcoin-cli -named signrawtransactionwithkey hexstring=$rawtxhex prevtxs='''[ { "txid": "'$utxo_txid'", "vout": '$utxo_vout', "scriptPubKey": "'$utxo_spk'", "redeemScript": "'$redeem_script'" } ]''' privkeys='["cNPhhGjatADfhLD5gLfrR2JZKDE99Mn26NCbERsvnr24B3PcSbtR"]'
With any other sort of P2SH you're going to be including a different
redeemscript, but otherwise the practice is exactly the same.

Does that help?

128539: <p>i transferred some coins to a testnet address <code>2MwP5KwNRsQV5cf3T7VcFU4Vhj2LcUeMiLM</code> with a locking script just to play with scripts. the locking script is <code>OP_1 OP_2 OP_ADD</code> (always evaluates to true).</p>
<p>how can i get the coins from this address? (not for the coins, but to learn bitcoin script)</p>
<p>the address was made with <code>bitcoin-cli decodescript 515293</code></p>
<pre><code>...
  &quot;p2sh-segwit&quot;: &quot;2MwP5KwNRsQV5cf3T7VcFU4Vhj2LcUeMiLM&quot;
...
</code></pre>
<p>(btw i know you can now claim the 1000 test sat, but please tell me how)</p>
 129367: <p>Take a look at the <a href="https://github.com/BlockchainCommons/Learning-Bitcoin-from-the-Command-Line/blob/master/10_6_Spending_a_P2SH_Transaction.md" rel="nofollow noreferrer">section about spending a p2sh</a> in the learning bitcoin from the command line course. It mainly refers back to previous sections explaining the single steps but I think your question is about the variables that you need to put into the signing-transactions-command.</p>
<p>In the example it says:</p>
<blockquote>
<p>[...] signing requires entering extra information for the (1)
scriptPubKey; (2) the redeemScript; and (3) any required private keys.</p>
<p>Here's the example of doing so for that P2SH-embedded multisig in
§6.2: <code>$ bitcoin-cli -named signrawtransactionwithkey hexstring=$rawtxhex prevtxs='''[ { &quot;txid&quot;: &quot;'$utxo_txid'&quot;, &quot;vout&quot;: '$utxo_vout', &quot;scriptPubKey&quot;: &quot;'$utxo_spk'&quot;, &quot;redeemScript&quot;: &quot;'$redeem_script'&quot; } ]''' privkeys='[&quot;cNPhhGjatADfhLD5gLfrR2JZKDE99Mn26NCbERsvnr24B3PcSbtR&quot;]'</code></p>
<p>With any other sort of P2SH you're going to be including a different
redeemscript, but otherwise the practice is exactly the same.</p>
</blockquote>
<p>Does that help?</p>
