conradoqg / naivecoin

A cryptocurrency implementation in less than 1500 lines of code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Storing extra information in the transaction?

brailateo opened this issue · comments

Would it be possible to send some extra information in a transaction and store it in the block (e.g. a IPFS address where it could be found some extra data)?

I mean if there is any JSON field named "extra" in a transaction like in this example, to store that information also in the mined block:

{
  "fromAddress": "e155df3a1bac05f88321b73931b48b54ea4300be9d1225e0b62638f537e5544c",
  "toAddress": "c3c96504e432e35caa94c30034e70994663988ab80f94e4b526829c99958afa8",
  "amount": 9,
  "changeAddress": "e155df3a1bac05f88321b73931b48b54ea4300be9d1225e0b62638f537e5544c",
  "extra": {
     "type": "ipfs",
     "address": "bafybeiaysi4s6lnjev27ln5icwm6tueaw2vdykrtjkwiphwekaywqhcjze"
  },
}