inkless

module
v0.1.0-rc.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2026 License: Apache-2.0

README

Inkless

Go Reference

Inkless is a self-hosted document-signing service and an offline verification library, written in Go.

An application uploads a PDF, names the signers and sends each one into a hosted signing ceremony. In the ceremony the signer reviews the document, consents, confirms an emailed code, and signs or declines. Inkless then seals the final PDF (PAdES, with an RFC 3161 timestamp) and builds an evidence package. Anyone holding the published trust data can verify that package without contacting the service.

Inkless knows nothing about the applications that use it. They pass an opaque external_ref and metadata, and receive signed webhooks.

What it guarantees, and what it does not

If every verification check passes with correctly configured trust anchors:

  • final.pdf and evidence.json are byte-for-byte what Inkless sealed and signed.
  • final.pdf begins with exactly the bytes the signers were shown.
  • The evidence existed no later than the timestamp authority's time, and was signed by a key that was listed and not compromised at that time.
  • For each signer, the evidence records consent, a passed email-code challenge and a sign event bound to the document digest.

It does not show who was at the keyboard: only that someone with the application's session and access to the signer's inbox acted. The assurance level is an email-verified simple electronic signature. Inkless makes no claim about legal effect in any jurisdiction. Details: threat model.

How it works

flowchart LR
  App[Your application] -->|API v1, Idempotency-Key| API
  Webhooks -->|signed events| App
  Signer((Signer's browser)) -->|session link, email code, consent| Ceremony
  subgraph Inkless
    API --> Service
    Ceremony --> Service
    Service --> Store[(Storage: SQLite, PostgreSQL, MySQL)]
    Service --> Webhooks
    Service --> Seal[PAdES seal and evidence JWS]
  end
  Seal -->|crypto.Signer| KMS[AWS KMS]
  Seal -->|RFC 3161| TSA[Timestamp authority]
  Service -->|SMTP| Inbox[Signer's inbox]
  Seal --> Artifacts[final.pdf and evidence.zip]
  Verifier[inkless verify or verify package] -.->|offline| Artifacts
  1. The application uploads a PDF, creates a signing request and issues it. An issued request cannot change.
  2. For each signer, the application creates a single-use session link with an assertion about its logged-in user and redirects the browser there.
  3. Inkless emails a 6-digit code to the signer's address, shows the stored PDF, records consent, and records the signature or the decline. Every step is a hash-chained event.
  4. When everyone has signed, Inkless appends a summary page and seals the PDF as one incremental update. The original bytes are left untouched. It signs the canonical evidence (JWS), timestamps it, and builds evidence.zip.
  5. Events are delivered as signed webhooks, at least once and in order per request.

See integration, evidence format and verification.

Install and quickstart

Requires Go 1.26 or Docker.

docker compose up

or

go install github.com/edgar4/inkless/cmd/inkless@latest
inkless serve

With no settings, serve listens on :8080 and stores everything in ./inkless.db (SQLite). It runs in development mode: synthetic keys, a built-in test TSA, and signing codes written to the log instead of emailed. Do not use development mode for real documents.

Create an application. Its API key and webhook secret are printed once:

inkless apps create -name "My App (dev)" -origin http://localhost:3000 -webhook-url http://localhost:3000/hooks/inkless

With Docker, prefix commands with docker compose exec inkless /inkless.

Verify an evidence package or a sealed PDF offline, here the committed synthetic fixture:

inkless verify \
  -root "$(cat testdata/fixture/root.txt)" \
  -seal-ca testdata/fixture/seal-ca.pem \
  -tsa-ca testdata/fixture/tsa-ca.pem \
  testdata/fixture/evidence.zip

For a running service, inkless keys trust -out trust/ exports the trust data (root.txt, keys.json, seal-ca.pem, tsa-ca.pem).

Configuration

Environment variables only; there is no config file. Limits and timeouts are built in.

Variable Default Production
INKLESS_DATABASE_URL sqlite:inkless.db postgres://... or mysql://... for more than one instance
INKLESS_ADDR :8080
INKLESS_PUBLIC_URL http://localhost:<port> required, https://
INKLESS_KMS_KEY unset: development keys required: AWS KMS key id or ARN (ECC_NIST_P256)
INKLESS_SMTP_URL unset: log mailer required: smtp://user:pass@host:587?from=address or smtps://
INKLESS_TSA_URL built-in test TSA required: RFC 3161 TSA URL
INKLESS_TRUST_PROXY false true behind a reverse proxy that sets X-Forwarded-For

AWS credentials and region come from the standard AWS SDK sources (AWS_REGION, profile, or instance role). Development mode applies only when INKLESS_KMS_KEY is unset and the public URL host is local (localhost, 127.0.0.1, ::1, *.localhost, *.test). Any other public URL requires the production settings, or serve refuses to start.

Applications, API keys, webhook URLs and secrets, and published key material live in the database. Manage them with inkless apps and inkless keys. Run inkless with no arguments for usage. Details: operations and key management.

Storage

SQLite is the default and needs no setup. PostgreSQL and MySQL are selected by URL scheme:

sqlite:/var/lib/inkless/inkless.db
postgres://user:pass@host:5432/inkless?sslmode=verify-full
mysql://user:pass@host:3306/inkless?tls=true

Each driver migrates its own schema on start. SQLite is single-instance: run one inkless serve per database file. The service uses optimistic concurrency, so it needs no row locks, and any driver that passes storage/storagetest works. See operations and ADR 0009.

Integrating an application

Use the Go client or any HTTP client against api/openapi.yaml. docs/integration.md covers the flow, idempotency, webhooks and their verification, reconciliation, and the Go client. examples/e2e runs a complete synthetic flow.

Documentation

Document Contents
integration.md API flow, idempotency, webhooks, reconciliation, Go client, contract changes
evidence-format.md evidence.zip layout, canonical JSON, JWS, key list
verification.md inkless verify, trust inputs, each check and its result
key-management.md Root key, KMS key, seal certificate, rotation, compromise
threat-model.md Assets, actors, threats, guarantees, residual risks
operations.md Configuration, deployment, storage, limits, retention
adr/ Architecture decisions

Project status

v0.1.0-rc.1: feature-complete for the first release; not yet reviewed or run in production.

  • The PAdES seal is built to the baseline B-T profile. It is checked by the tests, qpdf and pdfsig, but not yet by the EU DSS validator (ADR 0007).
  • AWS KMS is the only production key backend.
  • No built-in deletion or retention jobs (operations).

Breaking changes are possible before v1. They are recorded in integration.md.

Development

go test ./...

SQLite tests always run. To run the storage and acceptance tests against PostgreSQL and MySQL too:

docker compose --profile test up -d postgres mysql
INKLESS_TEST_POSTGRES_URL='postgres://postgres@127.0.0.1:15432/postgres?sslmode=disable' \
INKLESS_TEST_MYSQL_URL='mysql://root@127.0.0.1:13306/' go test ./...

See CONTRIBUTING.md. Report vulnerabilities as described in SECURITY.md. The repository holds synthetic data only.

Licence

Apache License 2.0. See LICENSE.

Directories

Path Synopsis
Package client is the Go client for the Inkless API v1 and a helper for receiving its Standard Webhooks events.
Package client is the Go client for the Inkless API v1 and a helper for receiving its Standard Webhooks events.
cmd
inkless command
Command inkless runs the Inkless service and verifies its evidence packages and sealed PDFs.
Command inkless runs the Inkless service and verifies its evidence packages and sealed PDFs.
inkless-fixture command
Command inkless-fixture writes a synthetic evidence package and the public trust data needed to verify it.
Command inkless-fixture writes a synthetic evidence package and the public trust data needed to verify it.
Package evidence defines the Inkless evidence package v1 (evidence.zip): its types, canonicalisation, event hash chain, key list and builder.
Package evidence defines the Inkless evidence package v1 (evidence.zip): its types, canonicalisation, event hash chain, key list and builder.
examples
e2e command
Command e2e runs a complete signing flow against an in-process Inkless: two synthetic signers sign in sequence through the hosted pages, webhooks are received and verified, and the artifacts pass verification.
Command e2e runs a complete signing flow against an in-process Inkless: two synthetic signers sign in sequence through the hosted pages, webhooks are received and verified, and the artifacts pass verification.
internal
ceremony
Package ceremony serves the hosted signing pages: open link, email code, review of the stored PDF, consent, sign or decline, return.
Package ceremony serves the hosted signing pages: open link, email code, review of the stored PDF, consent, sign or decline, return.
devpki
Package devpki generates ephemeral keys, certificates and a local RFC 3161 timestamp authority for tests and synthetic fixtures.
Package devpki generates ephemeral keys, certificates and a local RFC 3161 timestamp authority for tests and synthetic fixtures.
fixture
Package fixture builds synthetic, fully valid evidence packages for tests and demos, optionally with a single injected fault.
Package fixture builds synthetic, fully valid evidence packages for tests and demos, optionally with a single injected fault.
httpapi
Package httpapi serves the Inkless API v1 (api/openapi.yaml).
Package httpapi serves the Inkless API v1 (api/openapi.yaml).
mail
Package mail sends Inkless's own emails (signing codes only).
Package mail sends Inkless's own emails (signing codes only).
pdf
Package pdf inspects uploaded PDFs: limits, encryption, existing signatures, and whether Inkless can seal them.
Package pdf inspects uploaded PDFs: limits, encryption, existing signatures, and whether Inkless can seal them.
seal
Package seal applies the Inkless platform seal to a PDF as one incremental update: an optional signing summary page and a certification signature with an RFC 3161 signature timestamp (PAdES baseline B-T).
Package seal applies the Inkless platform seal to a PDF as one incremental update: an optional signing summary page and a certification signature with an RFC 3161 signature timestamp (PAdES baseline B-T).
server
Package server assembles the HTTP handler: API, ceremony pages, health check and, in development, a local timestamp authority.
Package server assembles the HTTP handler: API, ceremony pages, health check and, in development, a local timestamp authority.
service
Package service implements signing requests, the ceremony state machine, events, webhooks and artifacts on any storage.Store.
Package service implements signing requests, the ceremony state machine, events, webhooks and artifacts on any storage.Store.
signer
Package signer holds the service's signing keys behind crypto.Signer and the public key material it publishes.
Package signer holds the service's signing keys behind crypto.Signer and the public key material it publishes.
signer/awskms
Package awskms provides a crypto.Signer backed by AWS KMS.
Package awskms provides a crypto.Signer backed by AWS KMS.
testenv
Package testenv runs an in-process Inkless with a throwaway database, dev keys, a local TSA and a capturing mailer, plus a scripted browser for the ceremony.
Package testenv runs an in-process Inkless with a throwaway database, dev keys, a local TSA and a capturing mailer, plus a scripted browser for the ceremony.
tsa
Package tsa is an RFC 3161 timestamp client.
Package tsa is an RFC 3161 timestamp client.
Package storage defines the persistence interface the Inkless service uses and a registry of drivers selected by URL scheme.
Package storage defines the persistence interface the Inkless service uses and a registry of drivers selected by URL scheme.
mysql
Package mysql registers the storage driver for mysql://user:password@host:port/database URLs, using go-sql-driver/mysql.
Package mysql registers the storage driver for mysql://user:password@host:port/database URLs, using go-sql-driver/mysql.
postgres
Package postgres registers the storage driver for postgres:// and postgresql:// URLs, using pgx.
Package postgres registers the storage driver for postgres:// and postgresql:// URLs, using pgx.
sqlite
Package sqlite registers the default storage driver for URLs of the form sqlite:PATH (sqlite:inkless.db, sqlite:///var/lib/inkless.db).
Package sqlite registers the default storage driver for URLs of the form sqlite:PATH (sqlite:inkless.db, sqlite:///var/lib/inkless.db).
sqlstore
Package sqlstore implements storage.Store on database/sql.
Package sqlstore implements storage.Store on database/sql.
storagetest
Package storagetest is the conformance suite for storage drivers.
Package storagetest is the conformance suite for storage drivers.
Package verify checks an Inkless evidence package or sealed PDF offline.
Package verify checks an Inkless evidence package or sealed PDF offline.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL