Extends · open
| id The block's permanent identity inside its document; clients generate an 8-character random id. | ||
| revision Output only: CID of the last Change that replaced this block, filled in by the daemon when serving. | optional | |
| type The block type, such as `Paragraph` or `Image`; any string is accepted. | ||
| text The block's plain text, for types that have text; formatting lives in `annotations`. | optional | |
| link The block's one link: an `hm://`, `ipfs://`, `https://` or `nostr:` URL depending on the type. | optional | |
| annotations Inline formatting, links and mentions over code-point ranges of `text`. | of | optional |
| attributes Type-specific attributes, nested here by the Seed API and SDK; on the wire they sit at the block's top level. | optional | |
other fields: | ||
A block is one unit of document content, such as a paragraph, a heading or an image; see Blocks. This page defines the open block: the common fields (id, type, text, link, annotations, attributes) plus any extra fields of any type, with only id and type required. It is the forward-compatible wire type that Change ops and comment bodies reference. A block type this client has no schema for, such as a future or third-party type, is still a valid Block, so a document is never rejected over an unrecognized block. Every concrete block is a subtype. The strict set of recognized types is block/core. To add a block type, extend block/base and union it with the core, as example/poll-block and example/app-block do.
This is the shape a block has inside a signed Change, in a ReplaceBlock op, and inside a comment body. The five named keys are reserved. On the wire every attribute sits beside them at the top level of the map, while the Seed API and the SDK nest attributes under attributes. The daemon fills in revision when it serves a document: the CID of the last Change that replaced the block. Blocks has the full model, including annotations, layouts and every built-in type.
See also
Blocks: the block model and every built-in type.
block/core: the built-in block types.
block/base: the base to extend for a new type.
block/node: a block with its children.
block/annotation: inline formatting.
ReplaceBlock: the op that writes a block.
Do you like what you are reading? Subscribe to receive updates.
Unsubscribe anytime