gnolang / gno

Gno: An interpreted, stack-based Go virtual machine to build succinct and composable apps + Gno.land: a blockchain for timeless code and fair open-source
https://gno.land/
Other
842 stars 343 forks source link

Namespace support for package paths #1107

Open moul opened 9 months ago

moul commented 9 months ago

The feature we're discussing will be active on gno.land but might not be available on other tm2/gnovm blockchains.

Our objective is to emulate GitHub's user and organization structure, allowing contracts to be published either under an individual's or a team's namespace.

The process for registration is contract-based. This implies that the AddPkg command on the blockchain would need to reference a contract for filtering.

Note that namespaces (r/system/names) are distinct from r/demo/users and may have a unique registration mechanism. One proposal is to have a fee-based registration system, although we can consider flexibility during testnet phases.

While r/demo/users is envisioned as an open social feature with possible extensions, namespaces on the main chain might be more stringent. This might even include KYC requirements, especially for concise usernames or organizations, but this remains to be decided. It's essential to ensure the independence of r/demo/users.

Our intention isn't to limit contract publishing to only approved users. Rather, we want to provide preferred URLs for these users, and the option for teams to share a namespace. However, we still want to offer everyone the opportunity to publish contracts. Non-official contracts can be published under {p,r}/anon/{std.Address}/*.

graph TD

A{User Types}
B["{p,r}/manfred/* (Personal)"]
C["{p,r}/myorg/* (Team)"]
D["{p,r}/anon/g12345 (Anonymous)"]

A --> B
A --> C
A -->|Unofficial contracts| D

subgraph "Personal"
B --> E[Individual's Contracts]
B --> F[Personal Projects]
end

subgraph "Team"
C --> G[Team's Contracts]
C --> H[Shared Projects]
end

subgraph "Anonymous"
D --> I[Anonymous Contracts]
end

For team functionalities, initial support is necessary. Presently, any namespace is created by an admin. The status can shift to a team when the admin brings in other members, who can either be promoted to admin or remain as members.

I recommend we proceed with the original effort in #375. There's a promising implementation in #384 that might be adapted to complete the task.

More context: https://github.com/gnolang/gno/pull/384#issuecomment-1329879556. Related with #336.

Edit: I've added this to the 'test4' milestone for extra testing and documentation updates.

anarcher commented 9 months ago

I've talked about a similar idea before :-) https://github.com/gnolang/gno/issues/709

ajnavarro commented 3 months ago

Related too: https://github.com/gnolang/hackerspace/issues/30

thehowl commented 2 months ago

Could this work in testnets by associating a GitHub username?

Kouteki commented 1 month ago

This item will be a workshop topic on the Belgrade retreat. We'll know the priority and whether it's a post test4 launch milestone

Update (24/5): nice to have for Test4, but not a blocker

moul commented 1 month ago

Steps:

Bonus:

Kouteki commented 2 weeks ago

Blocks #2342