Skip to content

Genesis commits in loro, with createdAt and createdBy fields #1211

@joepio

Description

@joepio

We have a bunch of views that depend on createdAt ordering, like the Chatroom and the Table editor. Right now these properties are explicitly set on Chat and TableRow properties. This is not a great solution IMO.

Since we cryptographically need to depend on knowhing who signed the genesis commit, we often need to know the createdBy field (containging the agent's private key) and the createdAt (part of the genesis commit).

So we should store this in a special field on every resource. THis field cannot be overwritten, otherwise cryptographic verification fails.

I think we should serialize these two fields when writing to JSON-AD, and we should also make them available in the Resource API e.g. resource.getCreatedBy() and resource.getCreatedAt(). We also need to index these properties so we can sort by them.

I also think the parent should be a property of genesis commit (unless it's a parentless / root resource like a drive). Useful for authorization checks.

I'm thinking about the role of initial propvals in the genesis commit. I don't want to bloat the genesis part of the commit, but i also do want to have some proof of what the itial values were. Maybe we can hash it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions