How would I calculate how much it would cost to store the string "hello world" on an Ethereum block? Would this be more or less than a transaction fee?
I suppose it depends how you store it. A single
SSTORE opcode can store 32 bytes, which is enough to store "hello world." An
SSTORE operation costs 20,000 gas if it's storing a non-zero value where a zero used to be.
The base gas used in a transaction (before any code is executed) is 21,000, so it would roughly double the cost of the transaction.