Commit f42fa88
committed
feat(coord-fed): Phase 1.3 — coord-tui --print-pubkey + ed25519 derivation
ADR-0016 Phase 1.3. Lets a user export their peer's ed25519 public key
as 64 hex chars for manual entry into another peer's known_peers.toml
(SSH known_hosts model — no discovery, no PKI).
* Cargo.toml — ed25519-dalek = "2.2.0". No `rand` dep: seed generation
reads /dev/urandom directly (32 bytes), matching what the Zig adapter
does via std.crypto.random.bytes on Linux.
* Cli — `--print-pubkey` flag + `--key-path` / BOJ_COORD_KEY_PATH env.
Default path: $XDG_CACHE_HOME/coord-tui/peer.key, falling back to
~/.cache/coord-tui/peer.key.
* print_pubkey() reads-or-creates the seed file (mode 0600 enforced on
create), derives the public key via ed25519_dalek::SigningKey::
from_bytes(&seed).verifying_key(), prints the 64-char lowercase hex
on stdout, exits 0. Non-Unix platforms refuse cleanly rather than
writing a world-readable seed.
* The seed file format (32 raw bytes) IS the shared identity contract
between coord-tui and the Zig adapter — either may create it first,
the other will load the existing seed unchanged. This is the v1
bootstrap path: no IPC needed for the human-export use case, and
the adapter doesn't have to be running.
Verified locally:
cargo build → clean (only pre-existing dead-code warning, unrelated)
/tmp round-trip → first run generates+prints; second run reads same
seed and prints identical hex; file ends 32 bytes,
mode 0600.
bad-seed-length → error 'seed file is N bytes, expected 32', exit 1.1 parent 4b0b154 commit f42fa88
3 files changed
Lines changed: 235 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
57 | 70 | | |
58 | 71 | | |
59 | 72 | | |
| |||
595 | 608 | | |
596 | 609 | | |
597 | 610 | | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
598 | 707 | | |
599 | 708 | | |
600 | 709 | | |
| |||
642 | 751 | | |
643 | 752 | | |
644 | 753 | | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
645 | 767 | | |
646 | 768 | | |
647 | 769 | | |
| |||
0 commit comments