mediachain / aleph

א: The mediachain universe manipulation engine
MIT License
38 stars 16 forks source link

Generic write interface/protocol #132

Open parkan opened 7 years ago

parkan commented 7 years ago

It seems like we are looking at a few types of events that might trigger a "hey write this thing" event:

(so far)

There's a couple of places the object can be specified by these:

They may also optionally contain a few things like proofs of identity, access, or payment (either completed or pending/in escrow)

It seems like we may want a relatively uniform interface for receiving these. Unfortunately, we can't really have a totally consistent message format, because e.g. the 0mq case we're looking at already has one defined. But we can e.g. translate the 0mq message (after running the out-of-band request) to our internal format.

parkan commented 7 years ago

Requires #139

parkan commented 7 years ago

Signing

How will signing work? Probably have to ship (optional?) signature together with payload, but this requires consistent encoding.

Error conditions

Request format

similar to Statement, something like

{
  publisher: ... // optional?
  namespace: ....
  body: ... // simplestatement only
  ts: block.timestamp
  signature: ... // optional?
}

This could potentially also include information about payments, refunds, proofs, rewards, etc. For example, it could include the write fee that will be paid to replicating nodes. This may require an additional envelope around this, since I feel weird adding arbitrary fields like that into what's largely parallel to internal Statement type.