-
Notifications
You must be signed in to change notification settings - Fork 69
Extract standalone arkd-signer + shared txsigner lib (BREAKING: ARKD_SIGNER_ADDR required) #1118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Kukks
wants to merge
26
commits into
master
Choose a base branch
from
arkd-signer
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 24 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
88dadb3
ark-lib: add txsigner shared tapscript-signing primitive
Kukks 723cdfe
arkd-signer: add module, config, and key-injected signer app
Kukks 53c1193
arkd-signer: add gRPC SignerService handler, server, and health/telem…
Kukks 3c83f02
arkd-signer: add cmd entrypoint; drop otel telemetry and pin deps to …
Kukks 6eb62e8
arkd-signer: add deprecated signer keys (config, per-leaf selection, …
Kukks 757b5d6
arkd-wallet: remove embedded SignerService and operator key (moved to…
Kukks 56d51c4
arkd: drop in-wallet signer key injection; require ARKD_SIGNER_ADDR
Kukks 42361b2
build: add arkd-signer image, build script, Makefile target, compose …
Kukks c0b8c08
arkd: signer load is url-only (drop --signer-prvkey); document arkd-s…
Kukks 91f0c7b
arkd: sign forfeit connector input via wallet in fraud reaction
Kukks a91b876
deps: bump x/crypto v0.52.0 + x/net v0.55.0 (security); exclude h2c S…
Kukks c75709c
arkd-signer: redact config secrets; tidy signer-split docs, dev scrip…
bitcoin-coder-bob e3bcbb3
arkd-signer: address review (secret-key length, input-index bounds, C…
bitcoin-coder-bob 1f54bc7
Merge remote-tracking branch 'origin/master' into arkd-signer
bitcoin-coder-bob 53856a2
pkg/arkd-signer: bump go directive to 1.26.5
bitcoin-coder-bob 3b5c908
arkd-signer: bump arkdsigner.Dockerfile builder to go 1.26.5
bitcoin-coder-bob 059f353
txsigner: dedupe finalization on script.FinalizeVtxoScript
bitcoin-coder-bob 14e27c1
Merge remote-tracking branch 'origin/master' into arkd-signer
bitcoin-coder-bob 524e3b6
arkd-signer: bump grpc to v1.82.1 to clear GHSA-hrxh-6v49-42gf
bitcoin-coder-bob d56b8fa
arkd-signer: reject invalid signing scalars, cover every closure type
bitcoin-coder-bob 644e309
arkd-signer: report real readiness, bind before Start returns, unpubl…
bitcoin-coder-bob c572c47
arkd-signer: gate arkd on signer health, make Watch stream status
bitcoin-coder-bob 7e1d60f
Merge remote-tracking branch 'origin/master' into arkd-signer
bitcoin-coder-bob 0513a9a
deps: align pkg/arkd-signer golang.org/x deps with the root module
bitcoin-coder-bob 2d3754d
arkd-signer: drop CORS wildcard, cover the signing handler and forfei…
bitcoin-coder-bob 691cb5c
test: read forfeit partial sigs before finalizing
bitcoin-coder-bob File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| # First stage: build the arkd-signer binary | ||
| FROM golang:1.26.5 AS builder | ||
|
|
||
| ARG VERSION | ||
| ARG TARGETOS | ||
| ARG TARGETARCH | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| COPY . . | ||
|
|
||
| RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -ldflags="-X 'main.Version=${VERSION}'" -o /app/bin/arkd-signer ./cmd/arkd-signer/main.go | ||
|
|
||
| # Second stage: minimal runtime image | ||
| FROM alpine:3.20 | ||
|
|
||
| RUN apk update && apk upgrade | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| COPY --from=builder /app/bin/arkd-signer /app/ | ||
|
|
||
| ENV PATH="/app:${PATH}" | ||
|
|
||
| # /healthz maps a NOT_SERVING health response to 503, and the signer reports | ||
| # NOT_SERVING until its key is usable, so this gates on readiness rather than on | ||
| # the process having started. | ||
| HEALTHCHECK --interval=5s --timeout=3s --start-period=5s --retries=5 \ | ||
| CMD wget -q --spider "http://127.0.0.1:${ARKD_SIGNER_PORT:-6061}/healthz" || exit 1 | ||
|
|
||
| ENTRYPOINT [ "arkd-signer" ] | ||
|
Comment on lines
+15
to
+31
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win Run the runtime container as a non-root user. The signer holds sensitive key material; running as root increases blast radius if compromised. Suggested hardening FROM alpine:3.20
RUN apk update && apk upgrade
WORKDIR /app
-COPY --from=builder /app/bin/arkd-signer /app/
+RUN addgroup -S signer && adduser -S -G signer signer
+COPY --from=builder --chown=signer:signer /app/bin/arkd-signer /app/
ENV PATH="/app:${PATH}"
+USER signer
ENTRYPOINT [ "arkd-signer" ]🤖 Prompt for AI Agents |
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| package main | ||
|
|
||
| import ( | ||
| "os" | ||
| "os/signal" | ||
| "syscall" | ||
|
|
||
| "github.com/arkade-os/arkd/pkg/arkd-signer/config" | ||
| grpcservice "github.com/arkade-os/arkd/pkg/arkd-signer/interface/grpc" | ||
| log "github.com/sirupsen/logrus" | ||
| ) | ||
|
|
||
| func main() { | ||
| cfg, err := config.LoadConfig() | ||
| if err != nil { | ||
| log.Fatalf("invalid arkd-signer config: %s", err) | ||
| } | ||
|
|
||
| log.SetLevel(log.Level(cfg.LogLevel)) | ||
|
|
||
| svc, err := grpcservice.NewService(cfg) | ||
| if err != nil { | ||
| log.Fatalf("failed to create arkd-signer service: %s", err) | ||
| } | ||
|
|
||
| log.Infof("arkd-signer config: %s", cfg) | ||
|
|
||
| log.Info("starting arkd-signer service...") | ||
| if err := svc.Start(); err != nil { | ||
| log.Fatalf("failed to start arkd-signer service: %s", err) | ||
| } | ||
| log.Infof("arkd-signer listens on: %v", cfg.Port) | ||
|
|
||
| log.RegisterExitHandler(svc.Stop) | ||
|
|
||
| sigChan := make(chan os.Signal, 1) | ||
| signal.Notify( | ||
| sigChan, syscall.SIGTERM, syscall.SIGINT, syscall.SIGQUIT, syscall.SIGHUP, os.Interrupt, | ||
| ) | ||
| <-sigChan | ||
|
|
||
| log.Info("shutting down arkd-signer service...") | ||
| log.Exit(0) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win
Avoid documenting a concrete signer private key value.
Publishing a realistic fixed secret encourages unsafe copy-paste and creates recurring secret-scan noise; prefer a placeholder and a generation command.
Suggested doc tweak
🧰 Tools
🪛 Betterleaks (1.5.0)
[high] 169-169: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
🤖 Prompt for AI Agents
Source: Linters/SAST tools