Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] PersonaAutobiography v1.0.1.1 #194

Closed
neruthes opened this issue Sep 19, 2019 · 26 comments
Closed

[RFC] PersonaAutobiography v1.0.1.1 #194

neruthes opened this issue Sep 19, 2019 · 26 comments

Comments

@neruthes
Copy link
Contributor

neruthes commented Sep 19, 2019

Metadata

Field Value
Manifest Meta/Article-3
Purpose Data Management
Feedback deadline 2019-12-19 12:00:00 UTC
Explicitly designated reviewers @yisiliu @Jack-Works

Abstract

PersonaAutobiography is designed to provide a universal description format for every person, which should cover all scenarios and be compatible with all transportation methods.

Scenarios include persona backup, database backup, and persona export.

Transportation methods include QR, Base64 text, and JSON File.

Background

Payload Structure

Generic

{
    "Meta": {
        "PayloadSpec": "DeadSeaOldScroll",
        "Version": 1
    },
    "Content": {
        "_": {
            "AppLabel": "maskbook.com--persona-autobiography",
            "AppVersion": 1,
            "Time": 1569374955715,
            "Name": "Neruthes 0x5200DF38",
            "PersonaPrivateKey": null,
            "PersonaPublicKey": {
                "_": "ArxApPYD24e+RjrKyYMpG/2QemXLfxsISb+aFFbltJ1f",
                "encoding": "base-64"
            },
            "PersonaPublicKeyFingerprint": {
                "_": "BCD1FF19582A9B8D5CE9CB780E18C651318756B6",
                "hash": "SHA-1",
                "encoding": "hex"
            },
            "Profiles": {
                "facebook.com": [ "neruthes.5200DF38" ],
                "twitter.com": [ "neruthes" ]
            }
        }
    },
    "Signature": {
        "_": {
            "BaseSig": {
                "_": "WFceyl2VOyvyeaqkTodUI1XulcXQkRVQvh3U65vvMUuRq2ln9ozlECaZYLkKq9HHWKucm9sc2e52y32I1Foikg==",g
                "encoding": "base-64"
            }
        }
    }
}

Since there is no private key in this type, PersonaPrivateKey field should be null.

Including Private Key

{
    "Meta": {
        "PayloadSpec": "DeadSeaOldScroll",
        "Version": 1
    },
    "Content": {
        "_": {
            "AppLabel": "maskbook.com--persona-autobiography",
            "AppVersion": 1,
            "Time": 1569374955715,
            "Name": "Neruthes 0x5200DF38",
            "PersonaPrivateKey": {
                "_": "the natural law of privacy is now enforced by maskbook and tessercube",
                "encoding": "mnw"
            },
            "PersonaPublicKey": {
                "_": "ArxApPYD24e+RjrKyYMpG/2QemXLfxsISb+aFFbltJ1f",
                "encoding": "base-64"
            },
            "PersonaPublicKeyFingerprint": {
                "_": "BCD1FF19582A9B8D5CE9CB780E18C651318756B6",
                "hash": "SHA-1",
                "encoding": "hex"
            },
            "Profiles": {
                "facebook.com": [ "neruthes.5200DF38" ],
                "twitter.com": [ "neruthes" ]
            }
        }
    },
    "Signature": {
    }
}

Example

Over QR code

image

@Artoria2e5
Copy link
Contributor

Artoria2e5 commented Sep 30, 2019

Are we going to consider the case where one persona corresponds to multiple accounts/identifiers on a network? I mean, with the strict URL-like identifier encoding, adding a $1 $2 prefix will do because these things are gonna be invalid. Just don't call it FACEBO~2.com.


update: the new consensus is to use

[network: string]: string[]

@neruthes neruthes changed the title [RFC] Persona Metadata Exchange Format v1.0.0.0 [Draft] [RFC] Persona Metadata Exchange Format v1.0.1.0 [Draft] Sep 30, 2019
@neruthes
Copy link
Contributor Author

Its feasibility remains uncertain, but I do wish to have it possible in data level for now.

@neruthes neruthes changed the title [RFC] Persona Metadata Exchange Format v1.0.1.0 [Draft] [RFC] PersonaAutobiography v1.0.1.0 [Draft] Sep 30, 2019
@neruthes neruthes changed the title [RFC] PersonaAutobiography v1.0.1.0 [Draft] [RFC] PersonaAutobiography v1.0.1.0 Nov 19, 2019
@Jack-Works
Copy link
Member

I'm sorry but where will we use this?

@neruthes
Copy link
Contributor Author

@Jack-Works This is designed for persona backup with mnemonic words, where metadata needs a storage other than the sequence of mnemonic words.

@Jack-Works
Copy link
Member

@Jack-Works This is designed for persona backup with mnemonic words, where metadata needs a storage other than the sequence of mnemonic words.

We're not saving mnemonic words currently. Should we do this? Does it safe enough to do?

@Tedko
Copy link
Member

Tedko commented Nov 25, 2019 via email

@neruthes
Copy link
Contributor Author

@Jack-Works This is designed for persona backup with mnemonic words, where metadata needs a storage other than the sequence of mnemonic words.

We're not saving mnemonic words currently. Should we do this? Does it safe enough to do?

We should.

Safety remains open for discussion. Maybe @yisiliu has ideas to share on this topic.

@neruthes
Copy link
Contributor Author

For mnemonic words: better generate some encrypted file protected by a simple password?

Requiring a password on persona creation is not a good idea. We may introduce "Upgrade Persona Safety" feature in a later version. Device honesty is beyond our concern at this stage; we must assume that all devices are safe enough.

@neruthes neruthes changed the title [RFC] PersonaAutobiography v1.0.1.0 [RFC] PersonaAutobiography v1.0.1.1 Dec 3, 2019
@neruthes
Copy link
Contributor Author

neruthes commented Dec 3, 2019

Update:

An optional password field has been added in the interaction design draft. A user may optionally give a password if he feels necessary.

image

@neruthes
Copy link
Contributor Author

neruthes commented Dec 3, 2019

Update:

Now the autobiography may optionally include persona private key or mnemonic words. This can be used as a text-based full backup of a persona, like the "Base64" option in #369.

@neruthes
Copy link
Contributor Author

neruthes commented Dec 5, 2019

Update:

With this RFC ratified, optical transfer over QR will be possible, and it could remain.

@neruthes
Copy link
Contributor Author

neruthes commented Dec 5, 2019

Updated:

According to discussions in #407, password is now a mandatory field.

@neruthes
Copy link
Contributor Author

neruthes commented Dec 9, 2019

Since RFC #223 is ratified and #224 requires this RFC as a dependency, we can now work on this.

@neruthes neruthes removed the Component: GUN Gun.js related label Dec 9, 2019
@neruthes
Copy link
Contributor Author

neruthes commented Dec 9, 2019

This RFC relies on #225. Should ratify #225 fast.

@neruthes
Copy link
Contributor Author

neruthes commented Dec 9, 2019

Update:

RFC #225 has been ratified.

@neruthes
Copy link
Contributor Author

neruthes commented Dec 9, 2019

TO: @Jack-Works


You may want to introduce the latest design in RFC #223 here. Feel free to update the structure design in the RFC document content.

@neruthes
Copy link
Contributor Author

neruthes commented Dec 9, 2019

I will mark this as Ratified if there is no further discussion before today 12:00 UTC.


cc @yisiliu @Jack-Works @SunriseFox @guanbinrui

@Jack-Works
Copy link
Member

Objection. This format is too verbose.

Why prefer "Meta": { "PayloadSpec": "DeadSeaOldScroll", "Version": 1 },, instead of "version": 1? I'll draft a competitive format that is more concise but still extendable.

(By the way capitalized field name make it somewhat like the classic XML format)

@neruthes
Copy link
Contributor Author

neruthes commented Dec 9, 2019

Objection. This format is too verbose.

Why prefer "Meta": { "PayloadSpec": "DeadSeaOldScroll", "Version": 1 },, instead of "version": 1? I'll draft a competitive format that is more concise but still extendable.

I believe that verbosity is better than trivialization. We have a lot of JSON-based payloads. Preventing trivialization is more important than reducing verbosity. RFC #225 has been ratified already. Everyone has been granted sufficient time to review.

@Tedko
Copy link
Member

Tedko commented Dec 9, 2019

I'm for the idea of RFC and seems it's indeed necessary.
Also love to see @Jack-Works 's opinion beside verbose.

@Jack-Works @neruthes If you have time take a look of SOLID (and many w3c related) persona designs you might find them helpful. This is an issue under long debating.

Done is better than perfect. -- quote from someone.

@Jack-Works
Copy link
Member

A format that so verbose is not necessary.

A shorter version

{
  "meta": {
    "version": 1,
    "type": "file_type",
    "maskbookVersion": "1.8.0",
    "timestamp": 1569374955715
  },
  "datatype": [
    {
      "field1": "value1"
    }
  ]
}

@Tedko
Copy link
Member

Tedko commented Dec 10, 2019 via email

@neruthes
Copy link
Contributor Author

Feel free to introduce an alternative to #225. But be hurry.

@Jack-Works
Copy link
Member

Feel free to introduce an alternative to #225. But be hurry.

I have drafted a cleaner alternative. And we can even change between proposals (before we ship it to user)

@Jack-Works
Copy link
Member

Draft based on current database structure.

interface BackupJSONFileVersion2 {
    _meta_: {
        version: 2
        type: 'maskbook-backup'
        maskbookVersion: string // e.g. "1.8.0"
        createdAt: number // Unix timestamp
    }
    personas: Array<{
        identifier: string // PersonaIdentifier.toText()
        mnemonic?: {
            word: string
            parameter: { path: string; withPassword: boolean }
        }
        publicKey: JsonWebKey
        privateKey?: JsonWebKey
        localKey?: JsonWebKey
        nickname?: string
        linkedProfiles: Record</** ProfileIdentifier.toText() */ string, LinkedProfileDetails>
        createdAt: number // Unix timestamp
        updatedAt: number // Unix timestamp
    }>
    profiles: Array<{
        identifier: string // ProfileIdentifier.toText()
        nickname?: string
        localKey?: JsonWebKey
        linkedPersona?: string // PersonaIdentifier.toText()
        createdAt: number // Unix timestamp
        updatedAt: number // Unix timestamp
    }>
    userGroups: Array<{
        groupName: string
        identifier: string // GroupIdentifier.toText()
        members: string[] // Array<ProfileIdentifier.toText()>
        banned?: string[] // Array<ProfileIdentifier.toText()>
    }>
    posts: Array<{
        postBy: string // ProfileIdentifier.toText()
        identifier: string // PostIVIdentifier.toText()
        postCryptoKey?: JsonWebKey
        recipients: Record</** ProfileIdentifier.toText() */ string, RecipientDetail>
        recipientGroups: string[] // Array<GroupIdentifier.toText()>
        foundAt: number // Unix timestamp
    }>
}

@neruthes
Copy link
Contributor Author

neruthes commented Dec 10, 2019

I am closing all my RFCs since Meta/Article-3: RFC Peer Review Convention has been abolished. I assume that everyone agrees that this is not worth discussing for now. Some discussions may be restarted, if necessary, after Meta/Bill-4: DSD Peer Review Convention is ratified. In the meantime, if there is any question with documentation and workflow, please consult @yisiliu. Thanks for everyone who has engaged in the discussions so long.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants