Skip to content

%passport v1 spec #1304

@ajlamarc

Description

@ajlamarc

In https://github.com/holium/realm/wiki/Passport-spec we laid out different iterations of passport, starting with v1. V1 is about smooth onboarding and connecting users to others that are using Realm. This requires an opt-in centralized service and an evolution of the %friends agent.

image

Friends sur

Refer to https://github.com/holium/realm/blob/master/desks/realm/sur/friends.hoon for the current.

::
:: friends state version 2
+$  friends   (map @p friend)
::
::  $friend: these values are mostly used by us for bookkeeping on peers.
::  contact-info and status is received by peers.
::
+$  friend
  $:  pinned=_|
      tags=(set @t)
      ::
      :: public -> only set by us. If public, others can discover us
      :: by searching twitter handle or Realm username.
      :: linking contacts allows discovery via phone number.
      ::
      :: your phone number will _never_ be visible to anyone.
      ::
      :: private: those that "know" you (have shared space(s)/DMs with you)
      :: can see your profile.
      ::
      public=(unit _|)
      phone-number=(unit @t)
      :: %our = us
      :: %fren = friend (sent/received and accepted)
      :: %received = live friend request received
      :: %sent = live friend request sent
      :: %contact = legacy contact-store??
      ::
      :: %block = I blocked you. - last message is me going offline.
      :: Further friend requests are auto-denied,
      :: and we don't send them any updates.
      ::
      :: %know - Have shared space(s)/DMs together. Is this like %contact?
      :: This may present scaling issues - we can kill
      :: "knows" data when you no longer share a connection.
      ::
      :: defaults to %know
      relationship=?(%our %fren %received %sent %contact %know %block)
      :: %invisible is used by us only, communicated to peers as %offline
      :: defaults to %offline
      status=?(%online %away %dnd %offline %invisible)
      :: Taking live status updates further:
      :: These are decent ideas but we need to weigh 
      :: implementation time + extra traffic over Urbit.  Putting them as ideas for later
      :: Bazaar could be scried for apps/spaces we already know about, 
      :: otherwise (for public spaces / apps) a database query would be required
      :: to resolve from space-path to public space name, etc.
      ::
      :: platform=?(%desktop %mobile)
      :: curr-space=(unit space-path)
      :: curr-app=(unit app-path)
      :: curr-room=(unit room-path)
      contact-info=(unit contact-info)
      :: stretch: I should be able to set photos / names
      :: for friends that override theirs.
      ::
      :: I should be able to set my name / photo for different spaces.
  ==
::
::  $contact-info: what a peer decides to tell us about themselves.
::
+$  contact-info
  $:  nickname=@t    :: passport set name (required)
      color=@t             :: passport set color
      twitter=(unit @t)  :: twitter handle
      bio=(unit @t)
      avatar=(unit @t)
      cover=(unit @t)
      featured-url=(unit @t)  :: can be used for personal site, linktree, opensea...
  ==
::
::  $contact-info-edit: updates from peer about their information.
::  this should eventually be done via SSS.
::
+$  contact-info-edit
  $:  nickname=(unit @t)
      color=(unit @t)
      twitter=(unit @t)
      bio=(unit @t)
      avatar=(unit @t)
      cover=(unit @t)
      featured-url=(unit @t)
  ==

Postgres table

create table if not exists friends
(
    ship         TEXT    not null, // primary key
    is_public    boolean not null,
    nickname     TEXT    not null,
    color        TEXT    not null,
    twitter      TEXT,
    bio          TEXT,
    avatar       TEXT,
    cover        TEXT,
    featured_url TEXT,
    phone_number TEXT,
    created_at   integer not null,
    updated_at   integer not null,
)

^ If a ship was never public, this information should not be stored in the table.

Metadata

Metadata

Assignees

Labels

1:high-priorityNeeds to be done as soon as possiblestate-updateRequires a migration in hoon state

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions