bowstave / meta-writer

Basic utility to write data to Metanet.
Other
58 stars 12 forks source link

include protocol separator #2

Closed rohenaz closed 5 years ago

rohenaz commented 5 years ago

B data is being written into what would is actually the "name" and "kwd..." metanet fields.

If there is no separator, there is no programmatic way to parse the data based on the protocol schema alone. You can't tell where meta stops and B begins. Looking for the specific B prefix string is not a solution as that would also be a valid filename or keyword string.

Many apps have been using the | character as a protocol separator.

mohrt commented 5 years ago

Agree, this is necessary!

rohenaz commented 5 years ago

It's not always 4 fields. 1) some fields are optional 2) the final field kwd ... can be repeated as many times as you like, hence the ...

Even when a protocol's excact width is known, not including a separator when using multiple protocols in a single tx means any software parsing that tx must know the schema of each protocol ahead of time which is not currently something it can look up on chain (that will likely be the case in the future though imo). That said, it still would not solve parsing variable width protocols. You must have a separator for that regardless of having an on-chain schema record.

If there is a separator, your parser doesn't need to know how many fields there will be for every protocol it may encounter. Of course metanet protocol is one that will be well known, but this should be handled in a standard way that applies to all OP_RETURN protocols, not just omitted on some because you "can probably figure it out", but then included for others.

rohenaz commented 5 years ago

After spending more time with the spec it is clear I misunderstood an example from the technical summary to be optional fields in metanet protocol itself. In this case the protocol width IS fixed so you can cleanly parse the data without a problem. Also, with ability to include multiple OP_RETURN outputs per tx becoming available soon the protocol pipelining method may be a thing of the past.