Skip to content

Drop internal/markl in favor of piggy's shared markl Go library #10

@friedenberg

Description

@friedenberg

Context

internal/markl (added for the RFC-0001 §10 Amendment 9 signatures[] verifier, #7) is a temporary, minimal Go port of madder RFC-0002's blech32 codec + markl-id parser. It exists only because madder's reference Go implementation lives in an internal/ package (unimportable) and piggy's is currently a Rust crate. The port is validated byte-for-byte against madder's RFC-0002 conformance vectors (vendored at internal/markl/testdata/0002-markl-id-format-vectors.json).

Plan

Per maintainer direction, papi will eventually drop internal/markl entirely in favor of piggy's shared markl Go library once the piggy#183 ownership inversion (madder→piggy registry source-of-truth + an importable go/markl module, dewey→piggy→madder layering) ships an importable public Go package.

What to do when piggy's lib is importable

  • Replace internal/markl with a dependency on piggy's markl Go module.
  • Keep the call sites stable: the consuming code (internal/inspect/signature.go, and later the fmt="signature" proof path) depends only on a small surface — parse a markl-id → {purpose, format, payload}, and (in tests) build one. Mirror that against piggy's API.
  • Keep / re-point the conformance-vector test so cross-impl byte-compatibility stays asserted.

Notes

  • The surface is deliberately minimal (Parse, Build, ID, format/purpose constants) so the swap is mechanical.
  • Until then, internal/markl is the source of truth for papi's markl-id parsing; any RFC-0002 format/size change must be mirrored here.

Tracking the consumer: #7 (Amendment 9).

:clown: filed with Clown 0.3.12+e27f901
amarbel-llc/clown@e27f901

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions