2

We are wondering if there is a way to put text/data into the genesis block. We would like to save some information about what blockchain stands for in that.

We just want to know whether its possible or not. If yes, how to do it?

Thanks in advance

0

1 Answer 1

3

The chain-specification is just a list of storage key / value pairs.

So you can select a random key, and set some text as the value of that storage, and then insert that in your genesis block.

From there, this text will live in your blockchain storage forever.

Using a text to hex tool:

// Key
":my_statement:" = 0x3a6d795f73746174656d656e743a
// Value
"This is the text I want to store." = 0x5468697320697320746865207465787420492077616e7420746f2073746f72652e

Then you update your chain specification:

"genesis": {
    "raw": {
      "top": {
        "0x3a6d795f73746174656d656e743a": "0x5468697320697320746865207465787420492077616e7420746f2073746f72652e",
...
1
  • This method inserts the text in the the genesis storage, not the genesis Block. While this may be useful for many cases, it is not the same as eg "Chancellor on Brink of Second Bailout For Banks" which I believe is what the question is asking for. Commented Oct 2, 2023 at 13:52

Your Answer

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

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