Is it possible to send a transaction containing hashed values in the body of it to no one? I explain better. I would like to store data on bitcoin and I would need to send a transaction containing this value but not to any specific address. I could i do it?
Related: How do I upload a file to a testnet blockchain. The process is similar.– Ugam KamatOct 5, 2019 at 16:01
You are free to design your
scriptPubKey for the Output Transaction as you wish. So just a
OP_RETURN makes it unspendable.
It's storing data on bitcoin blockchain is not a good practice but is possible to create a transaction with a special script.
The transaction name is Transaction null data, a little introduction on this type of the transaction is here
Using Bitcoin for data storage is not recommended. However, the cheapest way to do so is by committing data into a custom P2WSH PUSHDATA script and spending it. When you spend this P2WSH output, script bytedata is declared in witness data. Since witness scripts are subject to a consensus limit of 10,000 bytes and a standardness limit of 3600 bytes, the ideal max script construction for storing 3574-bytes should be:
<514-bytes> <510-bytes> <510-bytes> <510-bytes> <510-bytes> <510-bytes> <510-bytes> OP_2DROP OP_2DROP OP_2DROP OP_DROP OP_1
This construction compiles to a witness script of 3600-bytes. With a %75 discount in witness data, you end up paying for 900 vBytes to store 3574-bytes.