{"id":"a696cfd6b3b58e47b78643c19348cac29fffa1fca41eaad44c3127e9d01be19c","pubkey":"2b39b4ffe62933df970e19366c22c1e092f953f83fcfed754e0f04d5a3b459f9","created_at":1745513636,"kind":30817,"tags":[["d","nip-b7"],["title","NIP-B7: Blossom"],["summary","How a Nostr client uses Blossom for media: reading a user's server list, and uploading to the servers it names."],["s","draft"],["t","nostr"],["t","nip"],["k","10063","User server list"],["k","24242","Blobs stored on mediaservers"],["alt","A specification: NIP-B7: Blossom"],["client","openspecs-import"],["published_at","1745513224"],["proxy","https://github.com/nostr-protocol/nips/blob/656cecc7c0a815b6a2b218d3b5d6f078b3f4dbab/B7.md","web"],["x","f9b5e68a838204671d7585288415bec1cf19b95541a348740cb16483d68b99ee"]],"content":"NIP-B7\n======\n\nBlossom media\n-------------\n\n`draft` `optional`\n\nThis NIP specifies how Nostr clients can use [Blossom][] for handling media.\n\nBlossom is a set of standards (called BUDs) for dealing with servers that store files addressable by their SHA-256 sums. Nostr clients may make use of all the BUDs for allowing users to upload files, manage their own files and so on, but most importantly Nostr clients SHOULD make use of [BUD-03][] to fetch `kind:10063` lists of servers for each user:\n\n```json\n{\n  \"id\": \"e4bee088334cb5d38cff1616e964369c37b6081be997962ab289d6c671975d71\",\n  \"pubkey\": \"781208004e09102d7da3b7345e64fd193cd1bc3fce8fdae6008d77f9cabcd036\",\n  \"content\": \"\",\n  \"kind\": 10063,\n  \"created_at\": 1708774162,\n  \"tags\": [\n    [\"server\", \"https://blossom.self.hosted\"],\n    [\"server\", \"https://cdn.blossom.cloud\"]\n  ],\n  \"sig\": \"cc5efa74f59e80622c77cacf4dd62076bcb7581b45e9acff471e7963a1f4d8b3406adab5ee1ac9673487480e57d20e523428e60ffcc7e7a904ac882cfccfc653\"\n}\n```\n\nWhenever a Nostr client finds a URL in an event published by a given user and that URL ends a 64-character hex string (with or without an ending file extension) and that URL is not available anymore, that means that string is likely a representation of a sha256 and that the user may have a `kind:10063` list of Blossom servers published.\n\nGiven that, the client SHOULD look into the `kind:10063` list for other Blossom servers and lookup for the same 64-character hex string in them, by just using the hex string as a path (optionally with the file extension at the end), producing a URL like `https://blossom.self.hosted/<hex-string>.png`.\n\nWhen downloading such files Nostr clients SHOULD verify that the sha256-hash of its contents matches the 64-character hex string.\n\nMore information can be found at [BUD-03][].\n\n### More complex interactions\n\nClients may use other facilities exposed by Blossom servers (for example, for checking if a file exists in a Blossom server, instead of actually downloading it) which are better documented in the [BUDs][Blossom].\n\n[Blossom]: https://github.com/hzrd149/blossom\n[BUD-03]: nostr:naddr1qvzqqqrcvypzqyek59lpv8gw3tetdrhfttf2g70u8zl0j6sh6cf8agp2grfgmkt7qqrxyaty95crx4nlkq6\n","sig":"bffcfaebaf34bf9052910a8cbfd56b3f77fe775c9b4482a88c47d281be6c28db50e564e146136012c2b2cdfefac6db1cece41e38b376dc132c4152e286d28ed3"}