Git Refactoring - Paving the Way for Anonymous, Decentralized Open Source in the Web 3.0
Eli Ma <eli.ma@web3infra.foundation>
Eli Ma
Individual Member of Governing Board of Web3 Infrastructure Foundation
Background: VCS at Google
CVS
1998
Piper
CitC + Piper
CitC + Piper + jj�(Fig NG)
CitC + Piper + Mercurial�(a.k.a. Fig)
Perforce
Background: Mega Story
From Multi Repos to Monorepo
From Enterprise to Individual
From Centralized to Decentralized
Web3 Developer Infrastructure
Git - Addressable Content Filesystem/Database
Git Internal Objects
Blob
Tree
Commit
Tag
b
l
o
b
1
2
space
H
e
l
l
o
\0
,
w
o
r
l
d
!
Type
Size
Content
Variable-Length Decoding
1
1
0
1
0
1
0
1
0
0
0
0
0
1
0
1
1
0
1
0
1
0
1
0
0
0
0
1
0
1
1
0
1
0
1
0
1
MSB = 1
MSB = 0
Size
Size
Size = 1011010101
Git Pack File
1
0
0
1
0
1
0
1
0
1
0
1
0
1
0
1
MSB
Version
Object Type
Size
Size
b
l
o
b
1
2
space
H
e
l
l
o
\0
,
w
o
r
l
d
!
Type
Size
Content
P
A
C
K
Magic
2
1
0
1
Number
HEADER
Object
MSB
Git SSH Protocol
sequenceDiagram
participant Server
participant Client
Client ->> Server: Request to make a connection
Server ->> Client: Connection Established
Client ->> Server: Send repo info to Server
Server ->> Client: Send refs to Client
Client ->> Server: Send Computed data to Server
Server -> Client: Send pack to Client
Client -> Server: close a connection
Client -->> Client: Decode pack & update the local
Git URI - p2p://<peerID>/<repo>.git
[<protocol>://]<username>[:<password>]@<hostname>[:<port>]/<path>[.git]
DHT Data Format
[
{
"upstream":"12D3KooWFgpUQa9WnTztcvs5LLMJmwsMoGZcrTHdt9LKYwerxK",
"peerId":"node_a_peerId ",
"hash":"12D3KooWFgpUQa9WnTztcvs5LLMJmwsMoGZcrTHdt9LKYKpM4MiK",
"timestamp":1690191636
},
{
"upstream":"12D3KooWFgpU4564WnTztcvs5LLMJmwsMoGZcrTHdt9LKYKpM4MiK",
"peerId":"12D3KooWFgpUQa9WnTztcvs5LLMJmwsMoGZcrTHdt9LKYKpM4MiK ",
"hash":"ddddddd",
"timestamp":1690128000
}
]
P2P Process through DHT
Distributed Open Source Collaboration through Nostr
NIP 111 - Repo Broadcast
NIP 111 - Merge Request
Anonymous, Decentralized Open Source
End & Thanks
https://github.com/web3infra-foundation/mega