Selaa lähdekoodia

organized: crown is now nockapp, sword is now nockvm, choo is now hoonc

GitHub Actions Bot 8 kuukautta sitten
vanhempi
commit
5228bfb83b
100 muutettua tiedostoa jossa 571 lisäystä ja 807 poistoa
  1. 4 1
      .gitignore
  2. 21 21
      Cargo.toml
  3. 47 25
      Makefile
  4. 30 10
      README.md
  5. 5 5
      crates/hoonc/Cargo.toml
  6. 12 12
      crates/hoonc/README.md
  7. 2 2
      crates/hoonc/bootstrap.rs
  8. 0 0
      crates/hoonc/bootstrap/hoonc.jam
  9. 0 0
      crates/hoonc/hoon/hoon-138.hoon
  10. 0 0
      crates/hoonc/hoon/hoon-deps/lib/builder.hoon
  11. 6 1
      crates/hoonc/hoon/hoon-deps/lib/wrapper.hoon
  12. 6 2
      crates/hoonc/hoon/kernel.hoon
  13. 48 32
      crates/hoonc/src/lib.rs
  14. 4 4
      crates/hoonc/src/main.rs
  15. 4 4
      crates/hoonc/tests/build.rs
  16. 4 4
      crates/nockapp/Cargo.toml
  17. 9 9
      crates/nockapp/README.md
  18. 0 16
      crates/nockapp/apps/http-app/Cargo.toml
  19. BIN
      crates/nockapp/apps/http-app/bootstrap/http.jam
  20. 0 98
      crates/nockapp/apps/http-app/bootstrap/kernel.hoon
  21. 0 26
      crates/nockapp/apps/http-app/main.rs
  22. 0 16
      crates/nockapp/apps/test-app/Cargo.toml
  23. 0 71
      crates/nockapp/apps/test-app/bootstrap/kernel.hoon
  24. BIN
      crates/nockapp/apps/test-app/bootstrap/test-ker.jam
  25. 0 47
      crates/nockapp/apps/test-app/main.rs
  26. 0 72
      crates/nockapp/nested-workspace.toml
  27. 0 0
      crates/nockapp/src/drivers/exit.rs
  28. 2 2
      crates/nockapp/src/drivers/file.rs
  29. 4 4
      crates/nockapp/src/drivers/http.rs
  30. 2 2
      crates/nockapp/src/drivers/markdown.rs
  31. 0 0
      crates/nockapp/src/drivers/mod.rs
  32. 2 2
      crates/nockapp/src/drivers/npc.rs
  33. 2 2
      crates/nockapp/src/drivers/one_punch.rs
  34. 0 0
      crates/nockapp/src/drivers/timer.rs
  35. 2 2
      crates/nockapp/src/kernel/boot.rs
  36. 6 6
      crates/nockapp/src/kernel/checkpoint.rs
  37. 25 27
      crates/nockapp/src/kernel/form.rs
  38. 0 0
      crates/nockapp/src/kernel/mod.rs
  39. 6 6
      crates/nockapp/src/lib.rs
  40. 0 0
      crates/nockapp/src/nockapp/actors/kernel.rs
  41. 0 0
      crates/nockapp/src/nockapp/actors/mod.rs
  42. 0 0
      crates/nockapp/src/nockapp/actors/save.rs
  43. 8 8
      crates/nockapp/src/nockapp/driver.rs
  44. 2 2
      crates/nockapp/src/nockapp/error.rs
  45. 0 0
      crates/nockapp/src/nockapp/metrics.rs
  46. 17 4
      crates/nockapp/src/nockapp/mod.rs
  47. 8 9
      crates/nockapp/src/nockapp/test.rs
  48. 3 3
      crates/nockapp/src/nockapp/wire.rs
  49. 8 8
      crates/nockapp/src/noun/extensions.rs
  50. 0 0
      crates/nockapp/src/noun/mod.rs
  51. 2 2
      crates/nockapp/src/noun/ops.rs
  52. 15 15
      crates/nockapp/src/noun/slab.rs
  53. 4 4
      crates/nockapp/src/observability.rs
  54. 7 7
      crates/nockapp/src/utils/bytes.rs
  55. 12 12
      crates/nockapp/src/utils/error.rs
  56. 9 9
      crates/nockapp/src/utils/mod.rs
  57. 1 1
      crates/nockapp/src/utils/scry.rs
  58. 5 5
      crates/nockapp/src/utils/slogger.rs
  59. 0 0
      crates/nockapp/test-jams/cue-test.jam
  60. 0 0
      crates/nockapp/test-jams/test-ker.jam
  61. 7 7
      crates/nockapp/tests/integration.rs
  62. 3 3
      crates/nockchain-bitcoin-sync/Cargo.toml
  63. 9 11
      crates/nockchain-bitcoin-sync/src/lib.rs
  64. 3 3
      crates/nockchain-libp2p-io/Cargo.toml
  65. 67 33
      crates/nockchain-libp2p-io/src/nc.rs
  66. 1 1
      crates/nockchain-libp2p-io/src/p2p.rs
  67. 8 8
      crates/nockchain-libp2p-io/src/p2p_util.rs
  68. 5 5
      crates/nockchain-libp2p-io/src/tip5_util.rs
  69. 4 4
      crates/nockchain-wallet/Cargo.toml
  70. 13 16
      crates/nockchain-wallet/README.md
  71. 3 3
      crates/nockchain-wallet/src/error.rs
  72. 68 67
      crates/nockchain-wallet/src/main.rs
  73. 4 4
      crates/nockchain/Cargo.toml
  74. 15 15
      crates/nockchain/src/lib.rs
  75. 3 3
      crates/nockchain/src/main.rs
  76. 4 4
      crates/nockvm/DEVELOPERS.md
  77. 0 0
      crates/nockvm/LICENSE
  78. 0 0
      crates/nockvm/README.md
  79. 0 0
      crates/nockvm/docs/b-trees.md
  80. 0 0
      crates/nockvm/docs/codegen-bootstrap.md
  81. 0 0
      crates/nockvm/docs/heap.md
  82. 0 0
      crates/nockvm/docs/llvm.md
  83. 0 0
      crates/nockvm/docs/moving-memory.md
  84. 0 0
      crates/nockvm/docs/noun-rep.svg
  85. 0 0
      crates/nockvm/docs/persistence.md
  86. 0 0
      crates/nockvm/docs/pills.md
  87. 0 0
      crates/nockvm/docs/priors.bib
  88. 0 0
      crates/nockvm/docs/proposal/hypotheses.md
  89. 0 0
      crates/nockvm/docs/proposal/milestones.md
  90. 0 0
      crates/nockvm/docs/proposal/nock.txt
  91. 0 0
      crates/nockvm/docs/proposal/notes-~2021.9.23.md
  92. 0 0
      crates/nockvm/docs/proposal/notes-~2021.9.24.md
  93. 0 0
      crates/nockvm/docs/proposal/noun-representation.md
  94. 0 0
      crates/nockvm/docs/proposal/proposal-nock-performance.md
  95. 0 0
      crates/nockvm/docs/stack.md
  96. 0 0
      crates/nockvm/docs/status/20230419.md
  97. 0 0
      crates/nockvm/docs/storyboard.md
  98. 0 0
      crates/nockvm/docs/subject-knowledge.md
  99. 0 0
      crates/nockvm/hoon/codegen/lib/degen.hoon
  100. 0 0
      crates/nockvm/hoon/codegen/lib/line.hoon

+ 4 - 1
.gitignore

@@ -1,6 +1,9 @@
 .data.*
-test-*
+/hoonc
+test-leader
+test-follower
 .nockchain-identity
 .nockchain-identity.peerid
 target
 assets/*.jam
+!crates/nockapp/test-jams

+ 21 - 21
Cargo.toml

@@ -2,17 +2,17 @@
 members = [
     "crates/equix-latency",
     "crates/kernels",
-    "crates/nockapp/apps/choo",
-    "crates/nockapp/crown",
+    "crates/hoonc",
+    "crates/nockapp",
     "crates/nockchain-bitcoin-sync",
     "crates/nockchain-libp2p-io",
     "crates/nockchain",
-    "crates/sword/rust/assert_no_alloc",
-    "crates/sword/rust/ibig",
-    "crates/sword/rust/murmur3",
-    "crates/sword/rust/sword_macros",
-    "crates/sword/rust/sword",
-    "crates/wallet",
+    "crates/nockvm/rust/assert_no_alloc",
+    "crates/nockvm/rust/ibig",
+    "crates/nockvm/rust/murmur3",
+    "crates/nockvm/rust/nockvm_macros",
+    "crates/nockvm/rust/nockvm",
+    "crates/nockchain-wallet",
     "crates/zkvm-jetpack",
 ]
 
@@ -23,22 +23,22 @@ version = "0.1.0"
 edition = "2021"
 
 [workspace.dependencies.assert_no_alloc]
-path = "crates/sword/rust/assert_no_alloc"
+path = "crates/nockvm/rust/assert_no_alloc"
 
-[workspace.dependencies.choo]
-path = "crates/nockapp/apps/choo"
+[workspace.dependencies.hoonc]
+path = "crates/hoonc"
 
-[workspace.dependencies.crown]
-path = "crates/nockapp/crown"
+[workspace.dependencies.nockapp]
+path = "crates/nockapp"
 
 [workspace.dependencies.ibig]
-path = "crates/sword/rust/ibig"
+path = "crates/nockvm/rust/ibig"
 
 [workspace.dependencies.kernels]
 path = "crates/kernels"
 
 [workspace.dependencies.murmur3]
-path = "crates/sword/rust/murmur3"
+path = "crates/nockvm/rust/murmur3"
 
 [workspace.dependencies.nockchain]
 path = "crates/nockchain"
@@ -49,14 +49,14 @@ path = "crates/nockchain-bitcoin-sync"
 [workspace.dependencies.nockchain-libp2p-io]
 path = "crates/nockchain-libp2p-io"
 
-[workspace.dependencies.sword]
-path = "crates/sword/rust/sword"
+[workspace.dependencies.nockvm]
+path = "crates/nockvm/rust/nockvm"
 
-[workspace.dependencies.sword_crypto]
-path = "crates/sword/rust/sword_crypto"
+[workspace.dependencies.nockvm_crypto]
+path = "crates/nockvm/rust/nockvm_crypto"
 
-[workspace.dependencies.sword_macros]
-path = "crates/sword/rust/sword_macros"
+[workspace.dependencies.nockvm_macros]
+path = "crates/nockvm/rust/nockvm_macros"
 
 [workspace.dependencies.zkvm-jetpack]
 path = "crates/zkvm-jetpack"

+ 47 - 25
Makefile

@@ -5,9 +5,13 @@ export MINIMAL_LOG_FORMAT := true
 export MINING_PUBKEY := EHmKL2U3vXfS5GYAY5aVnGdukfDWwvkQPCZXnjvZVShsSQi3UAuA4tQQpVwGJMzc9FfpTY8pLDkqhBGfWutiF4prrCktUH9oAWJxkXQBzAavKDc95NR3DjmYwnnw8GuugnK
 
 
-## Build everything
 .PHONY: build
-build:
+build: build-hoon-all build-rust
+	$(call show_env_vars)
+
+## Build all rust
+.PHONY: build-rust
+build-rust:
 	cargo build --release
 
 ## Run all tests
@@ -15,14 +19,36 @@ build:
 test:
 	cargo test --release
 
-.PHONY: install-choo
-install-choo: nuke-choo-data ## Install choo from this repo
+.PHONY: install-hoonc
+install-hoonc: nuke-hoonc-data ## Install hoonc from this repo
+	$(call show_env_vars)
+	cargo install --locked --force --path crates/hoonc --bin hoonc
+
+.PHONY: update-hoonc
+update-hoonc:
 	$(call show_env_vars)
-	cargo install --locked --force --path crates/nockapp/apps/choo --bin choo
+	cargo install --locked --path crates/hoonc --bin hoonc
 
-update-choo:
+.PHONY: install-nockchain
+install-nockchain: build-hoon-all
 	$(call show_env_vars)
-	cargo install --locked --path crates/nockapp/apps/choo --bin choo
+	cargo install --locked --force --path crates/nockchain --bin nockchain
+
+.PHONY: update-nockchain
+update-nockchain: build-hoon-all
+	$(call show_env_vars)
+	cargo install --locked --path crates/nockchain --bin nockchain
+
+
+.PHONY: install-nockchain-wallet
+install-nockchain-wallet: build-hoon-all
+	$(call show_env_vars)
+	cargo install --locked --force --path crates/nockchain-wallet --bin nockchain-wallet
+
+.PHONY: update-nockchain-wallet
+update-nockchain-wallet: build-hoon-all
+	$(call show_env_vars)
+	cargo install --locked --path crates/nockchain-wallet --bin nockchain-wallet
 
 .PHONY: ensure-dirs
 ensure-dirs:
@@ -33,29 +59,25 @@ ensure-dirs:
 build-trivial-new: ensure-dirs
 	$(call show_env_vars)
 	echo '%trivial' > hoon/trivial.hoon
-	choo --new --arbitrary hoon/trivial.hoon
+	hoonc --new --arbitrary hoon/trivial.hoon
 
 HOON_TARGETS=assets/dumb.jam assets/wal.jam
 
-.PHONY: nuke-choo-data
-nuke-choo-data:
-	rm -rf .data.choo
-	rm -rf ~/.nockapp/choo
+.PHONY: nuke-hoonc-data
+nuke-hoonc-data:
+	rm -rf .data.hoonc
+	rm -rf ~/.nockapp/hoonc
 
 .PHONY: nuke-assets
 nuke-assets:
 	rm -f assets/*.jam
 
-.PHONY: build-hoon-fresh
-build-hoon-fresh: nuke-assets nuke-choo-data install-choo ensure-dirs build-trivial-new $(HOON_TARGETS)
-	$(call show_env_vars)
-
-.PHONY: build-hoon-new
-build-hoon-all: ensure-dirs update-choo build-trivial-new $(HOON_TARGETS)
+.PHONY: build-hoon-all
+build-hoon-all: nuke-assets update-hoonc ensure-dirs build-trivial-new $(HOON_TARGETS)
 	$(call show_env_vars)
 
 .PHONY: build-hoon
-build-hoon: ensure-dirs update-choo $(HOON_TARGETS)
+build-hoon: ensure-dirs update-hoonc $(HOON_TARGETS)
 	$(call show_env_vars)
 
 .PHONY: run-nockchain-leader
@@ -71,14 +93,14 @@ run-nockchain-follower:  # Run nockchain mode in follower mode
 
 HOON_SRCS := $(find hoon -type file -name '*.hoon')
 
-## Build dumb.jam with choo
-assets/dumb.jam: update-choo hoon/apps/dumbnet/outer.hoon $(HOON_SRCS)
+## Build dumb.jam with hoonc
+assets/dumb.jam: update-hoonc hoon/apps/dumbnet/outer.hoon $(HOON_SRCS)
 	$(call show_env_vars)
-	RUST_LOG=trace choo hoon/apps/dumbnet/outer.hoon hoon
+	RUST_LOG=trace hoonc hoon/apps/dumbnet/outer.hoon hoon
 	mv out.jam assets/dumb.jam
 
-## Build wal.jam with choo
-assets/wal.jam: update-choo hoon/apps/wallet/wallet.hoon $(HOON_SRCS)
+## Build wal.jam with hoonc
+assets/wal.jam: update-hoonc hoon/apps/wallet/wallet.hoon $(HOON_SRCS)
 	$(call show_env_vars)
-	RUST_LOG=trace choo hoon/apps/wallet/wallet.hoon hoon
+	RUST_LOG=trace hoonc hoon/apps/wallet/wallet.hoon hoon
 	mv out.jam assets/wal.jam

+ 30 - 10
README.md

@@ -5,44 +5,64 @@
 
 We believe the future of blockchains is lightweight trustless settlement of heavyweight verifiable computation. The only way to get there is by replacing verifiability-via-public-replication with verifiability-via-private-proving. Proving happens off-chain; verification is on-chain.
 
+*Nockchain is entirely experimental and many parts are unaudited. We make no representations or guarantees as to the behavior of this software.*
+
 
 ## Setup
 
 Install `rustup` by following their instructions at: [https://rustup.rs/](https://rustup.rs/)
 
-Install `choo`, the Hoon compiler:
+Install `hoonc`, the Hoon compiler:
 
 ```
-make install-choo
+make install-hoonc
 ```
 
+To build the Nockchain and the wallet binaries and their required assets:
+
+```
+make build
+```
 
-## Build
+## Install Wallet
 
-To build Nockchain:
+After you've run the setup and build commands, install the wallet:
 
 ```
-make build-hoon-all
-make build
+make install-nockchain-wallet
 ```
 
-To run a Nockchain node that publishes the genesis block:
+To run the wallet, see the nockchain-wallet [README](./crates/nockchain-wallet/README.md).
+
+
+## Install Nockchain
+
+After you've run the setup and build commands, install the wallet:
+
+```
+make install-nockchain
+```
+
+
+## Testing Nodes
+
+To run a test Nockchain node that publishes the genesis block:
 
 ```
 make run-nockchain-leader
 ```
 
 
-To run a Nockchain node that waits for the genesis block:
+To run a test Nockchain node that waits for the genesis block:
 
 ```
 make run-nockchain-follower
 ```
 
-To run the wallet, see the wallet [README](./crates/wallet/README.md).
 
+## Testing utilities
 
-To run the test suite:
+To run the unit test suite:
 
 ```
 make test

+ 5 - 5
crates/nockapp/apps/choo/Cargo.toml → crates/hoonc/Cargo.toml

@@ -1,13 +1,13 @@
 [package]
-name = "choo"
+name = "hoonc"
 version = "0.2.0"
 edition.workspace = true
 
 [dependencies]
-crown = { path = "../../crown" }
+nockapp = { workspace = true }
 dirs = { workspace = true }
-sword = { workspace = true }
-sword_macros = { workspace = true }
+nockvm = { workspace = true }
+nockvm_macros = { workspace = true }
 clap = { workspace = true, features = ["derive", "cargo", "color", "env"] }
 futures = { workspace = true }
 tempfile = { workspace = true }
@@ -17,5 +17,5 @@ bytes = { workspace = true }
 walkdir = "2.5.0"
 
 [[bin]]
-name = "choo"
+name = "hoonc"
 path = "src/main.rs"

+ 12 - 12
crates/nockapp/apps/choo/README.md → crates/hoonc/README.md

@@ -3,13 +3,13 @@
 To self-bootstrap:
 
 ```bash
-cargo run --release bootstrap/kernel.hoon ../hoon-deps
+cargo run --release hoon/kernel.hoon hoon/hoon-deps
 ```
 
-This will save the built kernel as `out.jam` in the current directory. This should be moved to the bootstrap directory so the `choo` binary can pick it up:
+This will save the built kernel as `out.jam` in the current directory. This should be moved to the bootstrap directory so the `hoonc` binary can pick it up:
 
 ```bash
-mv out.jam bootstrap/choo.jam
+mv out.jam bootstrap/hoonc.jam
 ```
 
 Once this is done, you should be able to run
@@ -18,16 +18,16 @@ Once this is done, you should be able to run
 cargo build --release
 ```
 
-and use the resulting binary in `target/release/choo` (in the `nockapp` directory) to build NockApp kernels or arbitrary hoon files as detailed in the following section.
+and use the resulting binary in `target/release/hoonc` (in the `nockapp` directory) to build NockApp kernels or arbitrary hoon files as detailed in the following section.
 
 ## Usage
 
-The following assumes you have the `choo` binary in your path, which can be built with `cargo build --release` and found in `target/release/choo`.
+The following assumes you have the `hoonc` binary in your path, which can be built with `cargo build --release` and found in `target/release/hoonc`.
 
-For `choo`, the first argument is the entrypoint to the program, while the second argument is the root directory for source files.
+For `hoonc`, the first argument is the entrypoint to the program, while the second argument is the root directory for source files.
 
 ```bash
-choo main.hoon hoon/
+hoonc main.hoon hoon/
 ```
 
 ### Building Arbitrary Hoon
@@ -42,13 +42,13 @@ mkdir hoon
 echo '%trivial' > hoon/trivial.hoon
 
 # Build the Hoon file (exclude --new if you want to use the build cache)
-choo --new --arbitrary hoon/trivial.hoon
+hoonc --new --arbitrary hoon/trivial.hoon
 ```
 
 ## Hoon
 
 Choo supports the Hoon language as defined in `/sys/hoon`.  However, the build system does not replicate Urbit's `+ford`
-functionality exactly, as that is closely tied to the Urbit Arvo operating system.  `choo` supports the following build
+functionality exactly, as that is closely tied to the Urbit Arvo operating system.  `hoonc` supports the following build
 runes:
 
 - `/+` load from `/lib`
@@ -60,11 +60,11 @@ runes:
 
 ## Developer Troubleshooting
 
-If you make changes to the `poke` arm in `bootstrap/kernel.hoon` or in `hoon-deps/wrapper.hoon`, you'll need to update the `choo.jam` file by running:
+If you make changes to the `poke` arm in `bootstrap/kernel.hoon` or in `hoon-deps/wrapper.hoon`, you'll need to update the `hoonc.jam` file by running:
 
 ```bash
 cargo run --release bootstrap/kernel.hoon ../hoon-deps
-mv out.jam bootstrap/choo.jam
+mv out.jam bootstrap/hoonc.jam
 ```
 
-and committing the changes to `choo.jam` so that the CI can properly bootstrap the `choo` kernel.
+and committing the changes to `hoonc.jam` so that the CI can properly bootstrap the `hoonc` kernel.

+ 2 - 2
crates/nockapp/apps/choo/bootstrap.rs → crates/hoonc/bootstrap.rs

@@ -1,7 +1,7 @@
-// Bazel-specific bootstrap file for choo
+// Bazel-specific bootstrap file for hoonc
 // This is used to provide the correct paths for include_bytes! in the Bazel build
 
 #[cfg(bazel_build)]
-pub const KERNEL_JAM: &[u8] = include_bytes!("bootstrap/choo.jam");
+pub const KERNEL_JAM: &[u8] = include_bytes!("bootstrap/hoonc.jam");
 #[cfg(bazel_build)]
 pub const HOON_TXT: &[u8] = include_bytes!("../hoon/hoon-138.hoon");

+ 0 - 0
crates/nockapp/apps/choo/bootstrap/choo.jam → crates/hoonc/bootstrap/hoonc.jam


+ 0 - 0
crates/nockapp/apps/hoon/hoon-138.hoon → crates/hoonc/hoon/hoon-138.hoon


+ 0 - 0
crates/nockapp/apps/hoon-deps/lib/builder.hoon → crates/hoonc/hoon/hoon-deps/lib/builder.hoon


+ 6 - 1
crates/nockapp/apps/hoon-deps/lib/wrapper.hoon → crates/hoonc/hoon/hoon-deps/lib/wrapper.hoon

@@ -48,6 +48,7 @@
   |=  crash=?
   |=  inner=fort
   |=  hash=@uvI
+  ~&  build-hash+hash
   =<  .(desk-hash.outer `hash)
   |_  outer=outer-state
   +*  inner-fort  ~(. inner internal.outer)
@@ -62,7 +63,11 @@
   ++  peek
     |=  arg=path
     ^-  (unit (unit *))
-    (peek:inner-fort arg)
+    =/  pax  ((soft path) arg)
+    ?~  pax
+      ~>  %slog.[0 leaf+"wrapper +poke: arg is not a path"]
+      ~
+    (peek:inner-fort u.pax)
   ::
   ++  wish
     |=  txt=@

+ 6 - 2
crates/nockapp/apps/choo/bootstrap/kernel.hoon → crates/hoonc/hoon/kernel.hoon

@@ -114,7 +114,10 @@
 ++  peek
   |=  =path
   ^-  (unit (unit *))
-  ``?=(^ cached-hoon.k)
+  ?+  path  ~
+      [%booted ~]
+    ``?=(^ cached-hoon.k)
+  ==
 ::
 ::  +poke: external apply
 ::
@@ -139,7 +142,8 @@
     ~&  >>  hoon-version+hoon-version
     ?:  ?=(^ cached-hoon.k)
       [~ k]
-   [~ k(cached-hoon `(build-honc hoon-txt.cause))]
+    ~&  "Please be patient. This will take a few minutes."
+    [~ k(cached-hoon `(build-honc hoon-txt.cause))]
   ::
       %build
     ~&  >>  "building path: {<pat.cause>}"

+ 48 - 32
crates/nockapp/apps/choo/src/lib.rs → crates/hoonc/src/lib.rs

@@ -1,26 +1,26 @@
 use clap::{arg, command, ColorChoice, Parser};
+use nockvm::interpreter::{self, Context};
 use std::env::current_dir;
 use std::ffi::OsStr;
 use std::path::{Path, PathBuf};
-use sword::interpreter::{self, Context};
 use tokio::fs::{self, File};
 use tokio::io::AsyncReadExt;
 use tracing::{debug, info, instrument, trace};
 use walkdir::{DirEntry, WalkDir};
 
-use crown::kernel::boot::{self, default_boot_cli, Cli as BootCli};
-use crown::nockapp::driver::Operation;
-use crown::noun::slab::NounSlab;
-use crown::{system_data_dir, AtomExt, Noun, NounExt};
-use sword::noun::{Atom, D, T};
-use sword_macros::tas;
+use nockapp::driver::Operation;
+use nockapp::kernel::boot::{self, default_boot_cli, Cli as BootCli};
+use nockapp::noun::slab::NounSlab;
+use nockapp::{system_data_dir, AtomExt, Noun, NounExt};
+use nockvm::noun::{Atom, D, T};
+use nockvm_macros::tas;
 
 pub const OUT_JAM_NAME: &str = "out.jam";
 
 pub type Error = Box<dyn std::error::Error>;
 
-static KERNEL_JAM: &[u8] = include_bytes!("../bootstrap/choo.jam");
-static HOON_TXT: &[u8] = include_bytes!("../../hoon/hoon-138.hoon");
+static KERNEL_JAM: &[u8] = include_bytes!("../bootstrap/hoonc.jam");
+static HOON_TXT: &[u8] = include_bytes!("../hoon/hoon-138.hoon");
 
 #[derive(Parser, Debug)]
 #[command(about = "Tests various poke types for the kernel", author = "zorp", version, color = ColorChoice::Auto)]
@@ -45,10 +45,10 @@ pub struct ChooCli {
     pub output: Option<std::path::PathBuf>,
 }
 
-pub async fn choo_data_dir() -> PathBuf {
-    let choo_data_dir = system_data_dir().join("choo");
-    if !choo_data_dir.exists() {
-        fs::create_dir_all(&choo_data_dir)
+pub async fn hoonc_data_dir() -> PathBuf {
+    let hoonc_data_dir = system_data_dir().join("hoonc");
+    if !hoonc_data_dir.exists() {
+        fs::create_dir_all(&hoonc_data_dir)
             .await
             .unwrap_or_else(|_| {
                 panic!(
@@ -59,7 +59,7 @@ pub async fn choo_data_dir() -> PathBuf {
                 )
             });
     }
-    choo_data_dir
+    hoonc_data_dir
 }
 
 /// Builds and interprets a Hoon generator.
@@ -89,7 +89,7 @@ pub async fn build_and_kick_jam(
         Noun::cue_bytes_slice(&mut context.stack, &jam).expect("invalid generator jam");
 
     let kick = T(&mut context.stack, &[D(9), D(2), D(0), D(1)]);
-    debug!("kicking trap");
+    debug!("Kicking trap");
     interpreter::interpret(context, generator_trap, kick).unwrap_or_else(|_| {
         panic!(
             "Panicked at {}:{} (git sha: {:?})",
@@ -135,7 +135,7 @@ pub async fn save_generator(
 /// This function:
 /// 1. Locates the source file relative to the hoon directory
 /// 2. Creates a temporary directory for build artifacts
-/// 3. Initializes a Nock app with the choo build system
+/// 3. Initializes a Nock app with the hoonc build system
 /// 4. Builds the source file and returns the resulting jam as bytes
 ///
 /// # Parameters
@@ -144,7 +144,7 @@ pub async fn save_generator(
 /// - `new`: Whether to force a clean build
 ///
 /// # Returns
-/// - A Result containing either the jam bytes or a choo error
+/// - A Result containing either the jam bytes or a hoonc error
 pub async fn build_jam(
     entry: &str,
     deps_dir: PathBuf,
@@ -160,8 +160,8 @@ pub async fn build_jam(
     run_build(nockapp, Some(out_path.clone())).await
 }
 
-pub async fn initialize_choo(cli: ChooCli) -> Result<(crown::nockapp::NockApp, PathBuf), Error> {
-    initialize_choo_(
+pub async fn initialize_hoonc(cli: ChooCli) -> Result<(nockapp::NockApp, PathBuf), Error> {
+    initialize_hoonc_(
         cli.entry,
         cli.directory,
         cli.arbitrary,
@@ -177,18 +177,18 @@ pub async fn initialize_with_default_cli(
     out: Option<std::path::PathBuf>,
     arbitrary: bool,
     new: bool,
-) -> Result<(crown::nockapp::NockApp, PathBuf), Error> {
+) -> Result<(nockapp::NockApp, PathBuf), Error> {
     let cli = default_boot_cli(new);
-    initialize_choo_(entry, deps_dir, arbitrary, out, cli).await
+    initialize_hoonc_(entry, deps_dir, arbitrary, out, cli).await
 }
 
-pub async fn initialize_choo_(
+pub async fn initialize_hoonc_(
     entry: std::path::PathBuf,
     deps_dir: std::path::PathBuf,
     arbitrary: bool,
     out: Option<std::path::PathBuf>,
     boot_cli: BootCli,
-) -> Result<(crown::nockapp::NockApp, PathBuf), Error> {
+) -> Result<(nockapp::NockApp, PathBuf), Error> {
     debug!("Dependencies directory: {:?}", deps_dir);
     debug!("Entry file: {:?}", entry);
     let data_dir = system_data_dir();
@@ -196,7 +196,7 @@ pub async fn initialize_choo_(
         KERNEL_JAM,
         Some(boot_cli.clone()),
         &[],
-        "choo",
+        "hoonc",
         Some(data_dir),
     )
     .await?;
@@ -215,7 +215,7 @@ pub async fn initialize_choo_(
     slab.set_root(bootstrap_poke);
 
     nockapp
-        .add_io_driver(crown::one_punch_driver(slab, Operation::Poke))
+        .add_io_driver(nockapp::one_punch_driver(slab, Operation::Poke))
         .await;
 
     let mut slab = NounSlab::new();
@@ -259,8 +259,17 @@ pub async fn initialize_choo_(
     }
 
     let out_path_string = if let Some(path) = &out {
-        let parent = path.parent().unwrap_or_else(|| Path::new("."));
-        let filename = path.file_name().unwrap_or_else(|| OsStr::new(OUT_JAM_NAME));
+        let parent = if path.is_dir() {
+            path
+        } else {
+            path.parent().unwrap_or_else(|| Path::new("."))
+        };
+        let filename = if path.is_dir() {
+            OsStr::new(OUT_JAM_NAME)
+        } else {
+            path.file_name().unwrap_or_else(|| OsStr::new(OUT_JAM_NAME))
+        };
+        info!("Filename: {:?}", filename);
         let parent_canonical = canonicalize_and_string(parent);
         format!("{}/{}", parent_canonical, filename.to_string_lossy())
     } else {
@@ -274,14 +283,21 @@ pub async fn initialize_choo_(
 
     let poke = T(
         &mut slab,
-        &[D(tas!(b"build")), entry_path, entry_contents, directory_noun, arbitrary_noun, out_path],
+        &[
+            D(tas!(b"build")),
+            entry_path,
+            entry_contents,
+            directory_noun,
+            arbitrary_noun,
+            out_path,
+        ],
     );
     slab.set_root(poke);
     nockapp
-        .add_io_driver(crown::one_punch_driver(slab, Operation::Poke))
+        .add_io_driver(nockapp::one_punch_driver(slab, Operation::Poke))
         .await;
-    nockapp.add_io_driver(crown::file_driver()).await;
-    nockapp.add_io_driver(crown::exit_driver()).await;
+    nockapp.add_io_driver(nockapp::file_driver()).await;
+    nockapp.add_io_driver(nockapp::exit_driver()).await;
     Ok((nockapp, out_path_string.into()))
 }
 
@@ -324,7 +340,7 @@ pub fn canonicalize_and_string(path: &std::path::Path) -> String {
 
 /// Run the build and verify the output file, used to build files outside of cli.
 pub async fn run_build(
-    nockapp: crown::nockapp::NockApp,
+    nockapp: nockapp::NockApp,
     out_path: Option<PathBuf>,
 ) -> Result<Vec<u8>, Error> {
     nockapp.run().await?;

+ 4 - 4
crates/nockapp/apps/choo/src/main.rs → crates/hoonc/src/main.rs

@@ -1,8 +1,8 @@
-use choo::*;
+use hoonc::*;
 use clap::Parser;
-use crown::kernel::boot;
 use futures::FutureExt;
-use sword::mem::{AllocationError, NewStackError};
+use nockapp::kernel::boot;
+use nockvm::mem::{AllocationError, NewStackError};
 
 #[tokio::main]
 async fn main() -> Result<(), Error> {
@@ -10,7 +10,7 @@ async fn main() -> Result<(), Error> {
 
     boot::init_default_tracing(&cli.boot.clone());
     let result = std::panic::AssertUnwindSafe(async {
-        let (nockapp, _) = initialize_choo(cli).await?;
+        let (nockapp, _) = initialize_hoonc(cli).await?;
         nockapp.run().await?;
         Ok::<(), Error>(())
     })

+ 4 - 4
crates/nockapp/apps/choo/tests/build.rs → crates/hoonc/tests/build.rs

@@ -4,14 +4,14 @@ mod test {
     use tempfile::TempDir;
     use tracing::{debug, info};
 
-    #[ignore = "Skipping because test is too slow and CI should already self host choo from scratch"]
+    #[ignore = "Skipping because test is too slow and CI should already self host hoonc from scratch"]
     #[tokio::test]
     async fn test_compile_test_app() -> Result<(), Box<dyn std::error::Error>> {
         let temp_dir = TempDir::new()?;
         let temp_path = temp_dir.path();
         let out_path = format!(
             "{}/out.jam",
-            choo::canonicalize_and_string(temp_path).to_lowercase()
+            hoonc::canonicalize_and_string(temp_path).to_lowercase()
         );
 
         // use std::path to get pwd() and then canonicalize
@@ -35,9 +35,9 @@ mod test {
         info!("Entry file: {:?}", entry);
 
         let (nockapp, out_path) =
-            choo::initialize_with_default_cli(entry, deps_dir, None, false, true).await?;
+            hoonc::initialize_with_default_cli(entry, deps_dir, None, false, true).await?;
 
-        let result = choo::run_build(nockapp, Some(out_path.clone())).await;
+        let result = hoonc::run_build(nockapp, Some(out_path.clone())).await;
         assert!(result.is_ok());
 
         // Cleanup

+ 4 - 4
crates/nockapp/crown/Cargo.toml → crates/nockapp/Cargo.toml

@@ -1,5 +1,5 @@
 [package]
-name = "crown"
+name = "nockapp"
 version.workspace = true
 edition.workspace = true
 
@@ -17,8 +17,8 @@ blake3 = { workspace = true }
 clap = { workspace = true, features = ["derive", "cargo", "color", "env"] }
 dirs = { workspace = true }
 ibig = { workspace = true }
-sword = { workspace = true }
-sword_macros = { workspace = true }
+nockvm = { workspace = true }
+nockvm_macros = { workspace = true }
 assert_no_alloc = { workspace = true }
 async-trait = { workspace = true }
 bincode = { workspace = true, features = ["serde"] }
@@ -51,5 +51,5 @@ tracing-opentelemetry.workspace = true
 [dev-dependencies]
 
 [lib]
-name = "crown"
+name = "nockapp"
 path = "src/lib.rs"

+ 9 - 9
crates/nockapp/README.md

@@ -8,19 +8,19 @@ NockApps are pure-functional state machines with automatic persistence and modul
 
 The NockApp framework provides two modules, Crown and Sword:
 1. Crown provides a minimal Rust interface to a Nock kernel.
-2. [Sword](https://github.com/zorp-corp/sword) is a modern Nock runtime that achieves durable execution.
+2. [Sword](https://github.com/zorp-corp/nockvm) is a modern Nock runtime that achieves durable execution.
 
 <br>
 
 ## Get Started
 
-To test compiling a Nock kernel using the `choo` command-line Hoon compiler, run the following commands:
+To test compiling a Nock kernel using the `hoonc` command-line Hoon compiler, run the following commands:
 
 ```
 cargo build
-cd apps/choo
+cd apps/hoonc
 cargo run --release bootstrap/kernel.hoon ../hoon-deps
-yes | mv out.jam bootstrap/choo.jam
+yes | mv out.jam bootstrap/hoonc.jam
 cargo run --release bootstrap/kernel.hoon ../hoon-deps
 ```
 
@@ -28,9 +28,9 @@ For large builds, the rust stack might overflow. To get around this, increase th
 
 ## Building NockApps
 
-The `crown` library is the primary framework for building NockApps. It provides a simple interface to a `Kernel`: a Nock core which can make state transitions with effects (via the `poke()` method) and allow inspection of its state via the `peek()` method.
+The `nockapp` library is the primary framework for building NockApps. It provides a simple interface to a `Kernel`: a Nock core which can make state transitions with effects (via the `poke()` method) and allow inspection of its state via the `peek()` method.
 
-For compiling Hoon to Nock, we're also including a pre-release of `choo`: a NockApp for the Hoon compiler. `choo` can compile Hoon to Nock as a batch-mode command-line process, without the need to spin up an interactive Urbit ship. It is intended both for developer workflows and for CI. `choo` is also our first example NockApp. More are coming!
+For compiling Hoon to Nock, we're also including a pre-release of `hoonc`: a NockApp for the Hoon compiler. `hoonc` can compile Hoon to Nock as a batch-mode command-line process, without the need to spin up an interactive Urbit ship. It is intended both for developer workflows and for CI. `hoonc` is also our first example NockApp. More are coming!
 
 ## Logging Configuration
 
@@ -53,7 +53,7 @@ Use `MINIMAL_LOG_FORMAT=true` for compact logging format
 The minimal log format (`MINIMAL_LOG_FORMAT=true`) provides:
 - Single-letter colored log levels (T, D, I, W, E)
 - Simplified timestamps in HH:MM:SS format
-- Abbreviated module paths (e.g., 'crown::kernel::boot' becomes '[cr] kernel::boot')
+- Abbreviated module paths (e.g., 'nockapp::kernel::boot' becomes '[cr] kernel::boot')
 - Special handling for slogger messages (colored by log level)
 
 ### Environment Variables
@@ -62,11 +62,11 @@ The following environment variables can be used to configure logging:
 
 ```bash
 # Set log level
-RUST_LOG="crown::kernel=trace" cargo run
+RUST_LOG="nockapp::kernel=trace" cargo run
 
 # Enable minimal log format
 MINIMAL_LOG_FORMAT=true cargo run
 
 # Combine environment variables
-RUST_LOG="crown::kernel=trace" MINIMAL_LOG_FORMAT=true cargo run
+RUST_LOG="nockapp::kernel=trace" MINIMAL_LOG_FORMAT=true cargo run
 ```

+ 0 - 16
crates/nockapp/apps/http-app/Cargo.toml

@@ -1,16 +0,0 @@
-[package]
-name = "http-app"
-version.workspace = true
-edition.workspace = true
-
-[dependencies]
-crown  = { path = "../../crown" }
-sword = { workspace = true }
-sword_macros = { workspace = true }
-clap = { workspace = true, features = ["derive", "cargo", "color", "env"]}
-tokio = { workspace = true, features = ["signal"] }
-tracing = { workspace = true }
-
-[[bin]]
-name = "http-app"
-path = "main.rs"

BIN
crates/nockapp/apps/http-app/bootstrap/http.jam


+ 0 - 98
crates/nockapp/apps/http-app/bootstrap/kernel.hoon

@@ -1,98 +0,0 @@
-/+  *wrapper
-=>
-|%
-+$  server-state  %stateless
-++  moat  (keep server-state)
-+$  header  [k=@t v=@t]
-+$  octs  [p=@ q=@]
-+$  method
-  $?  %'GET'
-      %'HEAD'
-      %'POST'
-      %'PUT'
-      %'DELETE'
-      %'CONNECT'
-      %'OPTIONS'
-      %'TRACE'
-      %'PATCH'
-  ==
-::
-+$  cause
-  $:  %req
-      id=@
-      uri=@t
-      =method
-      headers=(list header)
-      body=(unit octs)
-  ==
-::
-+$  effect
-  $:  %res
-      id=@
-      status=@ud
-      headers=(list header)
-      body=(unit octs)
-  ==
-::
-++  to-octs
-  |=  bod=@
-  ^-  (unit octs)
-  =/  len  (met 3 bod)
-  ?:  =(len 0)  ~
-  `[len bod]
---
-::
-~&  %serving
-%-  (moat |)
-^-  fort:moat
-|_  k=server-state
-::
-::  +load: upgrade from previous state
-::
-++  load
-  |=  arg=server-state
-  arg
-::
-::  +peek: external inspect
-::
-++  peek
-  |=  =path
-  ^-  (unit (unit *))
-  !!
-::
-::  +poke: external apply
-::
-++  poke
-  |=  [=wire eny=@ our=@ux now=@da dat=*]
-  ^-  [(list effect) server-state]
-  =/  sof-cau=(unit cause)  ((soft cause) dat)
-  ?~  sof-cau
-    ~&  "cause incorrectly formatted!"
-    ~&  dat
-    !!
-  =/  [id=@ uri=@t =method headers=(list header) body=(unit octs)]  +.u.sof-cau
-  ~&  [id+id uri+uri method+method headers+headers]
-  :_  k
-  :_  ~
-  ^-  effect
-  =-  ~&  effect+-
-      -
-  ?+    method  [%res ~ %400 ~ ~]
-      %'GET'
-    :*  %res  id=id  %200
-      ['content-type' 'text/html']~
-    %-  to-octs
-    '''
-    <!doctype html>
-    <html>
-      <body>
-        <h1>Hello NockApp!</h1>
-      </body>
-    </html>
-    '''
-   ==
-  ::
-      %'POST'
-    !!
-  ==
---

+ 0 - 26
crates/nockapp/apps/http-app/main.rs

@@ -1,26 +0,0 @@
-use clap::{command, ColorChoice, Parser};
-use crown::kernel::boot;
-use crown::kernel::boot::Cli as BootCli;
-use tracing::debug;
-
-static KERNEL_JAM: &[u8] =
-    include_bytes!(concat!(env!("CARGO_MANIFEST_DIR"), "/bootstrap/http.jam"));
-#[derive(Parser, Debug)]
-#[command(about = "Tests various poke types for the kernel", author = "zorp", version, color = ColorChoice::Auto)]
-struct TestCli {
-    #[command(flatten)]
-    boot: BootCli,
-}
-
-#[tokio::main]
-async fn main() -> Result<(), Box<dyn std::error::Error>> {
-    let cli = TestCli::parse();
-    debug!("KERNEL_JAM len: {:?}", KERNEL_JAM.to_vec().len());
-    boot::init_default_tracing(&cli.boot.clone());
-    let mut http_app = boot::setup(KERNEL_JAM, Some(cli.boot.clone()), &[], "choo")?;
-    http_app.add_io_driver(crown::http_driver()).await;
-
-    http_app.run().await.expect("Failed to run app");
-
-    Ok(())
-}

+ 0 - 16
crates/nockapp/apps/test-app/Cargo.toml

@@ -1,16 +0,0 @@
-[package]
-name = "test-app"
-version.workspace = true
-edition.workspace = true
-
-[dependencies]
-crown = { path = "../../crown" }
-sword = { workspace = true }
-sword_macros = { workspace = true }
-clap = { workspace = true, features = ["derive", "cargo", "color", "env"]}
-tokio = { workspace = true, features = ["signal"] }
-tracing = { workspace = true }
-
-[[bin]]
-name = "test"
-path = "main.rs"

+ 0 - 71
crates/nockapp/apps/test-app/bootstrap/kernel.hoon

@@ -1,71 +0,0 @@
-/+  *wrapper
-=>
-|%
-+$  versioned-state
-  $%  test-state
-  ==
-+$  test-state  [%0 val=@]
-++  moat  (keep test-state)
-+$  cause  ?(%inc %inc-exit)
-::
-+$  effect
-  $%  [%state test-state]
-      [%exit id=@]
-  ==
---
-::
-%-  (moat |)
-^-  fort:moat
-|_  k=test-state
-::
-::  +load: upgrade from previous state
-::
-++  load
-  |=  old=test-state
-  ~&  "test-app: load"
-  ?~  ((soft versioned-state) old)
-    ~&   "test-app: +load old state does not nest under versioned-state"
-    !!
-  old
-::
-::  +peek: external inspect
-::
-++  peek
-  |=  arg=*
-  ^-  (unit (unit *))
-  =/  pax  ((soft path) arg)
-  ?~  pax  ~|(invalid-peek+pax !!)
-  ~&  >  "peeked at {<u.pax>}"
-  ?+  u.pax  ~|(invalid-peek+pax !!)
-  ::
-      [%state ~]
-    ``k
-  ==
-::
-::  +poke: external apply
-::
-++  poke
-  |=  [=wire eny=@ our=@ux now=@da dat=*]
-  ^-  [(list effect) test-state]
-  ~&  >>  "poke: {<wire>}"
-  =/  sof-cau=(unit cause)  ((soft cause) dat)
-  ?~  sof-cau
-    ~&  "cause incorrectly formatted!"
-    ~&  dat
-    !!
-  ?+    `@tas`u.sof-cau  !!
-      %inc
-    =.  val.k  +(val.k)
-    :_  k
-    =-  ~&  effect+-
-      -
-    ~[[%state k]]
-  ::
-     %inc-exit
-    =.  val.k  +(val.k)
-    :_  k
-    =-  ~&  effect+-
-      -
-    ~[[%exit 0] [%state k]]
-  ==
---

BIN
crates/nockapp/apps/test-app/bootstrap/test-ker.jam


+ 0 - 47
crates/nockapp/apps/test-app/main.rs

@@ -1,47 +0,0 @@
-use clap::{command, ColorChoice, Parser};
-use crown::kernel::boot;
-use crown::kernel::boot::Cli as BootCli;
-use crown::noun::slab::NounSlab;
-use sword::noun::D;
-use sword_macros::tas;
-use tracing::debug;
-
-static KERNEL_JAM: &[u8] = include_bytes!(concat!(
-    env!("CARGO_MANIFEST_DIR"),
-    "/bootstrap/test-ker.jam"
-));
-#[derive(Parser, Debug)]
-#[command(about = "Tests various poke types for the kernel", author = "zorp", version, color = ColorChoice::Auto)]
-struct TestCli {
-    #[command(flatten)]
-    boot: BootCli,
-    #[arg(long, help = "Exit after poke")]
-    exit: bool,
-}
-
-#[tokio::main]
-async fn main() -> Result<(), Box<dyn std::error::Error>> {
-    let cli = TestCli::parse();
-    debug!("KERNEL_JAM len: {:?}", KERNEL_JAM.to_vec().len());
-    boot::init_default_tracing(&cli.boot.clone());
-    let mut test_app = boot::setup(KERNEL_JAM, Some(cli.boot.clone()), &[], "test")?;
-    let poke = if cli.exit {
-        D(tas!(b"inc-exit"))
-    } else {
-        D(tas!(b"inc"))
-    };
-    let mut slab = NounSlab::new();
-    slab.set_root(poke);
-    test_app
-        .add_io_driver(crown::one_punch_driver(
-            slab,
-            crown::nockapp::driver::Operation::Poke,
-        ))
-        .await;
-
-    test_app.add_io_driver(crown::exit_driver()).await;
-
-    test_app.run().await.expect("Failed to run app");
-
-    Ok(())
-}

+ 0 - 72
crates/nockapp/nested-workspace.toml

@@ -1,72 +0,0 @@
-[workspace]
-members = ["crown", "apps/choo", "apps/http-app", "apps/test-app"]
-resolver = "2"
-
-[workspace.package]
-version = "0.1.0"
-edition = "2021"
-
-[workspace.dependencies]
-sword = { git = "https://github.com/zorp-corp/sword.git", rev = "bcb2e7fba0e24d45d4887fae77389d7c5e86b507" }
-sword_macros = { git = "https://github.com/zorp-corp/sword.git", rev = "bcb2e7fba0e24d45d4887fae77389d7c5e86b507" }
-assert_no_alloc = { git = "https://github.com/zorp-corp/sword.git", rev = "bcb2e7fba0e24d45d4887fae77389d7c5e86b507" }
-
-# Uncomment for local dev of sword and comment out above
-# assert_no_alloc.path = "../sword/rust/assert_no_alloc"
-# sword.path = "../sword/rust/sword"
-# sword_macros.path = "../sword/rust/sword_macros"
-
-# External dependencies
-anyhow = "1.0"
-async-trait = "0.1"
-axum = "0.8.1"
-bincode = "2.0.0-rc.3"
-bitvec = "1.0.1"
-blake3 = { version = "1.5.1", features = ["serde"] }
-byteorder = "1.5.0"
-bytes = "1.5.0"
-clap = "4.4.4"
-console-subscriber = "0.4.1"
-either = "1.9.0"
-futures = "0.3.31"
-getrandom = "0.3.1"
-intmap = "3.1.0"
-metrics = "0.24.1"
-metrics-exporter-prometheus = "0.16.2"
-opentelemetry = { version = "0.27.1", features = [
-    "trace",
-    "logs",
-    "metrics",
-    "internal-logs",
-] }
-opentelemetry-otlp = { version = "0.27.0", features = [
-    "tonic",
-    "http-proto",
-    "reqwest-client",
-] }
-opentelemetry_sdk = { version = "0.27.1", features = ["rt-tokio"] }
-rand = "0.8.5"
-serde = "1.0.195"
-tempfile = "3.3"
-termimad = "0.31.0"
-tracing = "0.1.40"
-tracing-opentelemetry = { version = "0.28.0", features = ["metrics"] }
-tracing-subscriber = { version = "0.3.18", features = [
-    "ansi",
-    "env-filter",
-    "registry",
-] }
-tracing-test = "0.2.5"
-thiserror = "1.0"
-tokio = { version = "1.32", features = [
-    "rt",
-    "rt-multi-thread",
-    "net",
-    "macros",
-    "io-util",
-    "fs",
-    "signal",
-] }
-tokio-util = "0.7.12"
-tonic = "0.12.3"
-yaque = "0.6.6"

+ 0 - 0
crates/nockapp/crown/src/drivers/exit.rs → crates/nockapp/src/drivers/exit.rs


+ 2 - 2
crates/nockapp/crown/src/drivers/file.rs → crates/nockapp/src/drivers/file.rs

@@ -3,8 +3,8 @@ use crate::nockapp::wire::{Wire, WireRepr};
 use crate::noun::slab::NounSlab;
 use crate::noun::FromAtom;
 use crate::AtomExt;
-use sword::noun::{IndirectAtom, Noun, D, NO, T, YES};
-use sword_macros::tas;
+use nockvm::noun::{IndirectAtom, Noun, D, NO, T, YES};
+use nockvm_macros::tas;
 use tracing::{debug, error};
 
 pub enum FileWire {

+ 4 - 4
crates/nockapp/crown/src/drivers/http.rs → crates/nockapp/src/drivers/http.rs

@@ -11,8 +11,8 @@ use axum::extract::State;
 use axum::http::{HeaderMap, Method, StatusCode, Uri};
 use axum::response::Response;
 use axum::routing::any;
-use sword::noun::{Atom, D, T};
-use sword_macros::tas;
+use nockvm::noun::{Atom, D, T};
+use nockvm_macros::tas;
 use tokio::select;
 use tokio::sync::{oneshot, RwLock};
 use tracing::debug;
@@ -60,7 +60,7 @@ fn get_id() -> u64 {
 pub fn http() -> IODriverFn {
     make_driver(move |handle| async move {
         let (tx, mut rx) = tokio::sync::mpsc::channel::<RequestMessage>(10);
-        let app = any(sword_handler).with_state(tx);
+        let app = any(nockvm_handler).with_state(tx);
 
         let listener = tokio::net::TcpListener::bind("0.0.0.0:8080")
             .await
@@ -330,7 +330,7 @@ pub fn http() -> IODriverFn {
     })
 }
 
-async fn sword_handler(
+async fn nockvm_handler(
     method: Method,
     headers: HeaderMap,
     uri: Uri,

+ 2 - 2
crates/nockapp/crown/src/drivers/markdown.rs → crates/nockapp/src/drivers/markdown.rs

@@ -1,7 +1,7 @@
 use crate::nockapp::driver::{make_driver, IODriverFn};
 use crate::AtomExt;
-use sword::noun::D;
-use sword_macros::tas;
+use nockvm::noun::D;
+use nockvm_macros::tas;
 
 use termimad::MadSkin;
 use tracing::error;

+ 0 - 0
crates/nockapp/crown/src/drivers/mod.rs → crates/nockapp/src/drivers/mod.rs


+ 2 - 2
crates/nockapp/crown/src/drivers/npc.rs → crates/nockapp/src/drivers/npc.rs

@@ -6,8 +6,8 @@ use crate::Bytes;
 use bytes::buf::BufMut;
 use std::sync::Arc;
 
-use sword::noun::{D, T};
-use sword_macros::tas;
+use nockvm::noun::{D, T};
+use nockvm_macros::tas;
 use tokio::io::{split, AsyncReadExt, AsyncWriteExt, ReadHalf, WriteHalf};
 use tokio::net::{UnixListener, UnixStream};
 use tokio::select;

+ 2 - 2
crates/nockapp/crown/src/drivers/one_punch.rs → crates/nockapp/src/drivers/one_punch.rs

@@ -3,8 +3,8 @@ use crate::nockapp::wire::Wire;
 use crate::nockapp::NockAppError;
 use crate::noun::slab::NounSlab;
 use either::Either::{self, Left, Right};
-use sword::noun::D;
-use sword_macros::tas;
+use nockvm::noun::D;
+use nockvm_macros::tas;
 use tracing::debug;
 
 pub enum OnePunchWire {

+ 0 - 0
crates/nockapp/crown/src/drivers/timer.rs → crates/nockapp/src/drivers/timer.rs


+ 2 - 2
crates/nockapp/crown/src/kernel/boot.rs → crates/nockapp/src/kernel/boot.rs

@@ -3,9 +3,9 @@ use crate::kernel::form::Kernel;
 use crate::{default_data_dir, NockApp};
 use chrono;
 use clap::{arg, command, ColorChoice, Parser};
+use nockvm::jets::hot::HotEntry;
 use std::fs;
 use std::path::PathBuf;
-use sword::jets::hot::HotEntry;
 use tracing::{debug, info, Level};
 use tracing_subscriber::fmt::format::Writer;
 use tracing_subscriber::fmt::{FmtContext, FormatEvent, FormatFields};
@@ -127,7 +127,7 @@ where
             if parts.len() > 1 {
                 // If we have a structure like "a::b::c::d", just take "c::d"
                 // but prefix it with the first two characters of the first part
-                // i.e, crown::kernel::boot -> [cr] kernel::boot
+                // i.e, nockapp::kernel::boot -> [cr] kernel::boot
                 if parts.len() > 2 {
                     format!(
                         "[{}] {}::{}",

+ 6 - 6
crates/nockapp/crown/src/kernel/checkpoint.rs → crates/nockapp/src/kernel/checkpoint.rs

@@ -3,11 +3,11 @@ use bincode::config::{self, Configuration};
 use bincode::{encode_to_vec, Decode, Encode};
 use blake3::{Hash, Hasher};
 use bytes::Bytes;
+use nockvm::jets::cold::{Cold, Nounable};
+use nockvm::mem::NockStack;
+use nockvm::noun::{Noun, T};
+use nockvm_macros::tas;
 use std::path::{Path, PathBuf};
-use sword::jets::cold::{Cold, Nounable};
-use sword::mem::NockStack;
-use sword::noun::{Noun, T};
-use sword_macros::tas;
 use thiserror::Error;
 use tracing::{debug, error, warn};
 
@@ -171,9 +171,9 @@ pub enum CheckpointError<'a> {
     #[error("Invalid checksum at {0}")]
     InvalidChecksum(&'a PathBuf),
     #[error("Sword noun error: {0}")]
-    SwordNounError(#[from] sword::noun::Error),
+    SwordNounError(#[from] nockvm::noun::Error),
     #[error("Sword cold error: {0}")]
-    FromNounError(#[from] sword::jets::cold::FromNounError),
+    FromNounError(#[from] nockvm::jets::cold::FromNounError),
     #[error("Both checkpoints failed: {0}, {1}")]
     BothCheckpointsFailed(Box<CheckpointError<'a>>, Box<CheckpointError<'a>>),
     #[error("Sword interpreter error")]

+ 25 - 27
crates/nockapp/crown/src/kernel/form.rs → crates/nockapp/src/kernel/form.rs

@@ -2,22 +2,22 @@
 use crate::noun::slab::NounSlab;
 use blake3::{Hash, Hasher};
 use byteorder::{LittleEndian, WriteBytesExt};
+use nockvm::hamt::Hamt;
+use nockvm::interpreter::{self, interpret, Error, Mote};
+use nockvm::jets::cold::{Cold, Nounable};
+use nockvm::jets::hot::{HotEntry, URBIT_HOT_STATE};
+use nockvm::jets::nock::util::mook;
+use nockvm::mem::NockStack;
+use nockvm::mug::met3_usize;
+use nockvm::noun::{Atom, Cell, DirectAtom, IndirectAtom, Noun, Slots, D, T};
+use nockvm::trace::{path_to_cord, write_serf_trace_safe, TraceInfo};
+use nockvm_macros::tas;
 use std::any::Any;
 use std::fs::File;
 use std::path::PathBuf;
 use std::sync::atomic::{AtomicBool, AtomicU64, Ordering};
 use std::sync::Arc;
 use std::time::Instant;
-use sword::hamt::Hamt;
-use sword::interpreter::{self, interpret, Error, Mote};
-use sword::jets::cold::{Cold, Nounable};
-use sword::jets::hot::{HotEntry, URBIT_HOT_STATE};
-use sword::jets::nock::util::mook;
-use sword::mem::NockStack;
-use sword::mug::met3_usize;
-use sword::noun::{Atom, Cell, DirectAtom, IndirectAtom, Noun, Slots, D, T};
-use sword::trace::{path_to_cord, write_serf_trace_safe, TraceInfo};
-use sword_macros::tas;
 use tracing::{debug, error, info, warn};
 
 use crate::kernel::checkpoint::{Checkpoint, ExportedState, JamPaths, JammedCheckpoint};
@@ -158,7 +158,7 @@ impl SerfThread {
 
     // Future which completes when the serf thread finishes. Since rust threads only support polling or blocking joining, not notification,
     // we have to poll on a timer.
-    pub async fn finished(&self) {
+    pub(crate) async fn finished(&self) {
         let mut interval = tokio::time::interval(Duration::from_millis(100));
         loop {
             interval.tick().await;
@@ -169,7 +169,7 @@ impl SerfThread {
         }
     }
 
-    pub async fn stop(&self) {
+    pub(crate) async fn stop(&self) {
         self.action_sender
             .send(SerfAction::Stop)
             .await
@@ -177,7 +177,7 @@ impl SerfThread {
         self.finished().await;
     }
 
-    pub fn join(self) -> Result<(), Box<dyn Any + Send + 'static>> {
+    pub(crate) fn join(self) -> Result<(), Box<dyn Any + Send + 'static>> {
         self.handle.join()
     }
 
@@ -197,7 +197,7 @@ impl SerfThread {
         Ok(result_fut.await?)
     }
 
-    pub async fn peek(&self, ovo: NounSlab) -> Result<NounSlab> {
+    pub(crate) async fn peek(&self, ovo: NounSlab) -> Result<NounSlab> {
         let (result, result_fut) = oneshot::channel();
         self.action_sender
             .send(SerfAction::Peek { ovo, result })
@@ -205,7 +205,7 @@ impl SerfThread {
         result_fut.await?
     }
 
-    pub async fn poke(&self, wire: WireRepr, cause: NounSlab) -> Result<NounSlab> {
+    pub(crate) async fn poke(&self, wire: WireRepr, cause: NounSlab) -> Result<NounSlab> {
         let (result, result_fut) = oneshot::channel();
         self.action_sender
             .send(SerfAction::Poke {
@@ -217,7 +217,7 @@ impl SerfThread {
         result_fut.await?
     }
 
-    pub fn poke_sync(&self, wire: WireRepr, cause: NounSlab) -> Result<NounSlab> {
+    pub(crate) fn poke_sync(&self, wire: WireRepr, cause: NounSlab) -> Result<NounSlab> {
         let (result, result_fut) = oneshot::channel();
         self.action_sender.blocking_send(SerfAction::Poke {
             wire,
@@ -227,14 +227,14 @@ impl SerfThread {
         result_fut.blocking_recv()?
     }
 
-    pub fn peek_sync(&self, ovo: NounSlab) -> Result<NounSlab> {
+    pub(crate) fn peek_sync(&self, ovo: NounSlab) -> Result<NounSlab> {
         let (result, result_fut) = oneshot::channel();
         self.action_sender
             .blocking_send(SerfAction::Peek { ovo, result })?;
         result_fut.blocking_recv()?
     }
 
-    pub async fn load_state_from_bytes(&self, state: Vec<u8>) -> Result<()> {
+    pub(crate) async fn load_state_from_bytes(&self, state: Vec<u8>) -> Result<()> {
         let (result, result_fut) = oneshot::channel();
         self.action_sender
             .send(SerfAction::LoadState { state, result })
@@ -242,7 +242,7 @@ impl SerfThread {
         result_fut.await?
     }
 
-    pub async fn create_state_bytes(&self) -> Result<Vec<u8>> {
+    pub(crate) async fn create_state_bytes(&self) -> Result<Vec<u8>> {
         let (result, result_fut) = oneshot::channel();
         self.action_sender
             .send(SerfAction::GetStateBytes { result })
@@ -250,7 +250,7 @@ impl SerfThread {
         result_fut.await?
     }
 
-    pub async fn checkpoint(&self) -> Result<JammedCheckpoint> {
+    pub(crate) async fn checkpoint(&self) -> Result<JammedCheckpoint> {
         let (result, result_fut) = oneshot::channel();
         self.action_sender
             .send(SerfAction::Checkpoint { result })
@@ -595,7 +595,7 @@ impl Kernel {
         self.serf.checkpoint().await
     }
 
-    #[tracing::instrument(name = "crown::Kernel::poke", skip(self, cause))]
+    #[tracing::instrument(name = "nockapp::Kernel::poke", skip(self, cause))]
     pub async fn poke(&self, wire: WireRepr, cause: NounSlab) -> Result<NounSlab> {
         self.serf.poke(wire, cause).await
     }
@@ -608,7 +608,7 @@ impl Kernel {
         self.serf.peek_sync(ovo)
     }
 
-    #[tracing::instrument(name = "crown::Kernel::peek", skip_all)]
+    #[tracing::instrument(name = "nockapp::Kernel::peek", skip_all)]
     pub async fn peek(&mut self, ovo: NounSlab) -> Result<NounSlab> {
         self.serf.peek(ovo).await
     }
@@ -642,7 +642,7 @@ impl Serf {
     /// * `checkpoint` - Optional checkpoint to restore from.
     /// * `kernel_bytes` - Byte slice containing the kernel code.
     /// * `constant_hot_state` - Custom hot state entries.
-    /// * `trace` - Bool indicating whether to enable sword tracing.
+    /// * `trace` - Bool indicating whether to enable nockvm tracing.
     ///
     /// # Returns
     ///
@@ -1050,15 +1050,13 @@ impl Serf {
     ///
     /// Result containing the poke response or an error.
     #[tracing::instrument(level = "info", skip_all, fields(
-        wire_source = wire.source,
-        wire_version = wire.version,
-        wire_tags = wire.tags_as_csv(),
+        wire_source = wire.source
     ))]
     pub fn poke(&mut self, wire: WireRepr, cause: Noun) -> Result<Noun> {
         let random_bytes = rand::random::<u64>();
         let bytes = random_bytes.as_bytes()?;
         let eny: Atom = Atom::from_bytes(&mut self.context.stack, &bytes);
-        let our = <sword::noun::Atom as AtomExt>::from_value(&mut self.context.stack, 0)?; // Using 0 as default value
+        let our = <nockvm::noun::Atom as AtomExt>::from_value(&mut self.context.stack, 0)?; // Using 0 as default value
         let now: Atom = unsafe {
             let mut t_vec: Vec<u8> = vec![];
             t_vec.write_u128::<LittleEndian>(current_da().0)?;

+ 0 - 0
crates/nockapp/crown/src/kernel/mod.rs → crates/nockapp/src/kernel/mod.rs


+ 6 - 6
crates/nockapp/crown/src/lib.rs → crates/nockapp/src/lib.rs

@@ -2,7 +2,7 @@
 //!
 //! The Crown library provides a set of modules and utilities for working with
 //! the Sword runtime. It includes functionality for handling jammed nouns, kernels (as jammed nouns),
-//! and various types and utilities that make sword easier to use.
+//! and various types and utilities that make nockvm easier to use.
 //!
 //! ## Modules
 //!
@@ -18,9 +18,9 @@ pub mod observability;
 pub mod utils;
 
 pub use bytes::*;
-pub use nockapp::NockApp;
+pub use nockapp::*;
+pub use nockvm::noun::Noun;
 pub use noun::{AtomExt, JammedNoun, NounExt};
-pub use sword::noun::Noun;
 pub use utils::bytes::{ToBytes, ToBytesExt};
 pub use utils::error::{CrownError, Result};
 
@@ -39,9 +39,9 @@ use std::path::PathBuf;
 /// ```
 ///
 /// use std::path::PathBuf;
-/// use crown::default_data_dir;
-/// let dir = default_data_dir("crown");
-/// assert_eq!(dir, PathBuf::from("./.data.crown"));
+/// use nockapp::default_data_dir;
+/// let dir = default_data_dir("nockapp");
+/// assert_eq!(dir, PathBuf::from("./.data.nockapp"));
 /// ```
 pub fn default_data_dir(dir_name: &str) -> PathBuf {
     PathBuf::from(format!("./.data.{}", dir_name))

+ 0 - 0
crates/nockapp/crown/src/nockapp/actors/kernel.rs → crates/nockapp/src/nockapp/actors/kernel.rs


+ 0 - 0
crates/nockapp/crown/src/nockapp/actors/mod.rs → crates/nockapp/src/nockapp/actors/mod.rs


+ 0 - 0
crates/nockapp/crown/src/nockapp/actors/save.rs → crates/nockapp/src/nockapp/actors/save.rs


+ 8 - 8
crates/nockapp/crown/src/nockapp/driver.rs → crates/nockapp/src/nockapp/driver.rs

@@ -64,7 +64,7 @@ pub enum IOAction {
 }
 
 impl NockAppHandle {
-    #[tracing::instrument(name = "crown::NockAppHandle::send_poke", skip_all)]
+    #[tracing::instrument(name = "nockapp::NockAppHandle::send_poke", skip_all)]
     pub async fn send_poke(
         &self,
         ack_channel: oneshot::Sender<PokeResult>,
@@ -81,7 +81,7 @@ impl NockAppHandle {
         Ok(())
     }
 
-    #[tracing::instrument(name = "crown::NockAppHandle::try_send_poke", skip_all)]
+    #[tracing::instrument(name = "nockapp::NockAppHandle::try_send_poke", skip_all)]
     /// Tries to send a poke. Returns NockAppError::MPSCSendError if the channel is closed. If the channel is full, the result is given back in the Some branch of the Option. If the channel is empty
     pub fn try_send_poke(
         &self,
@@ -96,7 +96,7 @@ impl NockAppHandle {
         })?)
     }
 
-    #[tracing::instrument(name = "crown::NockAppHandle::poke", skip_all)]
+    #[tracing::instrument(name = "nockapp::NockAppHandle::poke", skip_all)]
     pub async fn poke(&self, wire: WireRepr, poke: NounSlab) -> Result<PokeResult, NockAppError> {
         let (ack_channel, ack_future) = oneshot::channel();
         self.send_poke(ack_channel, wire, poke).await?;
@@ -104,7 +104,7 @@ impl NockAppHandle {
     }
 
     // This is still async because we still await the ack future on success.
-    #[tracing::instrument(name = "crown::NockAppHandle::try_poke", skip_all)]
+    #[tracing::instrument(name = "nockapp::NockAppHandle::try_poke", skip_all)]
     pub async fn try_poke(
         &self,
         wire: WireRepr,
@@ -115,7 +115,7 @@ impl NockAppHandle {
         Ok(ack_future.await?)
     }
 
-    #[tracing::instrument(name = "crown::NockAppHandle::try_send_peek", skip_all)]
+    #[tracing::instrument(name = "nockapp::NockAppHandle::try_send_peek", skip_all)]
     pub fn try_send_peek(
         &self,
         path: NounSlab,
@@ -127,7 +127,7 @@ impl NockAppHandle {
         })?)
     }
 
-    #[tracing::instrument(name = "crown::NockAppHandle::send_peek", skip_all)]
+    #[tracing::instrument(name = "nockapp::NockAppHandle::send_peek", skip_all)]
     async fn send_peek(
         &self,
         path: NounSlab,
@@ -142,7 +142,7 @@ impl NockAppHandle {
         Ok(())
     }
 
-    #[tracing::instrument(name = "crown::NockAppHandle::peek", skip_all)]
+    #[tracing::instrument(name = "nockapp::NockAppHandle::peek", skip_all)]
     pub async fn peek(&self, path: NounSlab) -> Result<Option<NounSlab>, NockAppError> {
         let (result_channel, result_future) = oneshot::channel();
         self.send_peek(path, result_channel).await?;
@@ -150,7 +150,7 @@ impl NockAppHandle {
     }
 
     // Still async because we need to await the result future
-    #[tracing::instrument(name = "crown::NockAppHandle::try_peek", skip_all)]
+    #[tracing::instrument(name = "nockapp::NockAppHandle::try_peek", skip_all)]
     pub async fn try_peek(&self, path: NounSlab) -> Result<Option<NounSlab>, NockAppError> {
         let (result_channel, result_future) = oneshot::channel();
         self.send_peek(path, result_channel).await?;

+ 2 - 2
crates/nockapp/crown/src/nockapp/error.rs → crates/nockapp/src/nockapp/error.rs

@@ -45,8 +45,8 @@ pub enum NockAppError {
     PokeFailed,
     #[error("Unexpected result")]
     UnexpectedResult,
-    #[error("sword error: {0}")]
-    SwordError(#[from] sword::noun::Error),
+    #[error("nockvm error: {0}")]
+    SwordError(#[from] nockvm::noun::Error),
     #[error("Save error: {0}")]
     EncodeError(#[from] bincode::error::EncodeError),
     #[error("Decode error: {0}")]

+ 0 - 0
crates/nockapp/crown/src/nockapp/metrics.rs → crates/nockapp/src/nockapp/metrics.rs


+ 17 - 4
crates/nockapp/crown/src/nockapp/mod.rs → crates/nockapp/src/nockapp/mod.rs

@@ -17,7 +17,7 @@ use tokio::sync::{broadcast, mpsc, Mutex, OwnedMutexGuard};
 use tokio::time::{interval, Duration, Interval};
 use tokio::{fs, select};
 use tokio_util::task::TaskTracker;
-use tracing::{debug, error, instrument, trace};
+use tracing::{debug, error, info, instrument, trace};
 
 use crate::kernel::form::Kernel;
 use crate::noun::slab::NounSlab;
@@ -461,13 +461,26 @@ impl NockApp {
     #[instrument(skip_all)]
     async fn handle_exit(&mut self, code: usize) -> Result<NockAppRun, NockAppError> {
         // `cargo nextest run`
-        // 2025-01-23T01:11:52.365215Z  INFO crown::nockapp::nockapp: Exit request received, waiting for save checkpoint with event_num 60
-        // 2025-01-23T01:11:52.403120Z ERROR crown::nockapp::nockapp: Action channel closed prematurely
-        // 2025-01-23T01:11:52.403132Z ERROR crown::nockapp::nockapp: Got error running nockapp: ChannelClosedError
+        // 2025-01-23T01:11:52.365215Z  INFO nockapp::nockapp: Exit request received, waiting for save checkpoint with event_num 60
+        // 2025-01-23T01:11:52.403120Z ERROR nockapp::nockapp: Action channel closed prematurely
+        // 2025-01-23T01:11:52.403132Z ERROR nockapp::nockapp: Got error running nockapp: ChannelClosedError
         // test tests::test_compile_test_app ... FAILED
         // self.action_channel.close();
         // TODO: See if exit_status is duplicative of what the cancel token is for.
         self.exit_status.store(true, Ordering::SeqCst);
+
+        // Force an immediate save to ensure we have the latest state
+        info!(
+            "Exit signal received with code {}, forcing immediate save",
+            code
+        );
+        if let Err(e) = self.save_locked().await {
+            error!(
+                "Failed to save during exit: {:?} - continuing with shutdown anyway",
+                e
+            );
+        }
+
         let exit_event_num = self.kernel.serf.event_number.load(Ordering::SeqCst);
         debug!(
             "Exit request received, waiting for save checkpoint with event_num {} (code {})",

+ 8 - 9
crates/nockapp/crown/src/nockapp/test.rs → crates/nockapp/src/nockapp/test.rs

@@ -16,8 +16,7 @@ pub async fn setup_nockapp(jam: &str) -> (TempDir, NockApp) {
         Path::new(env!("CARGO_MANIFEST_DIR"))
             .join("test-jams")
             .join(jam),
-        Path::new("open/crates/nockapp/crown/test-jams").join(jam),
-        Path::new("test-jams").join(jam),
+        Path::new("open/crates/nockapp/test-jams").join(jam),
         // Add other potential paths
     ];
 
@@ -43,17 +42,17 @@ pub mod tests {
     use crate::utils::NOCK_STACK_SIZE;
     use crate::{NockApp, NounExt};
     use bytes::Bytes;
-    use sword::mem::NockStack;
+    use nockvm::mem::NockStack;
     use tracing::info;
 
+    use nockvm::jets::cold::Nounable;
+    use nockvm::jets::util::slot;
+    use nockvm::noun::{Noun, D, T};
+    use nockvm::serialization::{cue, jam};
+    use nockvm::unifying_equality::unifying_equality;
+    use nockvm_macros::tas;
     use std::sync::atomic::Ordering;
     use std::time::Duration;
-    use sword::jets::cold::Nounable;
-    use sword::jets::util::slot;
-    use sword::noun::{Noun, D, T};
-    use sword::serialization::{cue, jam};
-    use sword::unifying_equality::unifying_equality;
-    use sword_macros::tas;
 
     use tracing_test::traced_test;
 

+ 3 - 3
crates/nockapp/crown/src/nockapp/wire.rs → crates/nockapp/src/nockapp/wire.rs

@@ -1,4 +1,4 @@
-use sword::noun::{Noun, NounAllocator, D, T};
+use nockvm::noun::{Noun, NounAllocator, D, T};
 
 use crate::utils::make_tas;
 
@@ -135,7 +135,7 @@ impl Wire for SystemWire {
 
 #[cfg(test)]
 mod test {
-    use sword_macros::tas;
+    use nockvm_macros::tas;
     use tracing::debug;
 
     use crate::noun::slab::NounSlab;
@@ -205,7 +205,7 @@ mod test {
                 option_env!("GIT_SHA")
             )
         });
-        debug!("Wire: {:?}", sword::noun::DebugPath(&cell));
+        debug!("Wire: {:?}", nockvm::noun::DebugPath(&cell));
         // First should be direct it's "npc", 1, "poke", 123
         assert_eq!(
             cell.head()

+ 8 - 8
crates/nockapp/crown/src/noun/extensions.rs → crates/nockapp/src/noun/extensions.rs

@@ -1,14 +1,14 @@
-use sword::interpreter::Error;
-use sword::mem::NockStack;
+use nockvm::interpreter::Error;
+use nockvm::mem::NockStack;
 
 use crate::noun::slab::NounSlab;
 use crate::{Noun, Result, ToBytes, ToBytesExt};
 use bincode::{Decode, Encode};
 use bytes::Bytes;
 use core::str;
+use nockvm::noun::{Atom, IndirectAtom, NounAllocator, D};
+use nockvm::serialization::{cue, jam};
 use std::iter::Iterator;
-use sword::noun::{Atom, IndirectAtom, NounAllocator, D};
-use sword::serialization::{cue, jam};
 
 pub trait NounExt {
     fn cue_bytes(stack: &mut NockStack, bytes: &Bytes) -> Result<Noun, Error>;
@@ -50,9 +50,9 @@ impl NounExt for Noun {
     }
 }
 
-// TODO: This exists largely because crown doesn't own the [`Atom`] type from [`sword`].
-// TODO: The next step for this should be to lower the methods on this trait to a concrete `impl` stanza for [`Atom`] in [`sword`].
-// TODO: In the course of doing so, we should split out a serialization trait that has only the [`AtomExt::from_value`] method as a public API in [`sword`].
+// TODO: This exists largely because nockapp doesn't own the [`Atom`] type from [`nockvm`].
+// TODO: The next step for this should be to lower the methods on this trait to a concrete `impl` stanza for [`Atom`] in [`nockvm`].
+// TODO: In the course of doing so, we should split out a serialization trait that has only the [`AtomExt::from_value`] method as a public API in [`nockvm`].
 // The goal would be to canonicalize the Atom representations of various Rust types. When it needs to be specialized, users can make a newtype.
 pub trait AtomExt {
     fn from_bytes<A: NounAllocator>(allocator: &mut A, bytes: &Bytes) -> Atom;
@@ -70,7 +70,7 @@ impl AtomExt for Atom {
         }
     }
 
-    // TODO: This is worth making into a public/supported part of [`sword`]'s API.
+    // TODO: This is worth making into a public/supported part of [`nockvm`]'s API.
     fn from_value<A: NounAllocator, T: ToBytes>(allocator: &mut A, value: T) -> Result<Atom> {
         unsafe {
             let data: Bytes = value.as_bytes()?;

+ 0 - 0
crates/nockapp/crown/src/noun/mod.rs → crates/nockapp/src/noun/mod.rs


+ 2 - 2
crates/nockapp/crown/src/noun/ops.rs → crates/nockapp/src/noun/ops.rs

@@ -1,7 +1,7 @@
 use crate::utils::Result;
 use crate::CrownError;
-use sword::interpreter::{interpret, Context};
-use sword::noun::{Noun, D, T};
+use nockvm::interpreter::{interpret, Context};
+use nockvm::noun::{Noun, D, T};
 use tracing::{span, Level};
 
 /// Slams (applies) a gate at a specific axis of the supplied kernel.

+ 15 - 15
crates/nockapp/crown/src/noun/slab.rs → crates/nockapp/src/noun/slab.rs

@@ -5,13 +5,13 @@ use bitvec::{bits, bitvec};
 use bytes::Bytes;
 use either::Either;
 use intmap::IntMap;
+use nockvm::mem::NockStack;
+use nockvm::mug::{calc_atom_mug_u32, calc_cell_mug_u32, get_mug, set_mug};
+use nockvm::noun::{Atom, Cell, CellMemory, DirectAtom, IndirectAtom, Noun, NounAllocator, D};
+use nockvm::serialization::{met0_u64_to_usize, met0_usize};
 use std::alloc::Layout;
 use std::mem::size_of;
 use std::ptr::copy_nonoverlapping;
-use sword::mem::NockStack;
-use sword::mug::{calc_atom_mug_u32, calc_cell_mug_u32, get_mug, set_mug};
-use sword::noun::{Atom, Cell, CellMemory, DirectAtom, IndirectAtom, Noun, NounAllocator, D};
-use sword::serialization::{met0_u64_to_usize, met0_usize};
 use thiserror::Error;
 
 const CELL_MEM_WORD_SIZE: usize = (size_of::<CellMemory>() + 7) >> 3;
@@ -54,7 +54,7 @@ impl NounSlab {
 
     pub fn modify<F: FnOnce(Noun) -> Vec<Noun>>(&mut self, f: F) {
         let new_root_base = f(self.root);
-        let new_root = sword::noun::T(self, &new_root_base);
+        let new_root = nockvm::noun::T(self, &new_root_base);
         self.set_root(new_root);
     }
 
@@ -72,7 +72,7 @@ impl NounSlab {
         self.copy_into(imports.1);
         self.copy_into(imports.2);
         let new_root_base = f(imports, self.root);
-        let new_root = sword::noun::T(self, &new_root_base);
+        let new_root = nockvm::noun::T(self, &new_root_base);
         self.set_root(new_root);
     }
 }
@@ -201,7 +201,7 @@ impl From<Noun> for NounSlab {
 impl<const N: usize> From<[Noun; N]> for NounSlab {
     fn from(nouns: [Noun; N]) -> Self {
         let mut slab = Self::new();
-        let new_root = sword::noun::T(&mut slab, &nouns);
+        let new_root = nockvm::noun::T(&mut slab, &nouns);
         slab.set_root(new_root);
         slab
     }
@@ -739,8 +739,8 @@ mod tests {
     use super::*;
     use crate::AtomExt;
     use bitvec::prelude::*;
-    use sword::noun::{D, T};
-    use sword_macros::tas;
+    use nockvm::noun::{D, T};
+    use nockvm_macros::tas;
 
     #[test]
     #[cfg_attr(miri, ignore)]
@@ -755,16 +755,16 @@ mod tests {
         println!("jammed: {:?}", jammed);
 
         let mut stack = NockStack::new(1000, 0);
-        let mut sword_jammed: Vec<u8> = sword::serialization::jam(&mut stack, test_noun)
+        let mut nockvm_jammed: Vec<u8> = nockvm::serialization::jam(&mut stack, test_noun)
             .as_ne_bytes()
             .to_vec();
-        let sword_suffix: Vec<u8> = sword_jammed.split_off(jammed.len());
-        println!("sword_jammed: {:?}", sword_jammed);
+        let nockvm_suffix: Vec<u8> = nockvm_jammed.split_off(jammed.len());
+        println!("nockvm_jammed: {:?}", nockvm_jammed);
 
-        assert_eq!(jammed, sword_jammed, "Jammed results should be identical");
+        assert_eq!(jammed, nockvm_jammed, "Jammed results should be identical");
         assert!(
-            sword_suffix.iter().all(|b| { *b == 0 }),
-            "Extra bytes in sword jam should all be 0"
+            nockvm_suffix.iter().all(|b| { *b == 0 }),
+            "Extra bytes in nockvm jam should all be 0"
         );
     }
 

+ 4 - 4
crates/nockapp/crown/src/observability.rs → crates/nockapp/src/observability.rs

@@ -12,7 +12,7 @@ pub fn init_tracing() -> Result<impl tracing::Subscriber, opentelemetry::trace::
     eprintln!("Datadog APM endpoint (OTLP gRPC): {}", endpoint);
 
     // Service information
-    let service_name = std::env::var("DD_SERVICE").unwrap_or("crown".to_owned());
+    let service_name = std::env::var("DD_SERVICE").unwrap_or("nockapp".to_owned());
     let service_version = std::env::var("DD_VERSION").unwrap_or("0.1.0".to_owned());
     let environment = std::env::var("DD_ENV").unwrap_or("development".to_owned());
 
@@ -150,7 +150,7 @@ pub fn init_tracing() -> Result<impl tracing::Subscriber, opentelemetry::trace::
 //         .with_thread_ids(true)
 //         .with_line_number(true);
 
-//     let tracer = provider.tracer("crown");
+//     let tracer = provider.tracer("nockapp");
 //     let telemetry = tracing_opentelemetry::layer()
 //         .with_tracer(tracer)
 //         // This ensures log level gets propagated to span attributes
@@ -245,7 +245,7 @@ pub fn init_tracing() -> Result<impl tracing::Subscriber, opentelemetry::trace::
 //         .with_thread_ids(true)
 //         .with_line_number(true);
 
-//     let tracer = provider.tracer("crown");
+//     let tracer = provider.tracer("nockapp");
 //     let telemetry = tracing_opentelemetry::layer()
 //         .with_tracer(tracer)
 //         // This ensures log level gets propagated to span attributes
@@ -275,7 +275,7 @@ pub fn init_tracing() -> Result<impl tracing::Subscriber, opentelemetry::trace::
 //         .with_batch_exporter(otlp_exporter, opentelemetry_sdk::runtime::Tokio)
 //         .build();
 
-//     let tracer = provider.tracer("crown");
+//     let tracer = provider.tracer("nockapp");
 //     let telemetry = tracing_opentelemetry::layer().with_tracer(tracer);
 //     let fmt_layer = tracing_subscriber::fmt::layer()
 //         .with_target(true)

+ 7 - 7
crates/nockapp/crown/src/utils/bytes.rs → crates/nockapp/src/utils/bytes.rs

@@ -2,9 +2,9 @@ use crate::utils::error::ConversionError;
 use crate::{Noun, Result};
 use bytes::Bytes;
 use ibig::UBig;
+use nockvm::jets::cold::{Nounable, NounableResult};
+use nockvm::noun::{Atom, NounAllocator, Slots, D, T};
 use std::any;
-use sword::jets::cold::{Nounable, NounableResult};
-use sword::noun::{Atom, NounAllocator, Slots, D, T};
 
 pub trait ToBytes {
     fn to_bytes(&self) -> Result<Vec<u8>>;
@@ -169,11 +169,11 @@ impl Nounable for Byts {
 #[cfg(test)]
 mod test {
     use ibig::ubig;
-    use sword::interpreter::Context;
-    use sword::jets;
-    use sword::jets::cold::{FromNounError, Nounable};
-    use sword::jets::util::test::{assert_noun_eq, A};
-    use sword::noun::{D, T};
+    use nockvm::interpreter::Context;
+    use nockvm::jets;
+    use nockvm::jets::cold::{FromNounError, Nounable};
+    use nockvm::jets::util::test::{assert_noun_eq, A};
+    use nockvm::noun::{D, T};
 
     use crate::utils::bytes::Byts;
 

+ 12 - 12
crates/nockapp/crown/src/utils/error.rs → crates/nockapp/src/utils/error.rs

@@ -26,7 +26,7 @@ pub enum CrownError<T = ExternalError> {
     #[error("{0}")]
     InterpreterError(#[from] SwordError),
     #[error("kernel error")]
-    KernelError(Option<sword::noun::Noun>),
+    KernelError(Option<nockvm::noun::Noun>),
     #[error("{0}")]
     Utf8FromError(#[from] std::string::FromUtf8Error),
     #[error("{0}")]
@@ -81,7 +81,7 @@ pub enum CrownError<T = ExternalError> {
 pub struct QueueErrorWrapper(pub yaque::TrySendError<Vec<u8>>);
 
 #[derive(Debug, Error)]
-pub struct SwordError(pub sword::interpreter::Error);
+pub struct SwordError(pub nockvm::interpreter::Error);
 
 impl std::fmt::Display for SwordError {
     fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
@@ -89,15 +89,15 @@ impl std::fmt::Display for SwordError {
     }
 }
 
-impl From<sword::interpreter::Error> for CrownError {
-    fn from(e: sword::interpreter::Error) -> Self {
+impl From<nockvm::interpreter::Error> for CrownError {
+    fn from(e: nockvm::interpreter::Error) -> Self {
         CrownError::InterpreterError(SwordError(e))
     }
 }
 
-impl From<sword::jets::JetErr> for CrownError {
-    fn from(e: sword::jets::JetErr) -> Self {
-        CrownError::InterpreterError(SwordError(sword::interpreter::Error::from(e)))
+impl From<nockvm::jets::JetErr> for CrownError {
+    fn from(e: nockvm::jets::JetErr) -> Self {
+        CrownError::InterpreterError(SwordError(nockvm::interpreter::Error::from(e)))
     }
 }
 
@@ -126,7 +126,7 @@ pub enum ConversionError {
 }
 
 #[derive(Debug, Error)]
-pub struct NounError(pub sword::noun::Error);
+pub struct NounError(pub nockvm::noun::Error);
 
 impl std::fmt::Display for NounError {
     fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
@@ -134,14 +134,14 @@ impl std::fmt::Display for NounError {
     }
 }
 
-impl From<sword::noun::Error> for CrownError {
-    fn from(e: sword::noun::Error) -> Self {
+impl From<nockvm::noun::Error> for CrownError {
+    fn from(e: nockvm::noun::Error) -> Self {
         CrownError::Noun(NounError(e))
     }
 }
 
 impl<T, E: Into<CrownError>> IntoCrownError<T> for core::result::Result<T, E> {
-    fn crown(self) -> core::result::Result<T, CrownError> {
+    fn nockapp(self) -> core::result::Result<T, CrownError> {
         match self {
             Ok(val) => Ok(val),
             Err(e) => Err(e.into()),
@@ -150,7 +150,7 @@ impl<T, E: Into<CrownError>> IntoCrownError<T> for core::result::Result<T, E> {
 }
 
 pub trait IntoCrownError<T> {
-    fn crown(self) -> core::result::Result<T, CrownError>;
+    fn nockapp(self) -> core::result::Result<T, CrownError>;
 }
 
 pub type Result<V, E = CrownError<ExternalError>> = std::result::Result<V, E>;

+ 9 - 9
crates/nockapp/crown/src/utils/mod.rs → crates/nockapp/src/utils/mod.rs

@@ -7,19 +7,19 @@ use byteorder::{LittleEndian, ReadBytesExt};
 pub use bytes::ToBytes;
 use either::Either;
 pub use error::{CrownError, Result};
+use nockvm::hamt::Hamt;
+use nockvm::interpreter::{self, Context};
+use nockvm::jets::cold::Cold;
+use nockvm::jets::hot::{Hot, HotEntry};
+use nockvm::jets::warm::Warm;
+use nockvm::mem::NockStack;
+use nockvm::noun::{Atom, IndirectAtom, Noun, NounAllocator, D};
+use nockvm::serialization::jam;
+use nockvm::trace::TraceInfo;
 use slogger::CrownSlogger;
 use std::ptr::copy_nonoverlapping;
 use std::slice::from_raw_parts_mut;
 use std::time::{SystemTime, UNIX_EPOCH};
-use sword::hamt::Hamt;
-use sword::interpreter::{self, Context};
-use sword::jets::cold::Cold;
-use sword::jets::hot::{Hot, HotEntry};
-use sword::jets::warm::Warm;
-use sword::mem::NockStack;
-use sword::noun::{Atom, IndirectAtom, Noun, NounAllocator, D};
-use sword::serialization::jam;
-use sword::trace::TraceInfo;
 
 // urbit @da timestamp
 pub struct DA(pub u128);

+ 1 - 1
crates/nockapp/crown/src/utils/scry.rs → crates/nockapp/src/utils/scry.rs

@@ -1,5 +1,5 @@
 use either::{Left, Right};
-use sword::noun::Noun;
+use nockvm::noun::Noun;
 
 pub enum ScryResult {
     BadPath,    // ~

+ 5 - 5
crates/nockapp/crown/src/utils/slogger.rs → crates/nockapp/src/utils/slogger.rs

@@ -1,12 +1,12 @@
 use crate::{CrownError, Result};
 use assert_no_alloc::permit_alloc;
 use either::Either::*;
+use nockvm::interpreter::Slogger;
+use nockvm::jets::list::util::lent;
+use nockvm::mem::NockStack;
+use nockvm::noun::{Atom, DirectAtom, IndirectAtom, Noun, Slots};
+use nockvm_macros::tas;
 use std::io::{stderr, Write};
-use sword::interpreter::Slogger;
-use sword::jets::list::util::lent;
-use sword::mem::NockStack;
-use sword::noun::{Atom, DirectAtom, IndirectAtom, Noun, Slots};
-use sword_macros::tas;
 use tracing::{debug, error, info, trace, warn};
 
 pub struct CrownSlogger;

+ 0 - 0
crates/nockapp/crown/test-jams/cue-test.jam → crates/nockapp/test-jams/cue-test.jam


+ 0 - 0
crates/nockapp/crown/test-jams/test-ker.jam → crates/nockapp/test-jams/test-ker.jam


+ 7 - 7
crates/nockapp/crown/tests/integration.rs → crates/nockapp/tests/integration.rs

@@ -1,12 +1,12 @@
 use tracing::info;
 
-use crown::nockapp::test::setup_nockapp;
-use crown::nockapp::wire::{SystemWire, Wire};
-use crown::noun::slab::NounSlab;
-use crown::NockApp;
+use nockapp::noun::slab::NounSlab;
+use nockapp::test::setup_nockapp;
+use nockapp::wire::{SystemWire, Wire};
+use nockapp::NockApp;
 
-use sword::noun::{Noun, Slots, D};
-use sword_macros::tas;
+use nockvm::noun::{Noun, Slots, D};
+use nockvm_macros::tas;
 
 #[tracing::instrument(skip(nockapp))]
 fn run_once(nockapp: &mut NockApp, i: u64) {
@@ -57,7 +57,7 @@ fn run_once(nockapp: &mut NockApp, i: u64) {
 #[tokio::test(flavor = "multi_thread", worker_threads = 4)]
 #[ignore]
 async fn test_looped_sync_peek_and_poke() {
-    use crown::observability::*;
+    use nockapp::observability::*;
     let subscriber = init_tracing().unwrap_or_else(|err| {
         panic!(
             "Panicked with {err:?} at {}:{} (git sha: {:?})",

+ 3 - 3
crates/nockchain-bitcoin-sync/Cargo.toml

@@ -6,9 +6,9 @@ edition.workspace = true
 [dependencies]
 zkvm-jetpack.workspace = true
 
-crown = { workspace = true }
-sword = { workspace = true }
-sword_macros = { workspace = true }
+nockapp = { workspace = true }
+nockvm = { workspace = true }
+nockvm_macros = { workspace = true }
 
 bitcoincore-rpc.workspace = true
 ibig = { workspace = true }

+ 9 - 11
crates/nockchain-bitcoin-sync/src/lib.rs

@@ -5,14 +5,14 @@ use std::sync::Arc;
 use bitcoincore_rpc::bitcoin::BlockHash;
 use bitcoincore_rpc::bitcoincore_rpc_json::{BlockRef, GetBlockResult};
 use bitcoincore_rpc::{Auth, Client, RpcApi};
-use crown::nockapp::driver::{make_driver, IODriverFn};
-use crown::nockapp::wire::{SystemWire, Wire};
-use crown::noun::slab::NounSlab;
-use crown::{AtomExt, Bytes, ToBytes};
 use ibig::ops::DivRem;
 use ibig::{ubig, UBig};
-use sword::noun::{Atom, Noun, NounAllocator, D, T};
-use sword_macros::tas;
+use nockapp::driver::{make_driver, IODriverFn};
+use nockapp::noun::slab::NounSlab;
+use nockapp::wire::{SystemWire, Wire};
+use nockapp::{AtomExt, Bytes, ToBytes};
+use nockvm::noun::{Atom, Noun, NounAllocator, D, T};
+use nockvm_macros::tas;
 use tokio::sync::oneshot::channel;
 use tokio::sync::RwLock;
 use tracing::{debug, info, instrument};
@@ -23,7 +23,7 @@ const TEST_GENESIS_BLOCK_HASH: &str =
     "00000000e6c3c75c18bdb06cc39d616d636fca0fc967c29ebf8225ddf7f2fe48";
 const TEST_GENESIS_BLOCK_HEIGHT: u64 = 2048;
 
-const TEST_GENESIS_SEAL_MSG: &str = "8UZkpNdGKTPGafrbkGZHwUeeWMu7gLzpBsPuffVkDydnSB4NFRXwZsB";
+const GENESIS_SEAL_MSG: &str = "8K5RhhjnZQChv7cnhEiafkaxBReVhaySKEZatFEg7cagoK96kUo92sz";
 
 /// Helper function to get the test block used for fake genesis blocks
 fn get_test_block() -> BlockRef {
@@ -122,8 +122,7 @@ pub fn bitcoin_watcher_driver(
                     let mut poke_slab = NounSlab::new();
                     let block_height_noun =
                         Atom::new(&mut poke_slab, TEST_GENESIS_BLOCK_HEIGHT).as_noun();
-                    let seal_byts =
-                        Bytes::from(TEST_GENESIS_SEAL_MSG.to_bytes().expect("blah 242"));
+                    let seal_byts = Bytes::from(GENESIS_SEAL_MSG.to_bytes().expect("blah 242"));
                     let seal_noun = Atom::from_bytes(&mut poke_slab, &seal_byts).as_noun();
                     let set_genesis_seal_byts = Bytes::from(b"set-genesis-seal".to_vec());
                     let set_genesis_seal =
@@ -168,8 +167,7 @@ pub fn bitcoin_watcher_driver(
                     let mut poke_slab = NounSlab::new();
                     let block_height_noun =
                         Atom::new(&mut poke_slab, TEST_GENESIS_BLOCK_HEIGHT).as_noun();
-                    let seal_byts =
-                        Bytes::from(TEST_GENESIS_SEAL_MSG.to_bytes().expect("blah 242"));
+                    let seal_byts = Bytes::from(GENESIS_SEAL_MSG.to_bytes().expect("blah 242"));
                     let seal_noun = Atom::from_bytes(&mut poke_slab, &seal_byts).as_noun();
                     let set_genesis_seal_byts = Bytes::from(b"set-genesis-seal".to_vec());
                     let set_genesis_seal =

+ 3 - 3
crates/nockchain-libp2p-io/Cargo.toml

@@ -4,9 +4,9 @@ version.workspace = true
 edition.workspace = true
 
 [dependencies]
-crown = { workspace = true }
-sword = { workspace = true }
-sword_macros = { workspace = true }
+nockapp = { workspace = true }
+nockvm = { workspace = true }
+nockvm_macros = { workspace = true }
 
 bytes = { workspace = true }
 bs58 = { workspace = true }

+ 67 - 33
crates/nockchain-libp2p-io/src/nc.rs

@@ -4,29 +4,28 @@ use std::str::FromStr;
 use std::sync::Arc;
 
 use bytes::Bytes;
-use crown::nockapp::driver::{IODriverFn, NockAppHandle, PokeResult};
-use crown::nockapp::wire::{Wire, WireRepr};
-use crown::nockapp::NockAppError;
-use crown::noun::slab::NounSlab;
-use crown::utils::make_tas;
-use crown::utils::scry::*;
-use crown::{AtomExt, NounExt};
 use either::{Either, Left, Right};
 use futures::{Future, StreamExt};
-use libp2p::allow_block_list;
-use libp2p::connection_limits;
 use libp2p::identify::Event::Received;
 use libp2p::identity::Keypair;
 use libp2p::kad::NoKnownPeers;
-use libp2p::memory_connection_limits;
 use libp2p::request_response::Event::*;
 use libp2p::request_response::Message::*;
 use libp2p::request_response::{self};
 use libp2p::swarm::SwarmEvent;
-use libp2p::{Multiaddr, PeerId, Swarm};
+use libp2p::{
+    allow_block_list, connection_limits, memory_connection_limits, Multiaddr, PeerId, Swarm,
+};
+use nockapp::driver::{IODriverFn, NockAppHandle, PokeResult};
+use nockapp::noun::slab::NounSlab;
+use nockapp::utils::make_tas;
+use nockapp::utils::scry::*;
+use nockapp::wire::{Wire, WireRepr};
+use nockapp::NockAppError;
+use nockapp::{AtomExt, NounExt};
+use nockvm::noun::{Atom, Noun, D, T};
+use nockvm_macros::tas;
 use serde_bytes::ByteBuf;
-use sword::noun::{Atom, Noun, D, T};
-use sword_macros::tas;
 use tokio::sync::{mpsc, Mutex};
 use tokio::task::{AbortHandle, JoinError, JoinSet};
 use tracing::{debug, error, info, instrument, trace, warn};
@@ -47,6 +46,7 @@ impl Wire for NockchainWire {
     const SOURCE: &'static str = "nc";
 }
 
+#[derive(Debug)]
 pub enum Libp2pWire {
     Gossip(PeerId),
     Response(PeerId),
@@ -181,6 +181,8 @@ impl FromStr for MiningKeyConfig {
     }
 }
 
+const POKE_VERSION: u64 = 0;
+
 #[instrument(skip(keypair, bind, allowed, limits, memory_limits, equix_builder))]
 pub fn make_libp2p_driver(
     keypair: Keypair,
@@ -257,7 +259,7 @@ pub fn make_libp2p_driver(
                                 identify_received(&mut swarm, peer_id, info)?;
                             },
                             SwarmEvent::ConnectionEstablished { peer_id, endpoint, .. } => {
-                                info!("SEvent: {peer_id} is new friend via: {endpoint:?}");
+                                debug!("SEvent: {peer_id} is new friend via: {endpoint:?}");
                             },
                             SwarmEvent::ConnectionClosed { peer_id, endpoint, cause, .. } => {
                                 info!("SEvent: friendship ended with {peer_id} via: {endpoint:?}. cause: {cause:?}");
@@ -475,6 +477,7 @@ async fn set_mining_key(
         .expect("Failed to create set-mining-key atom");
     let pubkey_cord =
         Atom::from_value(&mut set_mining_key_slab, pubkey).expect("Failed to create pubkey atom");
+
     let set_mining_key_poke = T(
         &mut set_mining_key_slab,
         &[D(tas!(b"command")), set_mining_key.as_noun(), pubkey_cord.as_noun()],
@@ -530,6 +533,7 @@ async fn enable_mining(handle: &NockAppHandle, enable: bool) -> Result<PokeResul
     let mut enable_mining_slab = NounSlab::new();
     let enable_mining = Atom::from_value(&mut enable_mining_slab, "enable-mining")
         .expect("Failed to create enable-mining atom");
+
     let enable_mining_poke = T(
         &mut enable_mining_slab,
         &[D(tas!(b"command")), enable_mining.as_noun(), D(if enable { 0 } else { 1 })],
@@ -549,14 +553,19 @@ async fn handle_effect(
 ) -> Result<(), NockAppError> {
     match EffectType::from_noun_slab(&noun_slab) {
         EffectType::Gossip => {
-            // remove the %gossip head
+            // Get the tail of the gossip effect (after %gossip head)
             let mut tail_slab = NounSlab::new();
-            tail_slab.copy_into(unsafe { noun_slab.root().as_cell()?.tail() });
+            let gossip_cell = unsafe { noun_slab.root().as_cell()?.tail() };
+
+            // Skip version number
+            // TODO: add version negotiation, reject unknown/incompatible versions
+            let data_cell = gossip_cell.as_cell()?.tail();
+            tail_slab.copy_into(data_cell);
 
             // Check if this is a heard-block gossip
             let gossip_noun = unsafe { tail_slab.root() };
-            if let Ok(cell) = gossip_noun.as_cell() {
-                if cell.head().eq_bytes(b"heard-block") {
+            if let Ok(data_cell) = gossip_noun.as_cell() {
+                if data_cell.head().eq_bytes(b"heard-block") {
                     trace!("Gossip effect for heard-block, clearing block cache");
                     let mut tracker = message_tracker.lock().await;
                     tracker.block_cache.clear();
@@ -939,10 +948,19 @@ async fn handle_request_response(
                             }
                         }
 
-                        let request_fact = prepend_tas(&mut request_slab, "fact", request_noun)?;
+                        let request_fact = prepend_tas(
+                            &mut request_slab,
+                            "fact",
+                            vec![D(POKE_VERSION), request_noun],
+                        )?;
                         request_slab.set_root(request_fact);
                         let wire = Libp2pWire::Gossip(peer);
 
+                        trace!(
+                            "Poking kernel with wire: {:?} noun: {:?}",
+                            wire,
+                            nockvm::noun::FullDebugCell(unsafe { &request_slab.root().as_cell()? })
+                        );
                         match nockapp.try_poke(wire.to_wire(), request_slab).await {
                             Ok(PokeResult::Ack) => {
                                 metrics.gossip_acked.increment();
@@ -981,7 +999,15 @@ async fn handle_request_response(
                 let response_noun = response_slab.cue_into(message_bytes)?;
                 trace!("Received response from peer");
 
-                let response_fact = prepend_tas(&mut response_slab, "fact", response_noun)?;
+                trace!(
+                    "Response noun: {:?}",
+                    nockvm::noun::FullDebugCell(&response_noun.as_cell()?)
+                );
+                let response_fact = prepend_tas(
+                    &mut response_slab,
+                    "fact",
+                    vec![D(POKE_VERSION), response_noun],
+                )?;
                 response_slab.set_root(response_fact);
                 let wire = Libp2pWire::Response(peer);
 
@@ -1078,9 +1104,9 @@ fn request_to_scry_slab(noun: &Noun) -> Result<NounSlab, NockAppError> {
                 &[D(tas!(b"heavy-n")), tail_cell.tail(), D(0)],
             );
             scry_path_slab.set_root(pax);
-            info!(
+            trace!(
                 "block by-height: {:?}",
-                sword::noun::DebugPath(&pax.as_cell()?)
+                nockvm::noun::DebugPath(&pax.as_cell()?)
             );
             return Ok(scry_path_slab);
         } else if tail_cell.head().eq_bytes(b"elders") {
@@ -1107,9 +1133,9 @@ fn request_to_scry_slab(noun: &Noun) -> Result<NounSlab, NockAppError> {
                 &mut scry_path_slab,
                 &[D(tas!(b"elders")), block_id_atom.as_noun(), peer_id, D(0)],
             );
-            info!(
+            debug!(
                 "block elders: {:?}",
-                sword::noun::DebugPath(&pax.as_cell()?)
+                nockvm::noun::DebugPath(&pax.as_cell()?)
             );
             scry_path_slab.set_root(pax);
             return Ok(scry_path_slab);
@@ -1138,7 +1164,7 @@ fn request_to_scry_slab(noun: &Noun) -> Result<NounSlab, NockAppError> {
                 &mut scry_path_slab,
                 &[raw_tx_tag, tx_id_atom.as_noun(), D(0)],
             );
-            info!("tx by-id: {:?}", sword::noun::DebugPath(&pax.as_cell()?));
+            debug!("tx by-id: {:?}", nockvm::noun::DebugPath(&pax.as_cell()?));
             scry_path_slab.set_root(pax);
             return Ok(scry_path_slab);
         }
@@ -1178,7 +1204,8 @@ fn create_scry_response(
             Left(())
         }
         ScryResult::Some(x) => {
-            if let Ok(response_noun) = prepend_tas(res_slab, heard_type, x) {
+            let nouns = vec![x];
+            if let Ok(response_noun) = prepend_tas(res_slab, heard_type, nouns) {
                 res_slab.set_root(response_noun);
                 Right(Ok(NockchainResponse::new_response_result(res_slab.jam())))
             } else {
@@ -1193,24 +1220,31 @@ fn create_scry_response(
     }
 }
 
-/// Prepends a @tas to a Noun.
+/// Prepends a @tas to one or more Nouns.
 ///
 /// # Arguments
 /// * `slab` - The NounSlab containing the noun
-/// * `noun` - The Noun to prepend @tas to
+/// * `tas_str` - The tag string to prepend
+/// * `nouns` - The Nouns to include
 ///
 /// # Returns
 /// The noun with @tas prepended
-fn prepend_tas(slab: &mut NounSlab, tas_str: &str, noun: Noun) -> Result<Noun, NockAppError> {
+fn prepend_tas(slab: &mut NounSlab, tas_str: &str, nouns: Vec<Noun>) -> Result<Noun, NockAppError> {
     let tas_atom = Atom::from_value(slab, tas_str)?;
-    Ok(T(slab, &[tas_atom.as_noun(), noun]))
+
+    // Create a cell with the tag and all provided nouns
+    let mut cell_elements = Vec::with_capacity(nouns.len() + 1);
+    cell_elements.push(tas_atom.as_noun());
+    cell_elements.extend(nouns);
+
+    Ok(T(slab, &cell_elements))
 }
 
 #[cfg(test)]
 mod tests {
-    use crown::noun::slab::NounSlab;
-    use sword::noun::{D, T};
-    use sword_macros::tas;
+    use nockapp::noun::slab::NounSlab;
+    use nockvm::noun::{D, T};
+    use nockvm_macros::tas;
 
     use super::*;
 

+ 1 - 1
crates/nockchain-libp2p-io/src/p2p.rs

@@ -2,7 +2,6 @@ use std::convert::Infallible;
 use std::error::Error;
 use std::time::Duration;
 
-use crown::nockapp::NockAppError;
 use hickory_resolver::config::{ResolverConfig, ResolverOpts};
 use libp2p::identity::Keypair;
 use libp2p::multiaddr::Multiaddr;
@@ -13,6 +12,7 @@ use libp2p::{
     allow_block_list, connection_limits, identify, kad, memory_connection_limits, ping, PeerId,
     Swarm,
 };
+use nockapp::NockAppError;
 use tracing::{debug, trace};
 
 use crate::nc::*;

+ 8 - 8
crates/nockchain-libp2p-io/src/p2p_util.rs

@@ -1,12 +1,12 @@
 use std::collections::{BTreeMap, BTreeSet};
 use std::str::FromStr;
 
-use crown::nockapp::NockAppError;
-use crown::noun::slab::NounSlab;
-use crown::{AtomExt, NounExt};
 use libp2p::PeerId;
-use sword::noun::Noun;
-use sword_macros::tas;
+use nockapp::noun::slab::NounSlab;
+use nockapp::NockAppError;
+use nockapp::{AtomExt, NounExt};
+use nockvm::noun::Noun;
+use nockvm_macros::tas;
 use tracing::debug;
 
 use crate::metrics::NockchainP2PMetrics;
@@ -245,8 +245,8 @@ impl MessageTracker {
 
 #[cfg(test)]
 mod tests {
-    use crown::noun::slab::NounSlab;
-    use sword::noun::{D, T};
+    use nockapp::noun::slab::NounSlab;
+    use nockvm::noun::{D, T};
 
     use super::*;
 
@@ -342,7 +342,7 @@ mod tests {
 
     #[test]
     fn test_peer_id_base58_roundtrip() {
-        use sword::noun::Atom;
+        use nockvm::noun::Atom;
         // Generate a random PeerId
         let original_peer_id = PeerId::random();
         let base58_str = original_peer_id.to_base58();

+ 5 - 5
crates/nockchain-libp2p-io/src/tip5_util.rs

@@ -1,7 +1,7 @@
 use bs58;
-use crown::nockapp::NockAppError;
 use ibig::{ubig, UBig};
-use sword::noun::Noun;
+use nockapp::NockAppError;
+use nockvm::noun::Noun;
 //TODO all this stuff would be useful as jets, which mostly just requires
 //using the Atom::as_ubig with the NockStack instead of ibig's heap version
 // which we use to avoid having a NockStack sitting around.
@@ -70,15 +70,15 @@ pub fn extract_5_tuple(tuple_cell: Noun) -> Result<Vec<Noun>, NockAppError> {
 
 #[cfg(test)]
 mod tests {
-    use crown::noun::slab::NounSlab;
-    use sword::noun::{D, T};
+    use nockapp::noun::slab::NounSlab;
+    use nockvm::noun::{D, T};
 
     use super::*;
 
     #[test]
     #[cfg_attr(miri, ignore)] // ibig has a memory leak so miri fails this test
     fn test_tip5_hash_to_base58() {
-        use sword::noun::Atom;
+        use nockvm::noun::Atom;
         // Create a NounSlab to use as an allocator
         let mut slab = NounSlab::new();
 

+ 4 - 4
crates/wallet/Cargo.toml → crates/nockchain-wallet/Cargo.toml

@@ -1,13 +1,13 @@
 [package]
-name = "wallet"
+name = "nockchain-wallet"
 version.workspace = true
 edition.workspace = true
 
 [dependencies]
-crown = { workspace = true }
 kernels = { workspace = true, features = ["wallet"] }
-sword = { workspace = true }
-sword_macros = { workspace = true }
+nockapp = { workspace = true }
+nockvm = { workspace = true }
+nockvm_macros = { workspace = true }
 
 bardecoder = { workspace = true }
 clap = { workspace = true, features = ["derive"] }

+ 13 - 16
crates/wallet/README.md → crates/nockchain-wallet/README.md

@@ -6,23 +6,23 @@
 
 ```bash
 # Generate a new key pair with random entropy
-wallet keygen
+nockchain-wallet keygen
 ```
 
 ### Import Private Key
 
 ```bash
 # Import keys from a jammed file
-wallet import-keys --input path/to/keys.jam
+nockchain-wallet import-keys --input path/to/keys.jam
 
 # Import a master public key and chain code
-wallet import-master-pubkey --key <base58-key> --knot <base58-chain-code>
+nockchain-wallet import-master-pubkey --key <base58-key> --knot <base58-chain-code>
 ```
 
 ### Generate Master Private Key from Seed Phrase
 
 ```bash
-wallet gen-master-privkey --seedphrase "your seed phrase here"
+nockchain-wallet gen-master-privkey --seedphrase "your seed phrase here"
 ```
 
 Creates a master private key deterministically from a BIP39-style seed phrase.
@@ -30,7 +30,7 @@ Creates a master private key deterministically from a BIP39-style seed phrase.
 ### Generate Master Public Key from Private Key
 
 ```bash
-wallet gen-master-pubkey --master-privkey <private-key>
+nockchain-wallet gen-master-pubkey --master-privkey <private-key>
 ```
 
 Derives the master public key from a master private key.
@@ -38,7 +38,7 @@ Derives the master public key from a master private key.
 ### Derive Child Key
 
 ```bash
-wallet derive-child --key-type <pub|priv> --index <0-255>
+nockchain-wallet derive-child --key-type <pub|priv> --index <0-255>
 ```
 
 Derives a child public or private key at the given index from the current master key.
@@ -50,13 +50,10 @@ The wallet needs to connect to a running nockchain instance to perform operation
 
 ```bash
 # Connect to nockchain using a Unix domain socket
-wallet --nockchain-socket ./test-leader/nockchain.sock <command>
-
-# Example: checking balance while connected to nockchain
-wallet --nockchain-socket ./test-leader/nockchain.sock balance
+nockchain-wallet --nockchain-socket ./test-leader/nockchain.sock <command>
 
 # Example: broadcasting a transaction
-wallet --nockchain-socket ./test-leader/nockchain.sock make-tx --draft my_draft
+nockchain-wallet --nockchain-socket ./test-leader/nockchain.sock make-tx --draft my_draft
 ```
 
 Note: Make sure nockchain is running and the socket path matches your nockchain configuration.
@@ -67,7 +64,7 @@ Note: Make sure nockchain is running and the socket path matches your nockchain
 ### List All Notes
 
 ```bash
-wallet list-notes
+nockchain-wallet list-notes
 ```
 
 Displays all notes (UTXOs) currently managed by the wallet, sorted by assets.
@@ -75,7 +72,7 @@ Displays all notes (UTXOs) currently managed by the wallet, sorted by assets.
 ### List Notes by Public Key
 
 ```bash
-wallet list-notes-by-pubkey --pubkey <public-key>
+nockchain-wallet list-notes-by-pubkey --pubkey <public-key>
 ```
 
 Shows only the notes associated with the specified public key. Useful for filtering wallet contents by address or for multisig scenarios.
@@ -99,7 +96,7 @@ A draft represents a transaction that is being prepared for submission to the ne
 
 ```bash
 # Create a draft using simple-spend
-wallet simple-spend \
+nockchain-wallet simple-spend \
   --names "[first1 last1],[first2 last2]" \
   --recipients "[1 pk1],[2 pk2,pk3]" \
   --gifts "100,200" \
@@ -110,10 +107,10 @@ wallet simple-spend \
 
 ```bash
 # Sign the transaction
-wallet sign-tx --draft path/to/draft.draft
+nockchain-wallet sign-tx --draft path/to/draft.draft
 
 # Make and broadcast the signed transaction
-wallet make-tx --draft path/to/draft.draft
+nockchain-wallet make-tx --draft path/to/draft.draft
 ```
 
 Note: The draft file will be saved in `./drafts/` directory with a `.draft` extension.

+ 3 - 3
crates/wallet/src/error.rs → crates/nockchain-wallet/src/error.rs

@@ -1,6 +1,6 @@
 use std::{fmt, io};
 
-use crown::nockapp::NockAppError;
+use nockapp::NockAppError;
 
 #[derive(Debug)]
 pub enum WalletError {
@@ -55,8 +55,8 @@ impl From<WalletError> for NockAppError {
     }
 }
 
-impl From<crown::CrownError> for WalletError {
-    fn from(err: crown::CrownError) -> Self {
+impl From<nockapp::CrownError> for WalletError {
+    fn from(err: nockapp::CrownError) -> Self {
         WalletError::Parse(err.to_string())
     }
 }

+ 68 - 67
crates/wallet/src/main.rs → crates/nockchain-wallet/src/main.rs

@@ -4,25 +4,25 @@ use std::fs;
 use std::path::PathBuf;
 
 use clap::{Parser, Subcommand};
-use crown::utils::bytes::Byts;
 use getrandom::getrandom;
-use sword::jets::cold::Nounable;
-use sword::noun::{Atom, Cell, IndirectAtom, Noun, D, SIG, T};
+use nockapp::utils::bytes::Byts;
+use nockapp::{system_data_dir, CrownError, NockApp, NockAppError, ToBytesExt};
+use nockvm::jets::cold::Nounable;
+use nockvm::noun::{Atom, Cell, IndirectAtom, Noun, D, SIG, T};
+use tokio::fs as tokio_fs;
 use tokio::net::UnixStream;
 use tracing::{error, info};
 use zkvm_jetpack::hot::produce_prover_hot_state;
 
 mod error;
 
-use crown::kernel::boot::{self, Cli as BootCli};
-use crown::nockapp::driver::*;
-use crown::nockapp::wire::{Wire, WireRepr};
-use crown::nockapp::{NockApp, NockAppError};
-use crown::noun::slab::NounSlab;
-use crown::noun::IntoNoun;
-use crown::utils::make_tas;
-use crown::{exit_driver, file_driver, markdown_driver, one_punch_driver, CrownError, ToBytesExt};
 use kernels::wallet::KERNEL;
+use nockapp::driver::*;
+use nockapp::kernel::boot::{self, Cli as BootCli};
+use nockapp::noun::slab::NounSlab;
+use nockapp::utils::make_tas;
+use nockapp::wire::{Wire, WireRepr};
+use nockapp::{exit_driver, file_driver, markdown_driver, one_punch_driver};
 
 #[derive(Parser, Debug, Clone)]
 #[command(author, version, about, long_about = None)]
@@ -69,9 +69,6 @@ type CommandNoun<T> = Result<(T, Operation), NockAppError>;
 
 #[derive(Subcommand, Debug, Clone)]
 pub enum Commands {
-    /// Display the current wallet balance
-    Balance,
-
     /// Generate a new key pair
     Keygen,
 
@@ -104,13 +101,6 @@ pub enum Commands {
         index: Option<u64>,
     },
 
-    /// Show the balance of a specific address at a given block
-    ShowBalance {
-        /// Block to show balance at
-        #[arg(short, long)]
-        block: String,
-    },
-
     /// Generate a master private key from a seed phrase
     GenMasterPrivkey {
         /// Seed phrase to generate master private key
@@ -189,17 +179,24 @@ pub enum Commands {
 
     /// Lists all public keys in the wallet
     ListPubkeys,
+
+    /// Show the seed phrase for the current master key
+    ShowSeedphrase,
+
+    /// Show the master public key
+    ShowMasterPubkey,
+
+    /// Show the master private key
+    ShowMasterPrivkey,
 }
 
 impl Commands {
     fn as_wire_tag(&self) -> &'static str {
         match self {
-            Commands::Balance => "balance",
             Commands::Keygen => "keygen",
             Commands::DeriveChild { .. } => "derive-child",
             Commands::ImportKeys { .. } => "import-keys",
             Commands::SignTx { .. } => "sign-tx",
-            Commands::ShowBalance { .. } => "show-balance",
             Commands::GenMasterPrivkey { .. } => "gen-master-privkey",
             Commands::GenMasterPubkey { .. } => "gen-master-pubkey",
             Commands::Scan { .. } => "scan",
@@ -210,6 +207,9 @@ impl Commands {
             Commands::UpdateBalance => "update-balance",
             Commands::ImportMasterPubkey { .. } => "import-master-pubkey",
             Commands::ListPubkeys => "list-pubkeys",
+            Commands::ShowSeedphrase => "show-seedphrase",
+            Commands::ShowMasterPubkey => "show-master-pubkey",
+            Commands::ShowMasterPrivkey => "show-master-privkey",
         }
     }
 }
@@ -307,11 +307,6 @@ impl Wallet {
         Ok((slab.clone(), operation))
     }
 
-    /// Retrieves the wallet balance.
-    fn wallet_balance() -> CommandNoun<NounSlab> {
-        Self::wallet("balance", &[], Operation::Peek, &mut NounSlab::new())
-    }
-
     /// Generates a new key pair.
     ///
     /// # Arguments
@@ -389,17 +384,6 @@ impl Wallet {
         )
     }
 
-    /// Shows the balance of a specific address at a given block.
-    ///
-    /// # Arguments
-    ///
-    /// * `block` - The block hash or height to show the balance at.
-    fn balance_at_block(block: &str) -> CommandNoun<NounSlab> {
-        let mut slab = NounSlab::new();
-        let block_noun = IntoNoun::into_noun(block);
-        Self::wallet("show-balance", &[block_noun], Operation::Poke, &mut slab)
-    }
-
     /// Generates a master private key from a seed phrase.
     ///
     /// # Arguments
@@ -707,6 +691,36 @@ impl Wallet {
             &mut slab,
         )
     }
+
+    /// Shows the seed phrase for the current master key.
+    fn show_seedphrase() -> CommandNoun<NounSlab> {
+        let mut slab = NounSlab::new();
+        Self::wallet("show-seedphrase", &[], Operation::Poke, &mut slab)
+    }
+
+    /// Shows the master public key.
+    fn show_master_pubkey() -> CommandNoun<NounSlab> {
+        let mut slab = NounSlab::new();
+        Self::wallet("show-master-pubkey", &[], Operation::Poke, &mut slab)
+    }
+
+    /// Shows the master private key.
+    fn show_master_privkey() -> CommandNoun<NounSlab> {
+        let mut slab = NounSlab::new();
+        Self::wallet("show-master-privkey", &[], Operation::Poke, &mut slab)
+    }
+}
+
+pub async fn wallet_data_dir() -> Result<PathBuf, NockAppError> {
+    let wallet_data_dir = system_data_dir().join("wallet");
+    if !wallet_data_dir.exists() {
+        tokio_fs::create_dir_all(&wallet_data_dir)
+            .await
+            .map_err(|e| {
+                CrownError::Unknown(format!("Failed to create wallet data directory: {}", e))
+            })?;
+    }
+    Ok(wallet_data_dir)
 }
 
 #[tokio::main]
@@ -715,13 +729,14 @@ async fn main() -> Result<(), NockAppError> {
     boot::init_default_tracing(&cli.boot.clone()); // Init tracing early
 
     let prover_hot_state = produce_prover_hot_state();
+    let data_dir = wallet_data_dir().await?;
 
     let kernel = boot::setup(
         KERNEL,
         Some(cli.boot.clone()),
         prover_hot_state.as_slice(),
         "wallet",
-        None,
+        Some(data_dir),
     )
     .await
     .map_err(|e| CrownError::Unknown(format!("Kernel setup failed: {}", e)))?;
@@ -740,6 +755,9 @@ async fn main() -> Result<(), NockAppError> {
         | Commands::GenMasterPubkey { .. }
         | Commands::ImportMasterPubkey { .. }
         | Commands::ListPubkeys
+        | Commands::ShowSeedphrase
+        | Commands::ShowMasterPubkey
+        | Commands::ShowMasterPrivkey
         | Commands::SimpleSpend { .. } => false,
 
         // All other commands DO need sync
@@ -756,7 +774,6 @@ async fn main() -> Result<(), NockAppError> {
 
     // Generate the command noun and operation
     let poke = match &cli.command {
-        Commands::Balance => Wallet::wallet_balance(),
         Commands::Keygen => {
             let mut entropy = [0u8; 32];
             let mut salt = [0u8; 16];
@@ -779,7 +796,6 @@ async fn main() -> Result<(), NockAppError> {
             Wallet::derive_child(key_type, *index)
         }
         Commands::SignTx { draft, index } => Wallet::sign_tx(draft, *index),
-        Commands::ShowBalance { block } => Wallet::balance_at_block(block),
         Commands::ImportKeys { input } => Wallet::import_keys(input),
         Commands::GenMasterPrivkey { seedphrase } => Wallet::gen_master_privkey(seedphrase),
         Commands::GenMasterPubkey { master_privkey } => Wallet::gen_master_pubkey(master_privkey),
@@ -809,6 +825,9 @@ async fn main() -> Result<(), NockAppError> {
         Commands::UpdateBalance => Wallet::update_balance(),
         Commands::ImportMasterPubkey { key, knot } => Wallet::import_master_pubkey(key, knot),
         Commands::ListPubkeys => Wallet::list_pubkeys(),
+        Commands::ShowSeedphrase => Wallet::show_seedphrase(),
+        Commands::ShowMasterPubkey => Wallet::show_master_pubkey(),
+        Commands::ShowMasterPrivkey => Wallet::show_master_privkey(),
     }?;
 
     // If this command requires sync and we have a socket, wrap it with sync-run
@@ -830,7 +849,7 @@ async fn main() -> Result<(), NockAppError> {
                     info!("Connected to nockchain NPC socket at {:?}", socket_path);
                     wallet
                         .app
-                        .add_io_driver(crown::npc_client_driver(stream))
+                        .add_io_driver(nockapp::npc_client_driver(stream))
                         .await;
                 }
                 Err(e) => {
@@ -870,9 +889,9 @@ pub fn from_bytes(stack: &mut NounSlab, bytes: &[u8]) -> Atom {
 mod tests {
     use std::sync::Once;
 
-    use crown::kernel::boot::{self, Cli as BootCli};
-    use crown::nockapp::wire::SystemWire;
-    use crown::{exit_driver, Bytes};
+    use nockapp::kernel::boot::{self, Cli as BootCli};
+    use nockapp::wire::SystemWire;
+    use nockapp::{exit_driver, Bytes};
     use tokio::sync::mpsc;
 
     use super::*;
@@ -915,10 +934,10 @@ mod tests {
 
         println!("keygen result: {:?}", keygen_result);
         assert!(
-            keygen_result.len() == 1,
-            "Expected keygen result to be a list of 1 noun slab"
+            keygen_result.len() == 2,
+            "Expected keygen result to be a list of 2 noun slabs - markdown and exit"
         );
-        let exit_cause = unsafe { keygen_result[0].root() };
+        let exit_cause = unsafe { keygen_result[1].root() };
         let code = exit_cause.as_cell()?.tail();
         assert!(unsafe { code.raw_equals(&D(0)) }, "Expected exit code 0");
 
@@ -1030,24 +1049,6 @@ mod tests {
         Ok(())
     }
 
-    #[tokio::test]
-    #[cfg_attr(miri, ignore)]
-    async fn test_show_balance() -> Result<(), NockAppError> {
-        init_tracing();
-        let cli = BootCli::parse_from(&[""]);
-        let nockapp = boot::setup(KERNEL, Some(cli.clone()), &[], "wallet", None)
-            .await
-            .map_err(|e| CrownError::Unknown(e.to_string()))?;
-        let mut wallet = Wallet::new(nockapp);
-        let block = "block123";
-        let (noun, op) = Wallet::balance_at_block(block)?;
-        let wire = WalletWire::Command(Commands::Balance {}).to_wire();
-        let balance_result = wallet.app.poke(wire, noun.clone()).await?;
-        println!("balance_result: {:?}", balance_result);
-        // Verify balance
-        Ok(())
-    }
-
     // Tests for Cold Side Commands
     #[tokio::test]
     #[cfg_attr(miri, ignore)]

+ 4 - 4
crates/nockchain/Cargo.toml

@@ -6,12 +6,12 @@ version.workspace = true
 edition.workspace = true
 
 [dependencies]
-choo.workspace = true
-crown.workspace = true
+hoonc.workspace = true
+nockapp.workspace = true
 kernels = { workspace = true, features = ["dumb"] }
 nockchain-bitcoin-sync.workspace = true
-sword.workspace = true
-sword_macros.workspace = true
+nockvm.workspace = true
+nockvm_macros.workspace = true
 
 bitcoincore-rpc.workspace = true
 bs58.workspace = true

+ 15 - 15
crates/nockchain/src/lib.rs

@@ -3,11 +3,11 @@ use std::fs;
 use std::path::Path;
 
 use clap::{arg, command, ArgAction, Parser};
-use crown::kernel::boot;
-use crown::nockapp::NockApp;
 use libp2p::identity::Keypair;
 use libp2p::multiaddr::Multiaddr;
 use libp2p::{allow_block_list, connection_limits, memory_connection_limits, PeerId};
+use nockapp::kernel::boot;
+use nockapp::NockApp;
 use nockchain_bitcoin_sync::{bitcoin_watcher_driver, BitcoinRPCConnection, GenesisNodeType};
 use nockchain_libp2p_io::p2p::{
     MAX_ESTABLISHED_CONNECTIONS, MAX_ESTABLISHED_CONNECTIONS_PER_PEER,
@@ -21,20 +21,20 @@ use std::path::PathBuf;
 
 use clap::value_parser;
 use colors::*;
-use crown::noun::slab::NounSlab;
+use nockapp::noun::slab::NounSlab;
 use nockchain_libp2p_io::nc::MiningKeyConfig;
-use sword::jets::hot::HotEntry;
-use sword::noun::{D, T};
-use sword_macros::tas;
+use nockvm::jets::hot::HotEntry;
+use nockvm::noun::{D, T};
+use nockvm_macros::tas;
 use tracing::{debug, info, instrument};
 
 /// Module for handling driver initialization signals
 pub mod driver_init {
-    use crown::nockapp::driver::{make_driver, IODriverFn, PokeResult};
-    use crown::nockapp::wire::{SystemWire, Wire};
-    use crown::noun::slab::NounSlab;
-    use sword::noun::{D, T};
-    use sword_macros::tas;
+    use nockapp::driver::{make_driver, IODriverFn, PokeResult};
+    use nockapp::noun::slab::NounSlab;
+    use nockapp::wire::{SystemWire, Wire};
+    use nockvm::noun::{D, T};
+    use nockvm_macros::tas;
     use tokio::sync::oneshot;
     use tracing::{debug, error, info};
 
@@ -167,7 +167,7 @@ const GENESIS_HEIGHT: u64 = 892723;
 #[command(name = "nockchain")]
 pub struct NockchainCli {
     #[command(flatten)]
-    pub crown_cli: crown::kernel::boot::Cli,
+    pub nockapp_cli: nockapp::kernel::boot::Cli,
     #[arg(
         long,
         help = "npc socket path",
@@ -358,7 +358,7 @@ pub async fn init_with_kernel(
 
     let mut nockapp = boot::setup(
         kernel_jam,
-        cli.as_ref().map(|c| c.crown_cli.clone()),
+        cli.as_ref().map(|c| c.nockapp_cli.clone()),
         hot_state,
         "nockchain",
         None,
@@ -573,7 +573,7 @@ pub async fn init_with_kernel(
     let listener = UnixListener::bind(socket_path)?;
 
     nockapp
-        .add_io_driver(crown::npc_listener_driver(listener))
+        .add_io_driver(nockapp::npc_listener_driver(listener))
         .await;
 
     // set up timer
@@ -584,7 +584,7 @@ pub async fn init_with_kernel(
     );
     timer_slab.set_root(timer_noun);
     nockapp
-        .add_io_driver(crown::timer_driver(CHAIN_INTERVAL_SECS, timer_slab))
+        .add_io_driver(nockapp::timer_driver(CHAIN_INTERVAL_SECS, timer_slab))
         .await;
 
     Ok(nockapp)

+ 3 - 3
crates/nockchain/src/main.rs

@@ -1,15 +1,15 @@
 use std::error::Error;
 
 use clap::Parser;
-use crown::kernel::boot;
 use kernels::dumb::KERNEL;
+use nockapp::kernel::boot;
 use zkvm_jetpack::hot::produce_prover_hot_state;
 
 #[tokio::main]
 async fn main() -> Result<(), Box<dyn Error>> {
-    sword::check_endian();
+    nockvm::check_endian();
     let cli = nockchain::NockchainCli::parse();
-    boot::init_default_tracing(&cli.crown_cli);
+    boot::init_default_tracing(&cli.nockapp_cli);
 
     let prover_hot_state = produce_prover_hot_state();
     let nockchain =

+ 4 - 4
crates/sword/DEVELOPERS.md → crates/nockvm/DEVELOPERS.md

@@ -10,7 +10,7 @@ To build Sword, make sure Rust is installed, then run:
 cargo build
 ```
 
-to build the Sword executable. This will place the built executable at `target/debug/sword` under the `rust/sword` directory.
+to build the Sword executable. This will place the built executable at `target/debug/nockvm` under the `rust/nockvm` directory.
 
 #### Pills
 
@@ -22,7 +22,7 @@ video of its development](https://youtu.be/fOVhCx1a-9A))
 - **full.pill**: the complete Urbit `v2.11` pill
 - **slim.pill**: a slimmed down version of the Urbit `v2.11` pill that has had every desk and agent not necessary for booting to dojo removed
 
-More information on the pills used by Sword can be found [here](https://github.com/zorp-corp/sword/blob/status/docs/pills.md).
+More information on the pills used by Sword can be found [here](https://github.com/zorp-corp/nockvm/blob/status/docs/pills.md).
 
 ### Test
 
@@ -58,7 +58,7 @@ Until terminated with ctrl-c, this will rebuild Sword library on any change to t
 
 ## Hoon
 
-The Nock analysis and lowering for Sword is written in Hoon, and lives at `hoon/codegen.` It is meant to be jammed and included in the Sword binary. (See [`src/load.rs`](rust/sword/src/load.rs) in the Rust sources for details.)
+The Nock analysis and lowering for Sword is written in Hoon, and lives at `hoon/codegen.` It is meant to be jammed and included in the Sword binary. (See [`src/load.rs`](rust/nockvm/src/load.rs) in the Rust sources for details.)
 
 If the hoon source has been synced to a desk, e.g. `sandbox`, on a fakezod, then the build generator can be invoked as:
 
@@ -66,6 +66,6 @@ If the hoon source has been synced to a desk, e.g. `sandbox`, on a fakezod, then
 .cg/jam +sandbox!cg-make
 ```
 
-This will build the Hoon standard library and the Sword Nock analysis as a "trap" meant to be run by Sword. The jammed output can be found at `<fakezod-pier>/.urb/put/cg.jam`, and should be copied to the `rust/sword/bin` directory, from whence the rust build will include it in the executable.
+This will build the Hoon standard library and the Sword Nock analysis as a "trap" meant to be run by Sword. The jammed output can be found at `<fakezod-pier>/.urb/put/cg.jam`, and should be copied to the `rust/nockvm/bin` directory, from whence the rust build will include it in the executable.
 
 Instructions on testing the analysis in a fakezod are forthcoming.

+ 0 - 0
crates/sword/LICENSE → crates/nockvm/LICENSE


+ 0 - 0
crates/sword/README.md → crates/nockvm/README.md


+ 0 - 0
crates/sword/docs/b-trees.md → crates/nockvm/docs/b-trees.md


+ 0 - 0
crates/sword/docs/codegen-bootstrap.md → crates/nockvm/docs/codegen-bootstrap.md


+ 0 - 0
crates/sword/docs/heap.md → crates/nockvm/docs/heap.md


+ 0 - 0
crates/sword/docs/llvm.md → crates/nockvm/docs/llvm.md


+ 0 - 0
crates/sword/docs/moving-memory.md → crates/nockvm/docs/moving-memory.md


+ 0 - 0
crates/sword/docs/noun-rep.svg → crates/nockvm/docs/noun-rep.svg


+ 0 - 0
crates/sword/docs/persistence.md → crates/nockvm/docs/persistence.md


+ 0 - 0
crates/sword/docs/pills.md → crates/nockvm/docs/pills.md


+ 0 - 0
crates/sword/docs/priors.bib → crates/nockvm/docs/priors.bib


+ 0 - 0
crates/sword/docs/proposal/hypotheses.md → crates/nockvm/docs/proposal/hypotheses.md


+ 0 - 0
crates/sword/docs/proposal/milestones.md → crates/nockvm/docs/proposal/milestones.md


+ 0 - 0
crates/sword/docs/proposal/nock.txt → crates/nockvm/docs/proposal/nock.txt


+ 0 - 0
crates/sword/docs/proposal/notes-~2021.9.23.md → crates/nockvm/docs/proposal/notes-~2021.9.23.md


+ 0 - 0
crates/sword/docs/proposal/notes-~2021.9.24.md → crates/nockvm/docs/proposal/notes-~2021.9.24.md


+ 0 - 0
crates/sword/docs/proposal/noun-representation.md → crates/nockvm/docs/proposal/noun-representation.md


+ 0 - 0
crates/sword/docs/proposal/proposal-nock-performance.md → crates/nockvm/docs/proposal/proposal-nock-performance.md


+ 0 - 0
crates/sword/docs/stack.md → crates/nockvm/docs/stack.md


+ 0 - 0
crates/sword/docs/status/20230419.md → crates/nockvm/docs/status/20230419.md


+ 0 - 0
crates/sword/docs/storyboard.md → crates/nockvm/docs/storyboard.md


+ 0 - 0
crates/sword/docs/subject-knowledge.md → crates/nockvm/docs/subject-knowledge.md


+ 0 - 0
crates/sword/hoon/codegen/lib/degen.hoon → crates/nockvm/hoon/codegen/lib/degen.hoon


+ 0 - 0
crates/sword/hoon/codegen/lib/line.hoon → crates/nockvm/hoon/codegen/lib/line.hoon


Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä