-2

I want to upload files to the testnet blockchain, specifically the Bitcoin testnet. I am looking for help on how to add a file to the Bitcoin testnet blockchain. I know that these coins are super easy to get via https://tbtc.bitaps.com, so I just want to know how do I do this? I can't use OP_RETURN because the program that sends them says that they don't work and there is an 80 byte limit that makes it harder even if I could easily do it. Is there a way to add data to the blockchain, i.e. by putting multiple addresses that encode information that have no known public key? This could be done with either bash, simple Python, or both. If there is a GUI program, that would be preferred and greatly appreciated. Thanks.

4
  • 4
    Just don't. It's not designed for that. Aug 26, 2019 at 18:56
  • Yes, this is perfectly OK. I won't do i to mainnet because mainnet coins have real value and would cost lots of $ because I am not an early miner. (I made my first purchase in 2018 after the bubble quieted down at ~$6,500) Aug 26, 2019 at 19:01
  • +1 for @PieterWuille, It is not a question of the value of the coins but it is as if I went to the sea with the skiing for the snow. The whole blockchain would be affected Aug 26, 2019 at 19:12
  • 2
    @NumberFile If you don't care about doing it on mainnet, why do you care at all? This is simply not an interesting use case for blockchains. Aug 26, 2019 at 19:24

1 Answer 1

0

There are two ways to do it in a standard transaction format that will be relayed by full nodes. However, if you are a miner you will have more leeway into the scripts that you can use to lock your transaction. However, doing this is strictly discouraged as it adds to the UTXO and blockchain bloat in the first case and blockchain bloat in the second case. This answer is meant just for educational purposes.

Trick 1: create a bare multi-sig output (not P2SH) and sending some non-dust value to that base multi-sig address. You would use the bare multi-sig format for encoding like M <pub_key_1> <pub_key_2> ... <pub_key_N> N but here the pubkeys between OP_M and OP_N will be your data that you want to encode padded to the public key length. However, you can lock only up to 3 keys in bare multi-sid which will be 65*3 = 195 bytes. Again I mention that this method is discouraged as it adds to the UTXO bloat.

Trick 2: A better and cleaner way to do it will be to lock some BTC in a hash of the data you want to store encoded in a P2SH address. Then spend these bitcoins where the unlocking script will be the data that you want to store on the blockchain. In this case you can lock a much bigger data but care has to be taken not to exceed 400,000 WU for the overall transaction for spending as it would make the transaction non-standard.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.