protocol-acset
БесплатноБез исполняемых скриптовНе проверенModel decentralized protocols as attributed C-sets for compositional analysis, interoperability design, and protocol evolution. Apply categorical mathematics…
от plurigrid★ 73 звезды на GitHubОб этом скилле
Protocol ACSet: Compositional P2P Protocol Design
Model decentralized and P2P protocols as attributed C-sets (categorical data structures) to enable compositional analysis, verify interoperability, and design protocol evolution narratives.
Core Insight
Rather than viewing protocols as isolated systems, Protocol ACSet treats them as compositional objects in a category where:
- Objects = Protocols (IPFS, Iroh, Matrix, Nostr, etc.)
- Morphisms = Protocol bridges and adapters
- Attributes = Protocol properties (transport, encryption, topology)
- Composition = How protocols stack and interoperate
What is an Attributed C-Set?
An Attributed C-set is a graph structure with:
- Vertices (objects) and edges (relationships)
- Attributes (data attached to vertices/edges)
- Functorial structure (composition preserving operations)
Example: IPFS as an ACSet
objects:
- Object(name="ipfs", type="content-distribution", transport="tcp/quic")
morphisms:
- Morphism(from="ipfs-node", to="ipfs-peer", label="connect")
- Morphism(from="content-hash", to="blob", label="address")
attributes:
- (ipfs): [encryption="aes", topology="dht", consensus="none"]
- (ipfs→peer): [latency=50ms, bandwidth=100mbps]
Protocol Categories (Objects)
Every protocol maps to one or more protocol categories:
ProtocolACSet = {
objects: {
transport, // TCP, QUIC, UDP, WebRTC
security, // TLS, Noise, WireGuard
topology, // P2P, federated, hybrid
identity, // Public keys, DIDs, domains
data_model, // Append-only, CRDT, graph
discovery, // DHT, mDNS, relay, centralized
incentive // Proof-of-work, Filecoin, none
}
}
Key Protocols as ACSet Objects
Transport Layer
TRANSPORT = {
objects: [TCP, QUIC, UDP, WebSocket, WebRTC],
morphisms: {
TCP.upgrade_to(QUIC), // 0-RTT, connection migration
UDP.extend_to(QUIC), // Congestion control, ordering
WebSocket.fallback_to(TCP) // Browser compatibility
},
attributes: {
latency: latency,
connection_setup: rtt_count,
encryption_native: bool
}
}
Security Layer
SECURITY = {
objects: [TLS, Noise, WireGuard, Signal_Double_Ratchet],
morphisms: {
Noise.adapt_to(libp2p), // Generic handshake
WireGuard.operate_at(layer2), // VPN vs app layer
Signal.strengthen_with(perfect_forward_secrecy)
},
attributes: {
forward_secrecy: bool,
post_quantum_resistant: bool,
overhead_bytes: int
}
}
Topology Layer
TOPOLOGY = {
objects: [P2P_Direct, Federated, Relay_Based, Hybrid],
morphisms: {
P2P_Direct.fallback_to(Relay), // Firewall bypass
Federated.include_P2P_option, // FEP-1024 pattern
Relay.optimize_with_DHT // Peer discovery
},
attributes: {
centralization_risk: 0..1,
scalability: metric,
latency_vs_centralization: tradeoff
}
}
Identity Layer
IDENTITY = {
objects: [PublicKey, DID, Domain, Account],
morphisms: {
PublicKey.trustless(), // No registration
DID.composable_with(VerificationMethod),
Domain.delegate_to(Protocol), // FQDN ownership
Account.require_centralized_server()
},
attributes: {
portability: bool,
user_controlled: bool,
recovery_possible: bool
}
}
Data Model Layer
DATA_MODEL = {
objects: [AppendOnly, CRDT, GraphDB, RDF, MerkleDAG],
morphisms: {
AppendOnly.compose_with(CRDT), // Git + concurrent edits
CRDT.guarantee(CommutativeMonoid), // Math foundation
MerkleDAG.content_address(), // IPFS pattern
GraphDB.query_with(SPARQL)
},
attributes: {
eventual_consistency: bool,
conflict_resolution: strategy,
query_capability: query_language
}
}
Composition Laws
Protocols compose along morphisms following categorical laws:
Associativity (Functorial Composition)
(IPFS → IPNS → ENS) = IPFS → (IPNS → ENS)
Both paths represent content resolution chains—they should give the same result.
Identity (No-op Morphism)
Protocol ⊗ Identity = Protocol
Example: A protocol using transparent relays should function identically.
Yoneda Lemma (Composition Universality)
A protocol's properties are determined by how it relates to all other protocols:
IPFS_properties = ∀P: morphisms(P → IPFS) × morphisms(IPFS → P)
If two protocols have identical composition patterns with all others, they're equivalent.
Real Protocols as ACSet Instances
IPFS (Content Distribution)
# ACSet Definition
@acset_type IPFSProtocol <: AbstractACSet begin
(Node, Content, Peer)
node_has_content::EdgeVertexDouble
node_connects_peer::EdgeVertexDouble
hash_of::EdgeVertex
end
# Instance
ipfs = IPFSProtocol()
add_node!(ipfs, name="node-1", storage=1_000_000)
add_content!(ipfs, hash="baf...", size=50_000)
add_morphism!(ipfs, :node_h
Установить protocol-acset в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл protocol-acset?
Model decentralized protocols as attributed C-sets for compositional analysis, interoperability design, and protocol evolution. Apply categorical mathematics to P2P infrastructure.
Как установить скилл protocol-acset?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл protocol-acset запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic