How to create a valid unsigned transaction

0

How can I create a valid unsigned transaction which can be broadcasted and mined using these addresses?

Could someone create the raw transaction and show me?

sender's address: 1NsRUK6vmPbtQa8sSjeXVxeYQiGCGNi6W3

receiver's address: 37KSBUjixDYxmgmTdepb79aso69vPZrLu2

Note: These are both my addresses and their balances are 0.

Errol

Posted 2018-03-21T19:16:58.170

Reputation: 77

Answers

2

This is not how Bitcoin works.

Bitcoin does not use an accounts system nor does it use addresses on a protocol level. Spending Bitcoin means that you are spending from a transaction output. If there is no available transaction output for you to spend from, then you cannot create a transaction. So with addresses with 0 balance, no such valid transaction can be created.

Next, the "sending address" that you specified requires a digital signature in order to spend outputs associated with it. This is because that address type tells wallets that an output should be created which has the form OP_DUP OP_HASH160 <hash> OP_EQUALVERIFY OP_CHECKSIG where the address encodes the <hash> and the type of address specifies the other opcodes. So you cannot spend outputs that are associated with this address without being able to provide a valid digital signature that corresponds to the public key that hashes to <hash>.

What you could do is have a transaction output whose script is something like OP_DUP OP_HASH160 <hash> OP_EQUAL. This does not require a signature, but such a script, even though it can be constructed with the provided address, does not correspond to that address because it does not have the construction that the address type specifies.

Thus it is impossible to create such a valid unsigned transaction because 1) there is no output to spend and 2) the address requires a signature in order to spend from outputs associated with it.


Such a signature-less script as a I described corresponds to no address; there is no address type that specifies it.

The output script would look like this:

76a914ef0ffa5f1cc59bed17cf4e35ae9cbf396cddf17088

A transaction spending from that script would look like:

0200000001deadbeef000000000000000000000000deadbeef00000000000000000000000000000000222103061e97605659c9dc77ed437cbc345ec41633888ae3b2c75fdd532db789cc476fffffffff01000000000000000016a914ef0ffa5f1cc59bed17cf4e35ae9cbf396cddf1708700000000

Andrew Chow

Posted 2018-03-21T19:16:58.170

Reputation: 40 910

So could you provide an example of the transaction output script and the address type as well as a transaction like that in hex please?Errol 2018-03-21T19:56:14.797

Like what? The example script I provided that requires no signature?Andrew Chow 2018-03-21T20:02:19.217

yes as well as an example of how the transaction would look like in hex and an example of the address type,Errol 2018-03-21T20:29:46.573

I updated the answer with an example. Note that the example does not actually spend from any existing outputs.Andrew Chow 2018-03-21T20:40:03.700

But if you created a p2sh transaction with the scriptsig as OP_TRUE using an output script like that, would it not be possible?Errol 2018-03-21T20:56:49.510

Yes it would be possible, but also completely unrelated to the addresses you provided.Andrew Chow 2018-03-21T21:01:07.213

So what would happen if you change the op codes of a utxo in order for it to be spent without a signature?Errol 2018-03-21T21:13:31.610

You can't change the opcodes of an existing UTXO. Changing a UTXO requires changing the transaction that contains the UTXO and re-mining the block containing that transaction AND all blocks following it. It is impossible for someone to do that if they don't have the private keys involved in the transaction that created the UTXO too.Andrew Chow 2018-03-21T21:15:54.377