Community

NIPs

NIP-C0: Code Snippets

NIP-C0 defines kind 1337 for code snippets, adding language, filename, extension, runtime, license, dependency and repository metadata so shared code can be rendered and discovered as code instead of plain notes.

NIP-C0: Code Snippets visual
NIPs Under the hood Events, NIPs, relay behavior and the shared formats apps can trust.
Back to Nostr
NIPs

NIPs shelf

NIP pages connect standards to product behavior, event kinds, relay rules, wallets, media, privacy and implementation risk.

NIPs All NIPs pages NIPs route archiveNIP explainer pages, NIP reference pages, Protocol orientation Browse pagesClose shelf

Protocol orientation

Field guides

Awesome Nostr branches

NIP reference pages

Android Signer ApplicationBasic key derivation from mnemonic seed phraseBasic protocol flowbech32-encoded entitiesBLE CommunicationsBlossomBridged EventsCalendar EventsChatsChessClassified ListingsCode SnippetsCommentsComplete NIP Archive IndexCrays NIP StrategyCustom EmojiData Vending MachinesDealing with Unknown EventsDelegated Event SigningDraft EventsE2EE Messaging using MLSEcash Mint DiscoverabilityEncrypted Direct MessageEvent Deletion RequestExpiration TimestampExternal Content IDsExternal IdentitiesExtra metadata fields and tagsFile MetadataFollow ListForum ThreadsGeocachingGift Wrapgit stuffHandling MentionsHTTP AuthHTTP File Storage IntegrationLabelingListsLive ActivitiesMapping Nostr keys to DNS-based identifiersModerated CommunitiesNegentropy SyncingNIP and standards researchNIP-C0: Code SnippetsNIP-02: Follow ListNIP-03: OpenTimestamps AttestationsNIP-04: Encrypted Direct MessageNIP-05: Mapping Nostr keys to DNS-based identifiersNIP-5A: Static Websites / nsitesNIP-06: Basic key derivation from mnemonic seed phraseNIP-07: window.nostr capability for web browsersNIP-7D: Forum ThreadsNIP-08: Handling MentionsNIP-09: Event Deletion RequestNIP-10: Text Notes and ThreadsNIP-12: Generic tag queriesNIP-13: Proof of WorkNIP-14: Subject tagNIP-15: Nostr MarketplaceNIP-16: Event treatmentNIP-17: Private Direct MessagesNIP-18: RepostsNIP-19: bech32-encoded entitiesNIP-20: Command resultsNIP-21: nostr: URI schemeNIP-22: CommentsNIP-23: Long-form ContentNIP-24: Extra metadata fields and tagsNIP-25: ReactionsNIP-26: Delegated Event SigningNIP-27: Text Note ReferencesNIP-28: Public ChatNIP-29: Relay-based GroupsNIP-30: Custom EmojiNIP-31: Dealing with Unknown EventsNIP-32: LabelingNIP-33: Parameterized replaceable eventsNIP-34: git stuffNIP-35: TorrentsNIP-36: Sensitive ContentNIP-37: Draft EventsNIP-38: User StatusesNIP-39: External IdentitiesNIP-40: Expiration TimestampNIP-42: Authentication of clients to relaysNIP-43: Relay Access Metadata and RequestsNIP-44: Versioned EncryptionNIP-45: Counting ResultsNIP-46: Nostr Remote SigningNIP-C0: Code SnippetsNIP-48: Bridged EventsNIP-49: Private Key EncryptionNIP-50: Search CapabilityNIP-51: ListsNIP-52: Calendar EventsNIP-53: Live ActivitiesNIP-54: WikiNIP-55: Android Signer ApplicationNIP-56: ReportingNIP-57: Lightning ZapsNIP-58: BadgesNIP-59: Gift WrapNIP-60: Cashu WalletNIP-61: NutzapsNIP-62: Request to VanishNIP-64: ChessNIP-65: Relay List MetadataNIP-68: Picture-first feedsNIP-69: Peer-to-peer Order eventsNIP-70: Protected EventsNIP-71: Video EventsNIP-72: Moderated CommunitiesNIP-73: External Content IDsNIP-75: Zap GoalsNIP-77: Negentropy SyncingNIP-78: Application-specific dataNIP-84: HighlightsNIP-85: Trusted AssertionsNIP-86: Relay Management APINIP-87: Ecash Mint DiscoverabilityNIP-88: PollsNIP-89: Recommended Application HandlersNIP-90: Data Vending MachinesNIP-92: Media Attachments MetadataNIP-94: File MetadataNIP-96: HTTP File Storage IntegrationNIP-98: HTTP AuthNIP-99: Classified ListingsNIP-A0: Voice MessagesNIP-A4: Public MessagesNIP-B0: Web BookmarksNIP-B7: BlossomNIP-BE: BLE CommunicationsNIP-C0: Code SnippetsNIP-C7: ChatsNIP-CC: GeocachingNIP-EE: E2EE Messaging using MLSNIP-F4: PodcastsNIPs mirrorNostr NIPsNostr Remote Signingnostr-protocol/nipsnostr: URI schemeOpenTimestamps AttestationsPeer-to-peer Order eventsPicture-first feedsPodcastsPollsPrivate Direct MessagesPrivate Key EncryptionProof of WorkProtected EventsPublic ChatPublic MessagesReactionsReportingRepostsRequest to VanishSearch CapabilitySensitive ContentStatic Websites / nsitesSubject tagText Note ReferencesText Notes and ThreadsTorrentsTrusted AssertionsUser StatusesVersioned EncryptionVoice MessagesWeb BookmarksWikiwindow.nostr capability for web browsers

Research and library

Source inventory

Deep Research: Standards and NIPsResearch Source: Android Signer ApplicationResearch Source: Application-specific dataResearch Source: Authentication of clients to relaysResearch Source: Basic key derivation from mnemonic seed phraseResearch Source: Basic protocol flowResearch Source: BLE CommunicationsResearch Source: BlossomResearch Source: Bridged EventsResearch Source: Calendar EventsResearch Source: ChatsResearch Source: ChessResearch Source: Classified ListingsResearch Source: Code SnippetsResearch Source: CommentsResearch Source: Counting ResultsResearch Source: Custom EmojiResearch Source: Data Vending MachinesResearch Source: Dealing with Unknown EventsResearch Source: Delegated Event SigningResearch Source: Draft EventsResearch Source: E2EE Messaging using MLSResearch Source: Ecash Mint DiscoverabilityResearch Source: Encrypted Direct MessageResearch Source: Event Deletion RequestResearch Source: Expiration TimestampResearch Source: External Content IDsResearch Source: External IdentitiesResearch Source: Extra metadata fields and tagsResearch Source: File MetadataResearch Source: Follow ListResearch Source: Forum ThreadsResearch Source: GeocachingResearch Source: Gift WrapResearch Source: Groups NIP-29Research Source: Handling MentionsResearch Source: HighlightsResearch Source: HTTP AuthResearch Source: HTTP File Storage IntegrationResearch Source: LabelingResearch Source: ListsResearch Source: Live ActivitiesResearch Source: Mapping Nostr keys to DNS-based identifiersResearch Source: Moderated CommunitiesResearch Source: NIP-03: OpenTimestamps AttestationsResearch Source: NIP-5A: Static Websites / nsitesResearch Source: NIP-07: window.nostr capability for web browsersResearch Source: NIP-10: Text Notes and ThreadsResearch Source: NIP-11: Relay Information DocumentResearch Source: NIP-13: Proof of WorkResearch Source: NIP-14: Subject tagResearch Source: NIP-17: Private Direct MessagesResearch Source: NIP-18: RepostsResearch Source: NIP-19: bech32-encoded entitiesResearch Source: NIP-21: nostr: URI schemeResearch Source: NIP-25: ReactionsResearch Source: NIP-27: Text Note ReferencesResearch Source: NIP-28: Public ChatResearch Source: NIP-29 Groups RelayResearch Source: NIP-29: Relay-based GroupsResearch Source: NIP-34: git stuffResearch Source: NIP-35: TorrentsResearch Source: NIP-36: Sensitive ContentResearch Source: NIP-38: User StatusesResearch Source: NIP-43: Relay Access Metadata and RequestsResearch Source: NIP-44: Versioned EncryptionResearch Source: NIP-46: Nostr Remote SigningResearch Source: NIP-49: Private Key EncryptionResearch Source: NIP-50: Search CapabilityResearch Source: NIP-54: WikiResearch Source: NIP-56: ReportingResearch Source: NIP-62: Request to VanishResearch Source: NIP-65: Relay List MetadataResearch Source: NIP-66 / nostr-watch stackResearch Source: NIP-66: Relay Liveness MonitoringResearch Source: NIP-68: Picture-first feedsResearch Source: NIP-69: Peer-to-peer Order eventsResearch Source: NIP-70: Protected EventsResearch Source: NIP-77: Negentropy SyncingResearch Source: NIP-85: Trusted AssertionsResearch Source: NIP-86: Relay Management APIResearch Source: NIP-88: PollsResearch Source: NIP-89: Recommended Application HandlersResearch Source: NIP-A0: Voice MessagesResearch Source: NIP-A4: Public MessagesResearch Source: NIP-B0: Web BookmarksResearch Source: NIP-F4: PodcastsResearch Source: NIPs mirrorResearch Source: nostr-protocol/nips GitHub
Application datadraftoptionalcode

NIP-C0: Code Snippets

NIP-C0 defines kind 1337 for code snippets, adding language, filename, extension, runtime, license, dependency and repository metadata so shared code can be rendered and discovered as code instead of plain notes.

The quick readNIP-C0 defines kind 1337 for code snippets, adding language, filename, extension, runtime, license, dependency and repository metadata so shared code can be rendered and discovered as code instead of plain notes.
NIPC0Event kind1337Core contentcode textTagsl, name, extension, runtime, license, dep, repoRepo linkURL or NIP-34 repo announcementLicense formatSPDX short identifier

Code needs syntax, license and origin metadata

Developers can paste code into any text note, but the result is poor for search, rendering and reuse. A code snippet needs language metadata, filename, extension, runtime, dependencies, license and sometimes a repository origin.

NIP-C0 defines kind 1337 for that object. The code itself lives in content. Tags describe the programming language, file name, extension, short description, runtime, SPDX license, dependencies and repository reference.

The result is not full Git collaboration. NIP-34 handles richer Git-adjacent workflows. NIP-C0 is the small shareable code object: paste a function, make it readable, make its context portable.

Kind 1337 with developer-facing tags

The l tag names the programming language in lowercase. name can be a filename, extension the file extension, description a short explanation and runtime the environment. license should use a standard SPDX short identifier. dep tags can repeat for dependencies.

The repo tag can point to a normal URL or to a NIP-34 Git repository announcement in the form 30617:<pubkey>:<d-tag>, with a relay hint.

A client that supports C0 should preserve whitespace, syntax-highlight based on language, offer copy and download actions and show licensing clearly.

Code snippets moved from NIP-95 history into C0

Christian Chiarulli added NIP-C0 Code snippets in March 2025 through PR #1852, and fiatjaf renamed the earlier 95 slot to C0 the same day. Valentino Giudice improved the file in November 2025, and mattn and Vincenzo Imperati fixed typos and links in December.

A December 2025 issue asks whether the extension tag repeats information already present in a filename and whether extension values should be lowercase. That is the kind of small detail that matters for search and client consistency.

The NIP is therefore practical and still young: useful enough to build, but not as mature as the core event and relay specs.

First visible C0 addition2025-03 by Christian ChiarulliImproved2025-11 by Valentino GiudiceOpen Git history

A code client should protect formatting and licensing

Whitespace is content in code. A client should avoid smart typography, wrapped indentation or hidden truncation that changes meaning. Copy should copy the exact snippet.

License display matters because snippets can be reused. If a user publishes code without a license, the UI should not imply it is automatically free to copy into commercial projects.

Runtime and dependencies can turn a pretty snippet into something executable. When clients offer run buttons, they need sandboxing and clear trust boundaries.

1337Code snippet event.
lProgramming language.
licenseSPDX license tag.
repoSource repository reference.

Runnable code is a security surface

A snippet can be malicious, wrong, outdated or context-dependent. Rendering code is low risk; executing it is not. Run features need isolation and user warnings.

Searchable code snippets can also leak secrets if clients make publishing too easy. Compose flows should make users review what they are signing.

Direct sources

Use the official file first, then the commit history, implementation references and adjacent standards. NIPs move, and product guidance gets weaker when those source trails are hidden.

Back to the NIPs atlas
NIPs route visual cue 1
NIPs route visual cue 2
NIPs route visual cue 3
NIPs route visual cue 4
NIPs route visual cue 5

How to use this page

Use the NIPs route when product behavior needs a standard.

Search NIP numbers, event kinds, signers, media, wallets and moderation standards before a detail turns into confusion.

NIPsThe full NIPs route stays openNIPs route archiveStandards, event kinds, implementation notes and consequences.Browse pages
NIPs route visual cue 1
NIPs route visual cue 2
NIPs route visual cue 3
NIPs route visual cue 4
NIPs route visual cue 5

Bring something back

Ask, suggest, submit or nominate.

Ask a question, send a source, suggest a fix, submit a project or nominate a public Nostr account. The page stays stable; your contribution gets reviewed beside it.