user6024: Does createrawtransaction always use the following script?
scriptPubKey: OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG
scriptSig: <sig> <pubKey>

If so, how do you create a transaction that uses a custom scriptPubKey value? If not, what is the syntax for writing the JSON that enables custom scriptPubKey values for the transaction using createrawtransaction? 

user6756: Yes that is correct.
What you can do is:

listunspent
createrawtransaction with receiver:amount and your change:amount 

(make the amount differ to pay the fee) 


Take the raw hex transaction and use it with http://brainwallet.org/#tx to be able to edit in JSON format. Don't worry, when your done you can sign the raw transaction in your local client.
About scriptPubKey, that is a little harder, and you should only experiment with this on testnet. You can try to understand this transaction https://en.bitcoin.it/wiki/Script#Transaction_puzzle and also try to understand how the stack works by playing around with jsforth

6024: <p>Does <code>createrawtransaction</code> always use the following script?</p>

<pre><code>scriptPubKey: OP_DUP OP_HASH160 &lt;pubKeyHash&gt; OP_EQUALVERIFY OP_CHECKSIG
scriptSig: &lt;sig&gt; &lt;pubKey&gt;
</code></pre>

<p>If so, how do you create a transaction that uses a custom <code>scriptPubKey</code> value? If not, what is the syntax for writing the JSON that enables custom scriptPubKey values for the transaction using <code>createrawtransaction</code>? </p>
 6756: <p>Yes that is correct.</p>

<p>What you can do is:</p>

<ul>
<li>listunspent</li>
<li>createrawtransaction with receiver:amount and your change:amount 
<ul>
<li>(make the amount differ to pay the fee) </li>
</ul></li>
</ul>

<p>Take the raw hex transaction and use it with <a href="http://brainwallet.org/#tx" rel="nofollow">http://brainwallet.org/#tx</a> to be able to edit in JSON format. Don't worry, when your done you can sign the raw transaction in your local client.</p>

<p>About scriptPubKey, that is a little harder, and you should only experiment with this on testnet. You can try to understand this transaction <a href="https://en.bitcoin.it/wiki/Script#Transaction_puzzle" rel="nofollow">https://en.bitcoin.it/wiki/Script#Transaction_puzzle</a> and also try to understand how the stack works by playing around with <a href="http://wiki.forthfreak.net/index.cgi?jsforth" rel="nofollow">jsforth</a></p>
