]> git.mxchange.org Git - friendica.git/blob - spec/zot-2012.txt
some psuedo code for the basic building blocks of zot-2012 - these are just ideas...
[friendica.git] / spec / zot-2012.txt
1
2 First create a global unique userid
3
4
5 Site userid:
6 https://macgirvin.com/1
7
8 $guuid = base64url_encode(hash('whirlpool','https://macgirvin.com/1.' . mt_rand(1000000,9999999),1);
9
10
11 Then create a hashed site destination.
12
13 $gduid = base64url_encode(hash('whirlpool', $guuid . 'https://macgirvin.com',1);
14
15 These two keys will identify you as a person+site pair in the future.
16 You will also obtain a password upon introducing yourself to a site.
17 This can be used to edit locations in the future. You will always keep your global unique userid
18
19
20 Introduce yourself to a site:
21
22
23 POST https://example.com/post
24
25 {
26 'type' => 'register'
27 'person' => $guuid
28 'address' => $gduid
29 'site' => 'https://macgirvin.com'
30 'info' => 'mike@macgirvin.com'
31 }
32
33 Returns:
34
35 {
36 'success' => 'true'
37 'pass' => me_encrypt($random_string)
38 }
39
40 ---
41 Add location
42 ---
43
44 POST https://example.com
45
46 {
47 'type' => 'location'
48 'person' => $guuid
49 'address' => $new_gduid
50 'site' => 'https://newsite.com'
51 'info' => 'mike@macgirvin.com'
52 'pass' => me_encrypt($gduid . '.' . $pass)
53 }
54
55 Returns:
56
57 {
58 'success' => 'true'
59 'pass' => me_encrypt($random_string)
60 }
61
62 ---
63 Remove location
64 ---
65
66 POST https://example.com
67
68 {
69 'type' => 'remove_location'
70 'person' => $guuid
71 'address' => $gduid
72 'pass' => me_encrypt($pass)
73 }
74
75 Returns:
76
77 {
78 'success' => 'true'
79 'message' => 'OK'
80 }
81
82
83 ------------
84 Make friends
85 ------------
86 This message may be reversed/repeated by the destination site to confirm
87
88
89 POST https://example.com/post
90
91 {
92 'type' => 'contact_add'
93 'person' => $gduid
94 'address' => $guuid
95 'target' => 'bobjones@example.com'
96 'flags' => HIDDEN=0,FOLLOW=1,SHARE=1
97 'confirm' => me_encrypt($guuid . '.' . $pass)
98 }
99
100 Returns:
101
102 {
103 'success' => 'true'
104 'message' => 'OK'
105 }
106
107
108
109
110
111
112
113 -------
114 Message
115 -------
116
117 POST https://example.com/post
118
119 {
120 'type' => 'post'
121 'person' => $guuid
122 'address' => $gduid
123 'post' => $post_id
124 }
125
126 Returns:
127 {
128 'success' => 'true'
129 'message' => 'OK'
130 }
131
132
133 --------
134 Callback
135 --------
136
137 POST https://macgirvin.com
138
139 {
140 'retrieve' => $post_id
141 'challenge' => you_encrypt('abc123')
142 'verify' => me_encrypt('xyz456' . '.' . $gduid)
143 }
144
145 Returns:
146
147 {
148 'success' => 'true'
149 'message' => 'OK'
150 'response' => 'abc123'
151 'data' => encrypted or raw structured post
152 }
153
154