Docs
JA
Download

Chapter 20

Experimental features

These features are not finalized yet. They are available only when you turn them on under Experimental features in Developer in Settings. Their names and behavior may change, or they may be removed. In this manual, links to experimental features are marked with Experimental.

Clause library

Keep frequently used clauses (confidentiality, exclusion of organized crime groups and so on) in a library repository, and insert them into documents with Insert → From clause library… in the editor. After turning it on, choose the repository that holds the clauses under Library repository. Library documents are written, saved as versions and synced like any other document. When you choose a clause, it is inserted after the article with the cursor. If the clause contains references to other articles (such as [[purpose]]), a screen asks which article in the target document each one should point to. Articles with the same heading are preselected. If there is no matching article, you can either remove the reference and keep the heading text, or leave it as is.

Connecting to Ollama on the LAN

Allows LAN http addresses (such as http://192.168.x.x:11434) for Ollama and OpenAI-compatible endpoints. See chapter 16 for how to set it up. Documents travel over the LAN unencrypted.

Exporting to Markdown (houritsu)

Adds Export as Markdown (houritsu) to the editor's Export menu. It creates Markdown with article, paragraph and item numbers written into the text (chapter 15). Because houritsu is a format meant to be used together with a Git version history, exporting a single document has limited use.

Getting signatures on Markdown (.cdsign)

Turn on Get signatures on Markdown (.cdsign) under Experimental features in Developer in Settings to use it.

When you need a signature from another party, you can collect signatures on the Markdown itself instead of exporting a PDF. The signatures use format 0.1 of md-signature, an open format, and the terms shown follow the md-signature specification (SPEC).

How it works

  1. You sign the version of the document in ClauseDown and export a ClauseDown signature request (.cdsign).
  2. The other party opens the .cdsign file in ClauseDown Sign (https://sign.clausedown.app/, coming soon), reads it with article numbers, and co-signs it. Other tools that support md-signature (such as the mdsig command) can also co-sign.
  3. You import the returned file into the delivery record. ClauseDown checks that the body is the version you exported, and verifies each signature.

A .cdsign file is the document of the version as it is, with signature blocks added at the end. Signature blocks are HTML comments, so they do not show on GitHub or similar sites. Each signature adds one more block at the end.

# Services Agreement
… (body) …

<!-- md-signature
v: 0.1
method: dns
signer: acme.example
display_name: Acme Corp.
role: author
require: |
  directory:legal@northwind.example role=approver
…
-->

How it differs from PDF digital signatures:

PDF digital signatures (chapter 19) Markdown (.cdsign)
What is signed The exported PDF The version of the document (the Markdown source)
What the other party needs Software that can sign PDFs ClauseDown Sign (a browser) or a tool that supports md-signature
Identity Certificates (certificate authorities) Your domain's DNS, a key directory that confirmed your email address, and so on (by method)
Co-signing conditions None The signature can state who must sign, in what order and how many (require)
Comparing changes Compare PDFs After signing, it is still the same document in the history and the comparison table

Signature blocks in format 0.0.x (.cdsign files made with ClauseDown 0.11 or earlier) can be neither verified nor co-signed. They are shown as an unsupported version, with a hint on how to write them in 0.1. To continue, export the signature request again from the version of the document.

Setting up keys

Register the keys to sign with on the Markdown (experimental) tab of Digital signatures in Settings.

Markdown signature settings

Item Description
Key App key (Ed25519) or Passkey (webauthn-es256). The app key is the key created with safeStorage as the storage on the Versions and approvals tab. Security chip keys cannot be used for md-signature. For a passkey, the signing page opens in your browser, where you pick or create one
method Where the public key is published: dns, directory or tofu (see the table below)
signer A domain name, email address or name, depending on the method. Letters are made lowercase (except for tofu). A tofu name cannot contain spaces
Display name (display_name) Optional. A name shown next to the signer, for example in signature tables, as declared by the signer. Up to 64 characters. You can change it later in the key list
selector dns only. Optional. With a selector, the TXT record at <selector>._mdsig.<domain> is used, so a new key can be published next to the old one
role, reason Defaults for role (such as author; one word of lowercase letters, digits, ., _ and -) and reason in the signature block
Add a timestamp Gets a timestamp from the time-stamping authority chosen on the PDF tab and appends a tsa block after the signature block. Authorities that need an ID and password are not supported
Fetch revocation lists and rosters Fetches the revocation lists (revocation_url) and rosters (member_of) named in signature blocks to check them. On by default. The server at that URL learns when you verified and your IP address. When off, revocation is shown as not checked and roster requirements become undetermined
Signing pages Pages opened to sign with a passkey. You can add and remove https:// URLs

Choose the method by how you want to show who you are.

method How identity is shown Good for Setup
dns The public key is published in your company domain's DNS Signing on behalf of a company Add the TXT record shown on screen to your domain's DNS
directory The public key is published in a key directory (keys.mdsig.dev) that confirmed your email address Signing as a person, without access to DNS Click Register with key directory and open the link in the confirmation email
tofu The public key is only embedded in the signature block. It does not prove who you are Trying it out, or when the key can be compared by other means None
  • dns: The key shows the TXT record to publish (for example, 2026._mdsig.acme.example. IN TXT "v=mdsig1; k=ed25519; p=…"). Click Copy and add it to your domain's DNS. Until the record is live, the other party's verification reports key-not-published.
  • directory: For an app key, Register with key directory asks keys.mdsig.dev to register it, with a signature by the key itself. The key is published once you open the link in the confirmation email sent to the signer address. When you no longer need it, Remove from key directory removes it right away, without a confirmation email. ClauseDown cannot register or remove passkeys in a key directory.
  • tofu: Since it does not prove identity, the other party has to compare the fingerprint of a key they see for the first time by other means, such as a phone call. When a party co-signs with tofu, it is recommended to set their public key (pubkey=).
  • git-hosting cannot be chosen. ClauseDown registers the app key on GitHub as a signing key, but https://github.com/<user>.keys, which md-signature reads, lists only authentication keys.

Exporting a signature request

Export with Export → ClauseDown signature request (.cdsign) in the editor, or with Export signature request (.cdsign) in a delivery record.

Exporting a signature request

  1. Choose the Signing key. The default is the key for this repository, or the app-wide default key.
  2. Under Other party (require), enter who must co-sign.
  3. Check under What the requirement means that it says what you intend. Problems are listed under Problems in the requirement, and the request cannot be exported until they are fixed.
  4. Click Sign and export and choose where to save. With a passkey, the signing page opens in your browser.
  5. Copy a message for the other party copies a request message with the ClauseDown Sign URL. Send it with the .cdsign file.
  • What gets signed is the saved version of the document. If there are unsaved changes, save a version first.
  • The signature request contains the source of the version as it is. When it has content that is not displayed but still reaches the other party, such as HTML comments, invisible characters or formatting settings, it is listed with line numbers under Content not displayed that the other party receives. Check that no internal notes are left in it. They cannot be removed after signing.
  • Images in the document are not covered by the signature and are not shown to the other party.
  • A document whose body ends inside a code fence (```) cannot be signed.

Specifying the other party (require): Parties are grouped into steps. Co-signatures for a step are counted only after the previous steps are complete.

Item Meaning
step A stage. Add one with Add step. With a single step, there is no order
Set a number (any) Off: everyone in the step is needed. On: any m different parties among the lines are enough
method, signer The party. Besides dns, directory and tofu, you can use pgp and git-hosting. The signer can also be a pattern such as *@example.com (any email address at that domain) or *.example.com (any subdomain). Pattern lines do not count the requester
role The party's role (such as approver)
Attributes (button at the right of a line) user_verified (requires passkey user verification), member_of= (a roster: an https:// URL or dns:<domain>), pubkey= (the public key of a tofu party)
Order (order mode) Available with two or more steps or with any. See the table below
order mode When someone signs before their turn
pending (default) The signature does not count. They sign again when their turn comes
guide It counts, with a warning about the order
strict The agreement becomes violated (failed). This cannot be undone, so use it only when the order itself matters. Cannot be used with pattern lines

Common setups, and the require value written to the signature block:

  • One approver at the other party: In step 1, directory, legal@northwind.example, role approver.
    directory:legal@northwind.example role=approver
    
  • Legal review, then executive approval: Legal in step 1, then Add step and the executive in step 2.
    step
      directory:legal@northwind.example
    step
      directory:ceo@northwind.example role=approver
    
  • Two of three executives: Put three people in a step and set Set a number (any) to 2.
    step any=2
      directory:ceo@northwind.example
      directory:cfo@northwind.example
      directory:coo@northwind.example
    
  • Anyone with an email address at the other company: Use *@northwind.example as the signer. Anyone with an address at that domain can satisfy it, so for important decisions use named lines or a roster (member_of=).
    directory:*@northwind.example
    
  • Pin a tofu party to a key: Enter their public key in pubkey= in the line's attributes.
    tofu:alice pubkey=ed25519:…
    

The agreement status stays pending until they co-sign.

Co-signing by the other party

The other party opens the .cdsign file in ClauseDown Sign, checks the content and co-signs it, then sends back the signed file (_signed.cdsign).

They can also co-sign with the mdsig command of md-signature. For example, a party whose key is registered with a key directory signs like this:

mdsig sign Services-Agreement_signature-request.cdsign -m directory -s legal@northwind.example -r approver
mdsig verify Services-Agreement_signature-request.cdsign

A co-signature covers everything up to the last signature block. If the other party changes the body, your signature becomes invalid.

Importing a signed file

Choose the returned .cdsign file with Import signed file in the delivery record.

  • ClauseDown checks that the body matches the version the request was exported from. A file that does not match cannot be imported.
  • It also shows whether the first signature block is a valid signature by a key registered in this app.
  • The file is saved in the delivery folder as <original name>_received.cdsign, and the signers and agreement status are recorded in the delivery record. A pending or undetermined file can be imported, but it is not treated as complete.

Verifying signatures

When you open a document with signature blocks, a Signatures button appears in the status bar to the right of the proofreading buttons. Click it to open the signature verification pane in the same place as the proofreading list.

Signature verification

The color and icon of the button show the verdict on the whole document. Having signature blocks alone never makes it "Verified". Fetched public keys, DNS records, revocation lists and so on are kept for 5 minutes and are not fetched again on every edit. Verify again in the pane fetches them again.

Verdict Meaning What to do
Verified All signatures are valid and the require is met Nothing
Verified, awaiting co-signatures (pending) The signatures are valid, but required co-signatures are missing Ask the parties under Next co-signatures to co-sign
Verified, agreement cannot be determined (undetermined) A network failure, an unavailable roster or a limit prevents a decision Click Verify again when online
Some signature blocks are unresolved Some public keys cannot be checked Check the DNS or key directory registration, and the network
Some signature blocks cannot be checked while offline Some signatures cannot be checked without a network Click Verify again when online
The signing order was violated (violated) Someone signed out of turn under order mode=strict Export again and have them sign in order
Some requirements are not understood (unsupported) The require uses a method or attribute this app does not understand Check what the other party's tool supports
Verification failed Some signatures are invalid, malformed or unsupported See the reason on each signature block
The signature blocks cannot be read The chain of signature blocks is broken (for example, text after the last block) See "Troubleshooting"

For each signature block, it shows the signer, method, role, ts (the time the signer declared) and the status.

  • The status is valid, invalid, malformed, unresolved or unsupported. When it is not valid, the reason (such as hash-mismatch) is added.
  • display_name is shown only for valid signatures, marked as declared by the signer.
  • Passkey signatures show rp_id.
  • Signatures followed by a tsa block show the time by which the time-stamping authority certifies the signature existed. ts is only what the signer declared.
  • The first time a tofu key is seen, its fingerprint is shown. Compare it with the signer before clicking Trust. After that, a different key for the same signer is invalid with key-changed.

The main reasons:

Reason Meaning
hash-mismatch The body changed after signing
bad-signature The signature block was altered, or the key does not match
key-not-published The public key is not found in DNS or the key directory (not registered yet, or removed)
key-changed A tofu key differs from the recorded key
unsupported-version A signature block in a format other than 0.1
expired, revoked Expired, revoked
network, offline Cannot be checked without a network

Under the agreement status (none, complete, pending, undetermined, violated or unsupported), the pane shows the count for each step (such as step 1: 1 / 1), the co-signatures still missing and who can co-sign next. Signatures that were not counted show the reason.

Reason not counted Meaning
before the step started Signed before the pending step began
used by an earlier step The same signature was counted in an earlier step
no user verification (user_verified) Signed with a passkey without user verification
key differs from pubkey= Signed with a key other than the one specified
the declarer The requester signed a pattern line
not on the roster, roster cannot be checked The member_of= roster does not confirm it
signature with scope A signature on some sections only does not meet a require
unresolved, not valid The signature itself cannot be confirmed

At the bottom, the pane lists content that is not displayed, such as HTML comments and invisible characters in the body. Signatures cover the source, not what is displayed, so they also cover content that is not displayed. Formatting settings (<!-- clausedown -->) appear here too. Characters used legitimately, such as joined emoji, are not listed.

Adding a signature table

Put a <!-- mdsig:signatures --> line in the body, and the preview, PDF, HTML and Word output show a signature table built from the verification result at that position. You can also add it with Insert → Signature table (mdsig:signatures) in the editor.

Signature table

  • The columns are number, display name (declared), signer, identity check, role, declared time, timestamp, user verified and status. Parties who have not co-signed yet are shown as blank rows such as "step 1, 1 more".
  • It can be placed in the preamble or in a closing ({.closing}) or appendix chapter. Only the first one is used, and lines inside code fences are ignored.
  • The table is built separately from the body, so a table written in the body never becomes a signature table. The same result is also shown in the signature verification pane outside the body.
  • Without signature blocks, or when they cannot be verified, it shows "No signature blocks".
  • The marker is part of the body and is covered by the first signature, so its position cannot change after signing. Add it before exporting the signature request.

Editing signed documents

To avoid breaking signatures, what you can edit is limited.

Document What you can edit
No signatures Everything
Only section signatures (scope) Everything except the signed sections and the signature blocks
A signature over the whole document Nothing (Insert and Formatting are unavailable too)

Lines you cannot edit show a lock. Signature blocks are folded into "N signature blocks"; click it to show them. To change the content, save a new version and export the signature request again.

Troubleshooting

  • "Unsupported version" is shown: The signature is in format 0.0.x, made with ClauseDown 0.11 or earlier. Export the signature request again from the version of the document.
  • key-not-published: For dns, check that the TXT record is added and live. For directory, check that you opened the link in the confirmation email.
  • The other party's co-signature is not counted: See the reason next to their line in the signature verification pane. If they signed out of turn, ask them to sign again when their turn comes.
  • Cannot sign (content after the last signature block): Text was added after the signature blocks. Remove it, or export again from the version of the document.
  • Cannot sign (the body ends inside a code fence): Close the last ``` in the body.
  • Cannot import (the body does not match): The other party changed the body, or the request was for another version. Check the delivery record and the version of the signature request.

Edit this page on GitHub