user80233: How can I create an anyone-can-spend transaction using p2pkh outputs?
Also how would such a transaction in hex look like?

user89968: For a P2PKH anyone-can-spend, just send to the address 1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH -- its private key is the integer 1, or in WIF format, KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU73sVHnoWn. Anyone can spend from this address since the private key is known to all.

user208: If it's a P2PKH output, it's not anyone-can-spend. P2PKH implies there is a public key that needs to sign for spending.
You can use a P2SH or P2WSH output which sends to an OP_TRUE script, though. 
You can also manually craft a transaction with a scriptPubKey that is literally OP_TRUE. No address corresponds to such an output, so you couldn't use off the shelf wallet software for it.

80233: <p>How can I create an anyone-can-spend transaction using p2pkh outputs?</p>
<p>Also how would such a transaction in hex look like?</p>
 89968: <p>For a P2PKH anyone-can-spend, just send to the address 1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH -- its private key is the integer 1, or in WIF format, KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU73sVHnoWn. Anyone can spend from this address since the private key is known to all.</p>
 208: <p>If it's a P2PKH output, it's not anyone-can-spend. P2PKH implies there is a public key that needs to sign for spending.</p>

<p>You can use a P2SH or P2WSH output which sends to an <code>OP_TRUE</code> script, though. </p>

<p>You can also manually craft a transaction with a scriptPubKey that is literally <code>OP_TRUE</code>. No address corresponds to such an output, so you couldn't use off the shelf wallet software for it.</p>
