<p>You will have to build the transaction yourself instead of relying on wallet software. You can either create it all from scratch and use pushtx or use an online API that accepts explicit input references to previous outputs. For example (check the last paragraph):</p>

<p><a href="http://dev.blockcypher.com/#transaction_skeleton" rel="nofollow">http://dev.blockcypher.com/#transaction_skeleton</a></p>

CC BY-SA 3.0
2014-05-02T21:16:27.163Z
2014-05-02T21:16:27.163Z
Matthieu
<p>Consider <a href="http://testnet.btclook.com/txn/7a438de42d601864aead3efec71e07ae97a20b74cd36da2bf4489c77f5bde03e" rel="nofollow">Testnet transaction 7a438...de03e</a> which has <code>vout[0].scriptPubKey</code> =</p>

<pre><code>OP_DUP OP_DROP OP_DUP OP_HASH160 039.....6fe OP_EQUALVERIFY OP_CHECKSIG
</code></pre>

<p>The script is equivalent to a standard pay-to-pubkeyhash scriptPubKey. Let's try to spend it:</p>

<pre><code>&gt; bitcoind createrawtransaction '[{"txid":"7a438.....de03e","vout":0}]' '{"mfq.....oDY":1.3}'
01000000013ee0bdf5779c48f42bda36cd740ba297ae071ec7fe3eadae6418602de48d437a0000000000ffffffff0180a4bf07000000001976a914039541a738df12eed1825b866eb5bb5aba6bf6fe88ac00000000

&gt; bitcoind signrawtransaction 01000.....00000
{
  "hex" : "01000000013ee0bdf5779c48f42bda36cd740ba297ae071ec7fe3eadae6418602de48d437a0000000000ffffffff0180a4bf07000000001976a914039541a738df12eed1825b866eb5bb5aba6bf6fe88ac00000000",
  "complete" : false
}
</code></pre>

<p>As you can see, <code>bitcoind</code> refuses to sign the transaction (same <code>hex</code> and obviously <code>complete</code> is <code>false</code>) I guess because it can't find a suitable address (since it's a non-standard script). I do indeed control the address and have its private key.</p>

<p>Is there any way to sign this transaction?</p>

CC BY-SA 3.0
2014-01-08T18:23:42.330Z
Still wondering about this. If Bitcoin message signing were just a plain ECDSA signature (is it?) I could just strip down the transaction (according to its sig type), hash it and RPC-`signmessage` the hash bytes. Then I just base68-decode the RPC result and use "<sig> <signedHash>" as my `scriptSig`. Could this scheme work? Will try ASAP.
kaoD
<json-rpc><raw-transaction><signature><non-standard-transaction>
How to sign non-standard transaction
kaoD
# How to sign non-standard transaction

(Asked by: username_0 on 2014-01-08)

Consider [Testnet transaction 7a438...de03e](http://testnet.btclook.com/txn/7a438de42d601864aead3efec71e07ae97a20b74cd36da2bf4489c77f5bde03e) which has `vout[0].scriptPubKey` =

```
OP_DUP OP_DROP OP_DUP OP_HASH160 039.....6fe OP_EQUALVERIFY OP_CHECKSIG

```

The script is equivalent to a standard pay-to-pubkeyhash scriptPubKey. Let's try to spend it:

```
> bitcoind createrawtransaction '[{"txid":"7a438.....de03e","vout":0}]' '{"mfq.....oDY":1.3}'
01000000013ee0bdf5779c48f42bda36cd740ba297ae071ec7fe3eadae6418602de48d437a0000000000ffffffff0180a4bf07000000001976a914039541a738df12eed1825b866eb5bb5aba6bf6fe88ac00000000

> bitcoind signrawtransaction 01000.....00000
{
  "hex" : "01000000013ee0bdf5779c48f42bda36cd740ba297ae071ec7fe3eadae6418602de48d437a0000000000ffffffff0180a4bf07000000001976a914039541a738df12eed1825b866eb5bb5aba6bf6fe88ac00000000",
  "complete" : false
}

```

As you can see, `bitcoind` refuses to sign the transaction (same `hex` and obviously `complete` is `false`) I guess because it can't find a suitable address (since it's a non-standard script). I do indeed control the address and have its private key.

Is there any way to sign this transaction?

**Tags:** json-rpc, raw-transaction, signature, non-standard-transaction

> **Comments:**
> **username_0**: Still wondering about this. If Bitcoin message signing were just a plain ECDSA signature (is it?) I could just strip down the transaction (according to its sig type), hash it and RPC-`signmessage` the hash bytes. Then I just base68-decode the RPC result and use "<sig> <signedHash>" as my `scriptSig`. Could this scheme work? Will try ASAP.  

---

## 1 answers

### Answer by username_1 on 2014-05-02. Score: 2

You will have to build the transaction yourself instead of relying on wallet software. You can either create it all from scratch and use pushtx or use an online API that accepts explicit input references to previous outputs. For example (check the last paragraph):

<http://dev.blockcypher.com/#transaction_skeleton>


---

