Skip to content

feat: add golang bindings - #7

Merged
mitfik merged 11 commits into
THCLab:masterfrom
VereignAG:feat/go-bindings
Jul 16, 2026
Merged

mitfik merged 11 commits into
THCLab:masterfrom
VereignAG:feat/go-bindings

Conversation

@zdravko61

@zdravko61 zdravko61 commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

Changes

Introduces bindings/go — a CGo-based Go client wrapping the Rust KERI/DKMS library

  • Covers the full KERI identifier lifecycle: inception, key rotation, signing/verification, multisig, and verifiable credentials (issuance, revocation, TEL queries)
  • The Rust library is built in CI for Linux, macOS, and Windows; artifacts are committed back to master after tests pass so go get users don't need a Rust toolchain
  • Adds a docker-compose.yml for local dev with Postgres, Vault, witness, and watcher using versioned images (ghcr.io/thclab/keriox-witness:0.17.13, ghcr.io/thclab/keriox-watcher:0.17.13) on a shared bridge network
  • Adds a VaultSigner for the credentials example that delegates signing to HashiCorp Vault transit (ed25519)
  • Witness/watcher OOBIs and public URLs are configurable via env vars (WITNESS_OOBI, WATCHER_OOBI, WITNESS_PUBLIC_URL, WATCHER_PUBLIC_URL) to support hybrid local/Docker setups

Add host.docker.internal to /etc/hosts

echo "127.0.0.1 host.docker.internal" | sudo tee -a /etc/hosts

Start services:

WITNESS_PUBLIC_URL=http://host.docker.internal:3232/ \
WATCHER_PUBLIC_URL=http://host.docker.internal:3236/ \
docker compose up -d 

Run:

DATABASE_URL=postgres://postgres:postgres@localhost:5432/keri_go \
VAULT_ADDR=http://localhost:8200 \
VAULT_TOKEN=root \
CGO_ENABLED=1 go run .

verifiable credentials

- Rust FFI layer (lib.rs) exposing controller, identifier, TEL, and OOBI
  operations
- Go package (dkms.go) with full type-safe API over the C FFI
- High-level helpers (helpers.go): Signer interface, Ed25519Signer,
  Publish,
  InceptAndFinalize, IssueAndPublish, RevokeAndPublish,
  QueryKELAndFinalize,
  QueryTELAndFinalize, AddWatcherAndFinalize
- GC finalizers on all CGo types — no manual Free() calls required
- Platform-specific CGo LDFLAGS (cgo_linux/darwin/windows.go) with
  ${SRCDIR}
  so go get works without manual library installation
- CI workflow: matrix build on ubuntu/macos/windows, force-commits
  pre-built
  native libs back to repo on master push so go get users get binaries
- Five complete examples: simple, signing, rotation, multisig,
  credentials
- Credentials example verified end-to-end: issue → ISSUED → revoke →
  REVOKED
- Dependencies point to THCLab/keriox@feat_db_abstraction

Signed-off-by: Zdravko Iliev <zdravko.iliev@vereign.com>
example

- Add docker-compose.yml with postgres, witness, watcher, vault, and
  vault-init services on a shared bridge network
- Use WITNESS_PUBLIC_URL/WATCHER_PUBLIC_URL env vars (defaulting to
  service names) so the same compose file works for both
  fully-dockerized and hybrid (app on host) setups
- Add extra_hosts host-gateway entries so containers can reach
  host-mapped ports via host.docker.internal
- Add VaultSigner backed by Vault transit (ed25519) with ephemeral
  in-memory key fallback
- Make witness/watcher OOBIs configurable via WITNESS_OOBI/WATCHER_OOBI
  env vars
- Document host.docker.internal /etc/hosts requirement for
  macOS/Windows/Linux in README

Signed-off-by: Zdravko Iliev <zdravko.iliev@vereign.com>
@zdravko61 zdravko61 changed the title add golang bindings feat: add golang bindings Apr 7, 2026
@mitfik

mitfik commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

thanks @zdravko61 and @ykinkov can you take a look on the CI and address the problems?

It would be good to get common test vectors so we can test against each implementation, and do cross tests e.g. sign with rust, verify with go, issue with kotlin etc. Will try to prepare something for that in following days.

@ykinkov

ykinkov commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

@mitfik , can we try the CI pipeline again?

@mitfik

mitfik commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

@ykinkov you can ignore the node.js but please take a look on the go CI which still fails

@ykinkov

ykinkov commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

@ykinkov you can ignore the node.js but please take a look on the go CI which still fails

Cool, if you don't mind, I will address the Node.js CI as well.

@ykinkov

ykinkov commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

@mitfik, I think we are ready for another try. I still think the Node.js CI will fail since it uses public infrastructure for witness/watcher which is not working IMO.

@mitfik

mitfik commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

@ykinkov it is not good practice to mix concerns let's focus here on go binding, node we would tackle separately anyway, if you don't mind after next build if it succeed exclude node changes so we can have clean go binding commit and can merge

@ykinkov
ykinkov force-pushed the feat/go-bindings branch from 8864a98 to cbd5715 Compare July 16, 2026 09:57
@ykinkov

ykinkov commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

@mitfik done!

@mitfik
mitfik merged commit b591362 into THCLab:master Jul 16, 2026
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants