Repository: 0xPolygonMiden/miden-client
Pull request #840: feat: add support for bech32 account IDs in CLI
Author: login: tomyrd
Created: 2025-04-08T16:31:53Z | Merged: 2025-04-23T15:01:28Z

closes #825 

This PR adds support for bech32 account IDs in the CLI.

It also refactors the code related to dealing with the network in the CLI so that it's also stored in the config.

Linked issue #825: Support bech32 account formats
After bech32 [was implemented on `miden-base`](https://github.com/0xPolygonMiden/miden-base/pull/1185), we can support the format for input and display of account IDs on the CLI. 

There are a couple of points to keep in mind in relation to this. For instance, the format supports identifying the address as part of a specific network, whereas there is no network concept within the CLI, only a specific RPC URL. The node's RPC also still works with account IDs (though it could be updated in the future), so for now the new format could be just a way of inputting and displaying accounts.
Linked issue comments: user: login: bobbinth
created_at: 2025-03-31T20:56:24Z
body: > There are a couple of points to keep in mind in relation to this. For instance, the format supports identifying the address as part of a specific network, whereas there is no network concept within the CLI, only a specific RPC URL. The node's RPC also still works with account IDs (though it could be updated in the future), so for now the new format could be just a way of inputting and displaying accounts.

I think we'll probably keep account IDs as hex for the RPC in the forceable future. So, for now, we should probably use the bech32 addresses only for display/user input purposes as you've suggested.

As for which network to specify for the addresses, let's start out with mainnet (i.e., prefix `mm`) and we can change it later if needed.
author_association: CONTRIBUTOR
user: login: tomyrd
created_at: 2025-04-23T15:05:18Z
body: Addressed by #840 
author_association: CONTRIBUTOR

Diff:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1ab40155c3..be9632f05e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,10 @@
 
 ## 0.9.0 (TBD)
 
+### Features
+
+* Added support for `bech32` account IDs in the CLI (#840).
+
 ### Changes
 
 * Updated Web Client README and Documentation (#808).
diff --git a/Cargo.lock b/Cargo.lock
index a4cfe1fdeb..4bac1f788f 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -93,9 +93,9 @@ dependencies = [
 
 [[package]]
 name = "anyhow"
-version = "1.0.97"
+version = "1.0.98"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f"
+checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487"
 
 [[package]]
 name = "arrayref"
@@ -120,9 +120,9 @@ dependencies = [
 
 [[package]]
 name = "assert_cmd"
-version = "2.0.16"
+version = "2.0.17"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dc1835b7f27878de8525dc71410b5a31cdcc5f230aed5ba5df968e09c201b23d"
+checksum = "2bd389a4b2970a01282ee455294913c0a43724daedcd1a24c3eb0ec1c1320b66"
 dependencies = [
  "anstyle",
  "bstr",
@@ -300,9 +300,9 @@ checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd"
 
 [[package]]
 name = "blake3"
-version = "1.7.0"
+version = "1.8.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b17679a8d69b6d7fd9cd9801a536cec9fa5e5970b69f9d4747f70b39b031f5e7"
+checksum = "3888aaa89e4b2a40fca9848e400f6a658a5a3978de7be858e209cafa8be9a4a0"
 dependencies = [
  "arrayref",
  "arrayvec",
@@ -322,9 +322,9 @@ dependencies = [
 
 [[package]]
 name = "bstr"
-version = "1.11.3"
+version = "1.12.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "531a9155a481e2ee699d4f98f43c0ca4ff8ee1bfd55c31e9e98fb29d2b176fe0"
+checksum = "234113d19d0d7d613b40e86fb654acf958910802bcceab913a4f9e7cda03b1a4"
 dependencies = [
  "memchr",
  "regex-automata 0.4.9",
@@ -357,9 +357,9 @@ checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a"
 
 [[package]]
 name = "cc"
-version = "1.2.17"
+version = "1.2.19"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1fcb57c740ae1daf453ae85f16e37396f672b039e00d9d866e07ddb24e328e3a"
+checksum = "8e3a13707ac958681c13b39b458c073d0d9bc8a22cb1b2f4c8e55eb72c13f362"
 dependencies = [
  "jobserver",
  "libc",
@@ -388,9 +388,9 @@ dependencies = [
 
 [[package]]
 name = "clap"
-version = "4.5.34"
+version = "4.5.37"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e958897981290da2a852763fe9cdb89cd36977a5d729023127095fa94d95e2ff"
+checksum = "eccb054f56cbd38340b380d4a8e69ef1f02f1af43db2f0cc817a4774d80ae071"
 dependencies = [
  "clap_builder",
  "clap_derive",
@@ -398,9 +398,9 @@ dependencies = [
 
 [[package]]
 name = "clap_builder"
-version = "4.5.34"
+version = "4.5.37"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "83b0f35019843db2160b5bb19ae09b4e6411ac33fc6a712003c33e03090e2489"
+checksum = "efd9466fac8543255d3b1fcad4762c5e116ffe808c8a3043d4263cd4fd4862a2"
 dependencies = [
  "anstream",
  "anstyle",
@@ -649,9 +649,9 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
 
 [[package]]
 name = "errno"
-version = "0.3.10"
+version = "0.3.11"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d"
+checksum = "976dd42dc7e85965fe702eb8164f21f450704bdde31faefd6471dba214cb594e"
 dependencies = [
  "libc",
  "windows-sys 0.59.0",
@@ -860,9 +860,9 @@ checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2"
 
 [[package]]
 name = "h2"
-version = "0.4.8"
+version = "0.4.9"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5017294ff4bb30944501348f6f8e42e6ad28f42c8bbef7a74029aff064a4e3c2"
+checksum = "75249d144030531f8dee69fe9cea04d3edf809a017ae445e2abdff6629e86633"
 dependencies = [
  "atomic-waker",
  "bytes",
@@ -870,7 +870,7 @@ dependencies = [
  "futures-core",
  "futures-sink",
  "http",
- "indexmap 2.8.0",
+ "indexmap 2.9.0",
  "slab",
  "tokio",
  "tokio-util",
@@ -1001,9 +1001,9 @@ dependencies = [
 
 [[package]]
 name = "hyper-util"
-version = "0.1.10"
+version = "0.1.11"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4"
+checksum = "497bbc33a26fdd4af9ed9c70d63f61cf56a938375fbb32df34db9b1cd6d643f2"
 dependencies = [
  "bytes",
  "futures-channel",
@@ -1011,6 +1011,7 @@ dependencies = [
  "http",
  "http-body",
  "hyper",
+ "libc",
  "pin-project-lite",
  "socket2",
  "tokio",
@@ -1020,9 +1021,9 @@ dependencies = [
 
 [[package]]
 name = "iana-time-zone"
-version = "0.1.62"
+version = "0.1.63"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b2fd658b06e56721792c5df4475705b6cda790e9298d19d2f8af083457bcd127"
+checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8"
 dependencies = [
  "android_system_properties",
  "core-foundation-sys",
@@ -1030,7 +1031,7 @@ dependencies = [
  "js-sys",
  "log",
  "wasm-bindgen",
- "windows-core 0.52.0",
+ "windows-core 0.61.0",
 ]
 
 [[package]]
@@ -1060,9 +1061,9 @@ dependencies = [
 
 [[package]]
 name = "indexmap"
-version = "2.8.0"
+version = "2.9.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3954d50fe15b02142bf25d3b8bdadb634ec3948f103d04ffe3031bc8fe9d7058"
+checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e"
 dependencies = [
  "equivalent",
  "hashbrown 0.15.2",
@@ -1112,10 +1113,11 @@ checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c"
 
 [[package]]
 name = "jobserver"
-version = "0.1.32"
+version = "0.1.33"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0"
+checksum = "38f262f097c174adebe41eb73d66ae9c06b2844fb0da69969647bbddd9b0538a"
 dependencies = [
+ "getrandom 0.3.2",
  "libc",
 ]
 
@@ -1173,9 +1175,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
 
 [[package]]
 name = "libc"
-version = "0.2.171"
+version = "0.2.172"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6"
+checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa"
 
 [[package]]
 name = "libm"
@@ -1212,9 +1214,9 @@ checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab"
 
 [[package]]
 name = "linux-raw-sys"
-version = "0.9.3"
+version = "0.9.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fe7db12097d22ec582439daf8618b8fdd1a7bef6270e9af3b1ebcd30893cf413"
+checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12"
 
 [[package]]
 name = "lock_api"
@@ -1301,9 +1303,9 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
 
 [[package]]
 name = "miden-air"
-version = "0.13.0"
+version = "0.13.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "72269e041e915d6c34325a8906f08a8ff6ec9b92c79ae07f3a0de8c3588694b5"
+checksum = "00e2e77c57ae798e02553af158c04d467f6479ab798a8c84459d343a89ff9c50"
 dependencies = [
  "miden-core",
  "thiserror 2.0.12",
@@ -1313,9 +1315,9 @@ dependencies = [
 
 [[package]]
 name = "miden-assembly"
-version = "0.13.0"
+version = "0.13.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ce5680a0e75470389b65cc00900422ad7e1aa7972477c75ff88f63c3a01671e9"
+checksum = "75d1cb02d807c2481f365feca966bedb74c66c765923d04c3c23ea678afaf148"
 dependencies = [
  "aho-corasick",
  "lalrpop",
@@ -1343,7 +1345,7 @@ dependencies = [
  "miden-objects",
  "miette",
  "predicates",
- "rand 0.9.0",
+ "rand 0.9.1",
  "serde",
  "serde_json",
  "thiserror 2.0.12",
@@ -1374,7 +1376,7 @@ dependencies = [
  "prost",
  "prost-build",
  "protox",
- "rand 0.9.0",
+ "rand 0.9.1",
  "rusqlite",
  "serde",
  "serde-wasm-bindgen",
@@ -1398,7 +1400,7 @@ dependencies = [
  "miden-client",
  "miden-lib",
  "miden-objects",
- "rand 0.9.0",
+ "rand 0.9.1",
  "tokio",
  "toml",
  "uuid",
@@ -1412,7 +1414,7 @@ dependencies = [
  "miden-client",
  "miden-lib",
  "miden-objects",
- "rand 0.9.0",
+ "rand 0.9.1",
  "serde-wasm-bindgen",
  "wasm-bindgen",
  "wasm-bindgen-futures",
@@ -1421,9 +1423,9 @@ dependencies = [
 
 [[package]]
 name = "miden-core"
-version = "0.13.0"
+version = "0.13.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e8ba125a31e9ec0e732f47e639525c753973e553126cfc46cc63674049ea4134"
+checksum = "d7d408e01421b5df2e4cfaf1a91efefe3fb5b729f1c99b668d3a69eec0044a6b"
 dependencies = [
  "lock_api",
  "loom",
@@ -1450,7 +1452,7 @@ dependencies = [
  "glob",
  "num",
  "num-complex",
- "rand 0.9.0",
+ "rand 0.9.1",
  "rand_core 0.9.3",
  "sha3",
  "thiserror 2.0.12",
@@ -1526,7 +1528,7 @@ dependencies = [
 [[package]]
 name = "miden-node-proto-build"
 version = "0.9.0"
-source = "git+https://github.com/0xPolygonMiden/miden-node?branch=next#a8649333b2dd8fe182607f80998e5b4abe6f1502"
+source = "git+https://github.com/0xPolygonMiden/miden-node?branch=next#26e5f4c5cfe2fa4d55ba826e46a17a995f11d583"
 dependencies = [
  "anyhow",
  "prost",
@@ -1546,7 +1548,7 @@ dependencies = [
  "miden-crypto",
  "miden-processor",
  "miden-verifier",
- "rand 0.9.0",
+ "rand 0.9.1",
  "rand_xoshiro",
  "semver 1.0.26",
  "serde",
@@ -1557,9 +1559,9 @@ dependencies = [
 
 [[package]]
 name = "miden-processor"
-version = "0.13.0"
+version = "0.13.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2e5f362138a7bfe6c20246de651e848566843a0d5062cc4a7a8ebff6bd14668d"
+checksum = "d4e70b053c587014396d06be3502e3952777923bee11729b7514c060fdc0d2c8"
 dependencies = [
  "miden-air",
  "miden-core",
@@ -1570,9 +1572,9 @@ dependencies = [
 
 [[package]]
 name = "miden-prover"
-version = "0.13.0"
+version = "0.13.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d6531711c8f3e25be9c607f82fc456594aba061acd3cde1df5d23eed88579340"
+checksum = "2baa571449e7811e934dae919285dfea4854fb867f6d20d757d60b0601ef0140"
 dependencies = [
  "miden-air",
  "miden-processor",
@@ -1603,9 +1605,9 @@ dependencies = [
 
 [[package]]
 name = "miden-stdlib"
-version = "0.13.1"
+version = "0.13.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "116d30a8db5167f88944509007b8bb7aad4fa0d9d03f2610b4e80be3a198ad37"
+checksum = "77e59c4dd1079bffe8407694b386ae781feaf1f7acb9d1cefa858578bc99cad4"
 dependencies = [
  "miden-assembly",
  "miden-core",
@@ -1622,7 +1624,7 @@ dependencies = [
  "miden-processor",
  "miden-prover",
  "miden-verifier",
- "rand 0.9.0",
+ "rand 0.9.1",
  "rand_chacha 0.9.0",
  "thiserror 2.0.12",
  "winter-maybe-async",
@@ -1630,9 +1632,9 @@ dependencies = [
 
 [[package]]
 name = "miden-verifier"
-version = "0.13.0"
+version = "0.13.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6ae6636d1e7a9d78a973fd59ffcfd87964eee235ecdf3264569add5ff89b0d91"
+checksum = "20ae024b022569d7117891a83cf51ccd5bceeda248f30690b394a6dfc4607061"
 dependencies = [
  "miden-air",
  "miden-core",
@@ -1680,9 +1682,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
 
 [[package]]
 name = "miniz_oxide"
-version = "0.8.5"
+version = "0.8.8"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8e3e04debbb59698c15bacbb6d93584a8c0ca9cc3213cb423d31f760d8843ce5"
+checksum = "3be647b768db090acb35d5ec5db2b0e1f1de11133ca123b9eacf5137868f892a"
 dependencies = [
  "adler2",
 ]
@@ -1913,7 +1915,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db"
 dependencies = [
  "fixedbitset 0.4.2",
- "indexmap 2.8.0",
+ "indexmap 2.9.0",
 ]
 
 [[package]]
@@ -1923,7 +1925,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "3672b37090dbd86368a4145bc067582552b29c27377cad4e0a306c97f9bd7772"
 dependencies = [
  "fixedbitset 0.5.7",
- "indexmap 2.8.0",
+ "indexmap 2.9.0",
 ]
 
 [[package]]
@@ -2020,9 +2022,9 @@ dependencies = [
 
 [[package]]
 name = "prettyplease"
-version = "0.2.31"
+version = "0.2.32"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5316f57387668042f561aae71480de936257848f9c43ce528e311d89a07cadeb"
+checksum = "664ec5419c51e34154eec046ebcba56312d5a2fc3b09a06da188e1ad21afadf6"
 dependencies = [
  "proc-macro2",
  "syn",
@@ -2030,9 +2032,9 @@ dependencies = [
 
 [[package]]
 name = "proc-macro2"
-version = "1.0.94"
+version = "1.0.95"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84"
+checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778"
 dependencies = [
  "unicode-ident",
 ]
@@ -2170,13 +2172,12 @@ dependencies = [
 
 [[package]]
 name = "rand"
-version = "0.9.0"
+version = "0.9.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94"
+checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97"
 dependencies = [
  "rand_chacha 0.9.0",
  "rand_core 0.9.3",
- "zerocopy",
 ]
 
 [[package]]
@@ -2248,9 +2249,9 @@ dependencies = [
 
 [[package]]
 name = "redox_syscall"
-version = "0.5.10"
+version = "0.5.11"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0b8c0c260b63a8219631167be35e6a988e9554dbd323f8bd08439c8ed1302bd1"
+checksum = "d2f103c6d277498fbceb16e84d317e2a400f160f46904d5f5410848c829511a3"
 dependencies = [
  "bitflags",
 ]
@@ -2377,22 +2378,22 @@ dependencies = [
 
 [[package]]
 name = "rustix"
-version = "1.0.3"
+version = "1.0.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e56a18552996ac8d29ecc3b190b4fdbb2d91ca4ec396de7bbffaf43f3d637e96"
+checksum = "d97817398dd4bb2e6da002002db259209759911da105da92bec29ccb12cf58bf"
 dependencies = [
  "bitflags",
  "errno",
  "libc",
- "linux-raw-sys 0.9.3",
+ "linux-raw-sys 0.9.4",
  "windows-sys 0.59.0",
 ]
 
 [[package]]
 name = "rustls"
-version = "0.23.25"
+version = "0.23.26"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "822ee9188ac4ec04a2f0531e55d035fb2de73f18b41a63c70c2712503b6fb13c"
+checksum = "df51b5869f3a441595eac5e8ff14d486ff285f7b8c0df8770e49c3b56351f0f0"
 dependencies = [
  "log",
  "once_cell",
@@ -2615,9 +2616,9 @@ dependencies = [
 
 [[package]]
 name = "smallvec"
-version = "1.14.0"
+version = "1.15.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd"
+checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9"
 
 [[package]]
 name = "smawk"
@@ -2627,9 +2628,9 @@ checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c"
 
 [[package]]
 name = "socket2"
-version = "0.5.8"
+version = "0.5.9"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8"
+checksum = "4f5fd57c80058a56cf5c777ab8a126398ece8e442983605d280a44ce79d0edef"
 dependencies = [
  "libc",
  "windows-sys 0.52.0",
@@ -2727,7 +2728,7 @@ dependencies = [
  "fastrand",
  "getrandom 0.3.2",
  "once_cell",
- "rustix 1.0.3",
+ "rustix 1.0.5",
  "windows-sys 0.59.0",
 ]
 
@@ -2767,7 +2768,7 @@ version = "0.4.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "45c6481c4829e4cc63825e62c49186a34538b7b2750b73b266581ffb612fb5ed"
 dependencies = [
- "rustix 1.0.3",
+ "rustix 1.0.5",
  "windows-sys 0.59.0",
 ]
 
@@ -2849,9 +2850,9 @@ dependencies = [
 
 [[package]]
 name = "tokio"
-version = "1.44.1"
+version = "1.44.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f382da615b842244d4b8738c82ed1275e6c5dd90c459a30941cd07080b06c91a"
+checksum = "e6b88822cbe49de4185e3a4cbf8321dd487cf5fe0c5c65695fef6346371e9c48"
 dependencies = [
  "backtrace",
  "bytes",
@@ -2935,7 +2936,7 @@ version = "0.22.24"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474"
 dependencies = [
- "indexmap 2.8.0",
+ "indexmap 2.9.0",
  "serde",
  "serde_spanned",
  "toml_datetime",
@@ -3108,7 +3109,7 @@ checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9"
 dependencies = [
  "futures-core",
  "futures-util",
- "indexmap 2.8.0",
+ "indexmap 2.9.0",
  "pin-project-lite",
  "slab",
  "sync_wrapper",
@@ -3496,24 +3497,28 @@ dependencies = [
 
 [[package]]
 name = "windows-core"
-version = "0.52.0"
+version = "0.58.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9"
+checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99"
 dependencies = [
+ "windows-implement 0.58.0",
+ "windows-interface 0.58.0",
+ "windows-result 0.2.0",
+ "windows-strings 0.1.0",
  "windows-targets 0.52.6",
 ]
 
 [[package]]
 name = "windows-core"
-version = "0.58.0"
+version = "0.61.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99"
+checksum = "4763c1de310c86d75a878046489e2e5ba02c649d185f21c67d4cf8a56d098980"
 dependencies = [
- "windows-implement",
- "windows-interface",
- "windows-result",
- "windows-strings",
- "windows-targets 0.52.6",
+ "windows-implement 0.60.0",
+ "windows-interface 0.59.1",
+ "windows-link",
+ "windows-result 0.3.2",
+ "windows-strings 0.4.0",
 ]
 
 [[package]]
@@ -3527,6 +3532,17 @@ dependencies = [
  "syn",
 ]
 
+[[package]]
+name = "windows-implement"
+version = "0.60.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
 [[package]]
 name = "windows-interface"
 version = "0.58.0"
@@ -3538,6 +3554,17 @@ dependencies = [
  "syn",
 ]
 
+[[package]]
+name = "windows-interface"
+version = "0.59.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
 [[package]]
 name = "windows-link"
 version = "0.1.1"
@@ -3553,16 +3580,34 @@ dependencies = [
  "windows-targets 0.52.6",
 ]
 
+[[package]]
+name = "windows-result"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c64fd11a4fd95df68efcfee5f44a294fe71b8bc6a91993e2791938abcc712252"
+dependencies = [
+ "windows-link",
+]
+
 [[package]]
 name = "windows-strings"
 version = "0.1.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10"
 dependencies = [
- "windows-result",
+ "windows-result 0.2.0",
  "windows-targets 0.52.6",
 ]
 
+[[package]]
+name = "windows-strings"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7a2ba9642430ee452d5a7aa78d72907ebe8cfda358e8cb7918a2050581322f97"
+dependencies = [
+ "windows-link",
+]
+
 [[package]]
 name = "windows-sys"
 version = "0.48.0"
@@ -3713,9 +3758,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
 
 [[package]]
 name = "winnow"
-version = "0.7.4"
+version = "0.7.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0e97b544156e9bebe1a0ffbc03484fc1ffe3100cbce3ffb17eac35f7cdd7ab36"
+checksum = "63d3fcd9bba44b03821e7d699eeee959f3126dcc4aa8e4ae18ec617c2a5cea10"
 dependencies = [
  "memchr",
 ]
diff --git a/bin/miden-cli/src/commands/account.rs b/bin/miden-cli/src/commands/account.rs
index fa5e225e54..cfe6c1f732 100644
--- a/bin/miden-cli/src/commands/account.rs
+++ b/bin/miden-cli/src/commands/account.rs
@@ -1,4 +1,5 @@
 use clap::Parser;
+use comfy_table::{Cell, ContentArrangement, presets};
 use miden_client::{
     Client, ZERO,
     account::{Account, AccountId, AccountType, StorageSlot},
@@ -41,6 +42,7 @@ pub struct AccountCmd {
 
 impl AccountCmd {
     pub async fn execute(&self, client: Client) -> Result<(), CliError> {
+        let (cli_config, _) = load_config_file()?;
         match self {
             AccountCmd {
                 list: false,
@@ -49,7 +51,7 @@ impl AccountCmd {
                 ..
             } => {
                 let account_id = parse_account_id(&client, id).await?;
-                show_account(client, account_id, self.with_code).await?;
+                show_account(client, account_id, &cli_config, self.with_code).await?;
             },
             AccountCmd {
                 list: false,
@@ -65,12 +67,7 @@ impl AccountCmd {
                         let default_account = if id == "none" {
                             None
                         } else {
-                            let account_id: AccountId = AccountId::from_hex(id).map_err(|err| {
-                                CliError::AccountId(
-                                    err,
-                                    "Input number was not a valid Account ID".to_string(),
-                                )
-                            })?;
+                            let account_id: AccountId = parse_account_id(&client, id).await?;
 
                             // Check whether we're tracking that account
                             let (account, _) = client.try_get_account_header(account_id).await?;
@@ -126,9 +123,13 @@ async fn list_accounts(client: Client) -> Result<(), CliError> {
     Ok(())
 }
 
+// SHOW ACCOUNT
+// ================================================================================================
+
 pub async fn show_account(
     client: Client,
     account_id: AccountId,
+    cli_config: &CliConfig,
     with_code: bool,
 ) -> Result<(), CliError> {
     let account: Account = client
@@ -137,27 +138,7 @@ pub async fn show_account(
         .ok_or(CliError::Input(format!("Account with ID {account_id} not found")))?
         .into();
 
-    let mut table = create_dynamic_table(&[
-        "Account ID",
-        "Account Commitment",
-        "Type",
-        "Storage mode",
-        "Code Commitment",
-        "Vault Root",
-        "Storage Root",
-        "Nonce",
-    ]);
-    table.add_row(vec![
-        account.id().to_string(),
-        account.commitment().to_string(),
-        account_type_display_name(&account_id)?,
-        account_id.storage_mode().to_string(),
-        account.code().commitment().to_string(),
-        account.vault().asset_tree().root().to_string(),
-        account.storage().commitment().to_string(),
-        account.nonce().as_int().to_string(),
-    ]);
-    println!("{table}\n");
+    print_summary_table(&account, cli_config)?;
 
     // Vault Table
     {
@@ -217,7 +198,6 @@ pub async fn show_account(
         }
         println!("{table}\n");
     }
-    println!("{table}\n");
 
     // Account code
     if with_code {
@@ -234,6 +214,46 @@ pub async fn show_account(
 // HELPERS
 // ================================================================================================
 
+/// Prints a summary table with account information.
+fn print_summary_table(account: &Account, cli_config: &CliConfig) -> Result<(), CliError> {
+    let mut table = create_dynamic_table(&["Account Information"]);
+    table
+        .load_preset(presets::UTF8_HORIZONTAL_ONLY)
+        .set_content_arrangement(ContentArrangement::DynamicFullWidth);
+
+    table.add_row(vec![Cell::new("Account ID (hex)"), Cell::new(account.id().to_string())]);
+    table.add_row(vec![
+        Cell::new("Account ID (bech32)"),
+        Cell::new(account.id().to_bech32(cli_config.network.to_network_id()?)),
+    ]);
+    table.add_row(vec![
+        Cell::new("Account Commitment"),
+        Cell::new(account.commitment().to_string()),
+    ]);
+    table.add_row(vec![Cell::new("Type"), Cell::new(account_type_display_name(&account.id())?)]);
+    table.add_row(vec![
+        Cell::new("Storage mode"),
+        Cell::new(account.id().storage_mode().to_string()),
+    ]);
+    table.add_row(vec![
+        Cell::new("Code Commitment"),
+        Cell::new(account.code().commitment().to_string()),
+    ]);
+    table.add_row(vec![
+        Cell::new("Vault Root"),
+        Cell::new(account.vault().asset_tree().root().to_string()),
+    ]);
+    table.add_row(vec![
+        Cell::new("Storage Root"),
+        Cell::new(account.storage().commitment().to_string()),
+    ]);
+    table.add_row(vec![Cell::new("Nonce"), Cell::new(account.nonce().as_int().to_string())]);
+
+    println!("{table}\n");
+    Ok(())
+}
+
+/// Returns a display name for the account type.
 fn account_type_display_name(account_id: &AccountId) -> Result<String, CliError> {
     Ok(match account_id.account_type() {
         AccountType::FungibleFaucet => {
diff --git a/bin/miden-cli/src/commands/init.rs b/bin/miden-cli/src/commands/init.rs
index 1d71df394b..cb04e9d541 100644
--- a/bin/miden-cli/src/commands/init.rs
+++ b/bin/miden-cli/src/commands/init.rs
@@ -2,16 +2,14 @@ use std::{
     fs::{self, File},
     io::Write,
     path::PathBuf,
-    str::FromStr,
 };
 
 use clap::Parser;
-use miden_client::rpc::Endpoint;
 use tracing::info;
 
 use crate::{
     CLIENT_CONFIG_FILE_NAME,
-    config::{CliConfig, CliEndpoint},
+    config::{CliConfig, CliEndpoint, Network},
     errors::CliError,
 };
 
@@ -28,39 +26,6 @@ const BASIC_AUTH_TEMPLATE_FILE: &[u8] =
 // INIT COMMAND
 // ================================================================================================
 
-#[derive(Debug, Clone)]
-enum Network {
-    Custom(String),
-    Devnet,
-    Localhost,
-    Testnet,
-}
-
-impl FromStr for Network {
-    type Err = String;
-
-    fn from_str(s: &str) -> Result<Self, Self::Err> {
-        match s.to_lowercase().as_str() {
-            "devnet" => Ok(Network::Devnet),
-            "localhost" => Ok(Network::Localhost),
-            "testnet" => Ok(Network::Testnet),
-            custom => Ok(Network::Custom(custom.to_string())),
-        }
-    }
-}
-
-impl Network {
-    /// Converts the Network variant to its corresponding RPC endpoint string
-    pub fn to_rpc_endpoint(&self) -> String {
-        match self {
-            Network::Custom(custom) => custom.clone(),
-            Network::Devnet => Endpoint::devnet().to_string(),
-            Network::Localhost => Endpoint::default().to_string(),
-            Network::Testnet => Endpoint::testnet().to_string(),
-        }
-    }
-}
-
 #[derive(Debug, Clone, Parser)]
 #[clap(
     about = "Initialize the client. It will create a file named `miden-client.toml` that holds \
@@ -98,9 +63,11 @@ impl InitCmd {
 
         let mut cli_config = CliConfig::default();
 
-        if let Some(endpoint) = &self.network {
+        if let Some(network) = &self.network {
+            cli_config.network = network.clone();
+
             let endpoint =
-                CliEndpoint::try_from(endpoint.to_rpc_endpoint().as_str()).map_err(|err| {
+                CliEndpoint::try_from(network.to_rpc_endpoint().as_str()).map_err(|err| {
                     CliError::Parse(err.into(), "Failed to parse RPC endpoint".to_string())
                 })?;
 
diff --git a/bin/miden-cli/src/commands/new_transactions.rs b/bin/miden-cli/src/commands/new_transactions.rs
index 78e91ea857..ce4be5e27a 100644
--- a/bin/miden-cli/src/commands/new_transactions.rs
+++ b/bin/miden-cli/src/commands/new_transactions.rs
@@ -66,7 +66,7 @@ impl MintCmd {
         let force = self.force;
         let faucet_details_map = load_faucet_details_map()?;
 
-        let fungible_asset = faucet_details_map.parse_fungible_asset(&self.asset)?;
+        let fungible_asset = faucet_details_map.parse_fungible_asset(&client, &self.asset).await?;
 
         let target_account_id = parse_account_id(&client, self.target_account_id.as_str()).await?;
 
@@ -130,7 +130,7 @@ impl SendCmd {
 
         let faucet_details_map = load_faucet_details_map()?;
 
-        let fungible_asset = faucet_details_map.parse_fungible_asset(&self.asset)?;
+        let fungible_asset = faucet_details_map.parse_fungible_asset(&client, &self.asset).await?;
 
         // try to use either the provided argument or the default account
         let sender_account_id =
@@ -199,9 +199,9 @@ impl SwapCmd {
         let faucet_details_map = load_faucet_details_map()?;
 
         let offered_fungible_asset =
-            faucet_details_map.parse_fungible_asset(&self.offered_asset)?;
+            faucet_details_map.parse_fungible_asset(&client, &self.offered_asset).await?;
         let requested_fungible_asset =
-            faucet_details_map.parse_fungible_asset(&self.requested_asset)?;
+            faucet_details_map.parse_fungible_asset(&client, &self.requested_asset).await?;
 
         // try to use either the provided argument or the default account
         let sender_account_id =
diff --git a/bin/miden-cli/src/commands/notes.rs b/bin/miden-cli/src/commands/notes.rs
index 234ea98ba5..d24d505282 100644
--- a/bin/miden-cli/src/commands/notes.rs
+++ b/bin/miden-cli/src/commands/notes.rs
@@ -2,7 +2,6 @@ use clap::ValueEnum;
 use comfy_table::{Attribute, Cell, ContentArrangement, Table, presets};
 use miden_client::{
     Client, ClientError, IdPrefixFetchError,
-    account::AccountId,
     asset::Asset,
     crypto::Digest,
     note::{
@@ -13,8 +12,10 @@ use miden_client::{
 use miden_objects::PrettyPrint;
 
 use crate::{
-    Parser, create_dynamic_table, errors::CliError, get_output_note_with_id_prefix,
-    utils::load_faucet_details_map,
+    Parser, create_dynamic_table,
+    errors::CliError,
+    get_output_note_with_id_prefix,
+    utils::{load_faucet_details_map, parse_account_id},
 };
 
 #[derive(Clone, Debug, ValueEnum)]
@@ -295,10 +296,7 @@ async fn list_consumable_notes(
     account_id: Option<&String>,
 ) -> Result<(), CliError> {
     let account_id = match account_id {
-        Some(id) => Some(
-            AccountId::from_hex(id.as_str())
-                .map_err(|err| CliError::AccountId(err, "Invalid account ID".to_string()))?,
-        ),
+        Some(id) => Some(parse_account_id(&client, id).await?),
         None => None,
     };
     let notes = client.get_consumable_notes(account_id).await?;
diff --git a/bin/miden-cli/src/config.rs b/bin/miden-cli/src/config.rs
index 9d7025e29e..30fe39b47b 100644
--- a/bin/miden-cli/src/config.rs
+++ b/bin/miden-cli/src/config.rs
@@ -2,6 +2,7 @@ use core::fmt::Debug;
 use std::{
     fmt::Display,
     path::{Path, PathBuf},
+    str::FromStr,
 };
 
 use figment::{
@@ -9,6 +10,7 @@ use figment::{
     value::{Dict, Map},
 };
 use miden_client::rpc::Endpoint;
+use miden_objects::{NetworkIdError, account::NetworkId};
 use serde::{Deserialize, Serialize};
 
 const TOKEN_SYMBOL_MAP_FILEPATH: &str = "token_symbol_map.toml";
@@ -33,6 +35,8 @@ pub struct CliConfig {
     pub remote_prover_endpoint: Option<CliEndpoint>,
     /// Path to the directory from where account component template files will be loaded.
     pub component_template_directory: PathBuf,
+    /// Network for use in bech32 account ID enconding.
+    pub network: Network,
 }
 
 // Make `ClientConfig` a provider itself for composability.
@@ -67,6 +71,7 @@ impl Default for CliConfig {
             token_symbol_map_filepath: Path::new(TOKEN_SYMBOL_MAP_FILEPATH).to_path_buf(),
             remote_prover_endpoint: None,
             component_template_directory: Path::new(DEFAULT_COMPONENT_TEMPLATE_DIR).to_path_buf(),
+            network: Network::Localhost,
         }
     }
 }
@@ -149,3 +154,55 @@ impl<'de> Deserialize<'de> for CliEndpoint {
         CliEndpoint::try_from(endpoint.as_str()).map_err(serde::de::Error::custom)
     }
 }
+
+// NETWORK
+// ================================================================================================
+
+/// Represents the network to which the client connects. It is used to determine the RPC endpoint
+/// and network ID for the CLI.
+#[derive(Debug, Clone, Deserialize, Serialize)]
+pub enum Network {
+    Custom(String),
+    Devnet,
+    Localhost,
+    Testnet,
+}
+
+impl FromStr for Network {
+    type Err = String;
+
+    fn from_str(s: &str) -> Result<Self, Self::Err> {
+        match s.to_lowercase().as_str() {
+            "devnet" => Ok(Network::Devnet),
+            "localhost" => Ok(Network::Localhost),
+            "testnet" => Ok(Network::Testnet),
+            custom => Ok(Network::Custom(custom.to_string())),
+        }
+    }
+}
+
+impl Network {
+    /// Converts the Network variant to its corresponding RPC endpoint string
+    #[allow(dead_code)]
+    pub fn to_rpc_endpoint(&self) -> String {
+        match self {
+            Network::Custom(custom) => custom.clone(),
+            Network::Devnet => Endpoint::devnet().to_string(),
+            Network::Localhost => Endpoint::default().to_string(),
+            Network::Testnet => Endpoint::testnet().to_string(),
+        }
+    }
+
+    /// Converts the Network variant to its corresponding [`NetworkId`]
+    #[allow(dead_code)]
+    pub fn to_network_id(&self) -> Result<NetworkId, NetworkIdError> {
+        let network_id = match self {
+            Network::Custom(_) => NetworkId::new("mcst")?,
+            Network::Devnet => NetworkId::Devnet,
+            Network::Localhost => NetworkId::new("mlcl")?,
+            Network::Testnet => NetworkId::Testnet,
+        };
+
+        Ok(network_id)
+    }
+}
diff --git a/bin/miden-cli/src/errors.rs b/bin/miden-cli/src/errors.rs
index 595ad2dc26..b187d3e83b 100644
--- a/bin/miden-cli/src/errors.rs
+++ b/bin/miden-cli/src/errors.rs
@@ -1,7 +1,7 @@
 use std::error::Error;
 
 use miden_client::{ClientError, keystore::KeyStoreError};
-use miden_objects::{AccountError, AccountIdError, AssetError};
+use miden_objects::{AccountError, AccountIdError, AssetError, NetworkIdError};
 use miette::Diagnostic;
 use thiserror::Error;
 
@@ -56,6 +56,8 @@ pub enum CliError {
     #[error("missing flag: {0}")]
     #[diagnostic(code(cli::config_error), help("Check the configuration file format."))]
     MissingFlag(String),
+    #[error("network id error")]
+    NetworkIdError(#[from] NetworkIdError),
     #[error("invalid argument: {0}")]
     InvalidArgument(String),
     #[error("parse error: {1}")]
diff --git a/bin/miden-cli/src/faucet_details_map.rs b/bin/miden-cli/src/faucet_details_map.rs
index db70eb4e91..ffe5b2f470 100644
--- a/bin/miden-cli/src/faucet_details_map.rs
+++ b/bin/miden-cli/src/faucet_details_map.rs
@@ -3,11 +3,11 @@ use std::{
     path::PathBuf,
 };
 
-use miden_client::{account::AccountId, asset::FungibleAsset};
+use miden_client::{Client, account::AccountId, asset::FungibleAsset};
 use miden_lib::account::faucets::BasicFungibleFaucet;
 use serde::{Deserialize, Serialize};
 
-use crate::errors::CliError;
+use crate::{errors::CliError, utils::parse_account_id};
 
 /// Stores the detail information of a faucet to be stored in the token symbol map file.
 #[derive(Debug, Serialize, Deserialize)]
@@ -88,20 +88,20 @@ impl FaucetDetailsMap {
     /// - A faucet ID was provided but the amount isn't in base units.
     /// - The amount has more than the allowed number of decimals.
     /// - The token symbol isn't present in the token symbol map file.
-    pub fn parse_fungible_asset(&self, arg: &str) -> Result<FungibleAsset, CliError> {
+    pub async fn parse_fungible_asset(
+        &self,
+        client: &Client,
+        arg: &str,
+    ) -> Result<FungibleAsset, CliError> {
         let (amount, asset) = arg.split_once("::").ok_or(CliError::Parse(
             "separator `::` not found".into(),
             "Failed to parse amount and asset".to_string(),
         ))?;
-        let (faucet_id, amount) = if asset.starts_with("0x") {
+        let (faucet_id, amount) = if let Ok(id) = parse_account_id(client, asset).await {
             let amount = amount
                 .parse::<u64>()
                 .map_err(|err| CliError::Parse(err.into(), "Failed to parse u64".to_string()))?;
-            (
-                AccountId::from_hex(asset)
-                    .map_err(|err| CliError::AccountId(err, "Invalid faucet ID".to_string()))?,
-                amount,
-            )
+            (id, amount)
         } else {
             let FaucetDetails { id, decimals: faucet_decimals } =
                 self.0.get(asset).ok_or(CliError::Config(
@@ -112,10 +112,7 @@ impl FaucetDetailsMap {
             // Convert from decimal to integer.
             let amount = parse_number_as_base_units(amount, *faucet_decimals)?;
 
-            let faucet_id = AccountId::from_hex(id)
-                .map_err(|err| CliError::AccountId(err, "Invalid faucet ID".to_string()))?;
-
-            (faucet_id, amount)
+            (parse_account_id(client, id).await?, amount)
         };
 
         FungibleAsset::new(faucet_id, amount).map_err(CliError::Asset)
diff --git a/bin/miden-cli/src/info.rs b/bin/miden-cli/src/info.rs
index 95082b3270..042c084084 100644
--- a/bin/miden-cli/src/info.rs
+++ b/bin/miden-cli/src/info.rs
@@ -3,11 +3,13 @@ use std::fs;
 use miden_client::{Client, store::NoteFilter};
 
 use super::config::CliConfig;
-use crate::errors::CliError;
+use crate::{errors::CliError, load_config_file};
+
+pub async fn print_client_info(client: &Client) -> Result<(), CliError> {
+    let (config, _) = load_config_file()?;
 
-pub async fn print_client_info(client: &Client, config: &CliConfig) -> Result<(), CliError> {
     println!("Client version: {}", env!("CARGO_PKG_VERSION"));
-    print_config_stats(config)?;
+    print_config_stats(&config)?;
     print_client_stats(client).await
 }
 
diff --git a/bin/miden-cli/src/lib.rs b/bin/miden-cli/src/lib.rs
index 5c5eaf6100..5cb35460aa 100644
--- a/bin/miden-cli/src/lib.rs
+++ b/bin/miden-cli/src/lib.rs
@@ -132,7 +132,7 @@ impl Cli {
             Command::NewAccount(new_account) => new_account.execute(client, keystore).await,
             Command::Import(import) => import.execute(client, keystore).await,
             Command::Init(_) => Ok(()),
-            Command::Info => info::print_client_info(&client, &cli_config).await,
+            Command::Info => info::print_client_info(&client).await,
             Command::Notes(notes) => notes.execute(client).await,
             Command::Sync(sync) => sync.execute(client).await,
             Command::Tags(tags) => tags.execute(client).await,
diff --git a/bin/miden-cli/src/utils.rs b/bin/miden-cli/src/utils.rs
index 3ac1820203..3adbd580af 100644
--- a/bin/miden-cli/src/utils.rs
+++ b/bin/miden-cli/src/utils.rs
@@ -43,10 +43,11 @@ pub(crate) async fn get_input_acc_id_by_prefix_or_default(
 
 /// Parses a user provided account ID string and returns the corresponding `AccountId`.
 ///
-/// `account_id` can fall into two categories:
+/// `account_id` can fall into three categories:
 ///
-/// - It's a prefix of an account ID of an account tracked by the client.
-/// - It's a full account ID.
+/// - It's a hex prefix of an account ID of an account tracked by the client.
+/// - It's a full hex account ID.
+/// - It's a full bech32 account ID.
 ///
 /// # Errors
 ///
@@ -56,16 +57,24 @@ pub(crate) async fn parse_account_id(
     client: &Client,
     account_id: &str,
 ) -> Result<AccountId, CliError> {
-    if let Ok(account_id) = AccountId::from_hex(account_id) {
-        return Ok(account_id);
+    if account_id.starts_with("0x") {
+        if let Ok(account_id) = AccountId::from_hex(account_id) {
+            return Ok(account_id);
+        }
+
+        Ok(get_account_with_id_prefix(client, account_id)
+        .await
+        .map_err(|_| CliError::Input(format!("Input account ID {account_id} is neither a valid Account ID nor a hex prefix of a known Account ID")))?
+        .id())
+    } else {
+        Ok(AccountId::from_bech32(account_id)
+            .map_err(|_| {
+                CliError::Input(format!(
+                    "Input account ID {account_id} is not a valid bech32 encoded Account ID"
+                ))
+            })?
+            .1)
     }
-
-    let account_id = get_account_with_id_prefix(client, account_id)
-    .await
-    .map_err(|_| CliError::Input(format!("Input account ID {account_id} is neither a valid Account ID nor a prefix of a known Account ID")))?
-    .id();
-
-    Ok(account_id)
 }
 
 pub(crate) fn update_config(config_path: &Path, client_config: &CliConfig) -> Result<(), CliError> {
diff --git a/crates/rust-client/src/rpc/generated/nostd/mod.rs b/crates/rust-client/src/rpc/generated/nostd/mod.rs
index 2bbf8c7a5a..f30df8e115 100644
--- a/crates/rust-client/src/rpc/generated/nostd/mod.rs
+++ b/crates/rust-client/src/rpc/generated/nostd/mod.rs
@@ -1,4 +1,8 @@
-#![allow(clippy::doc_markdown, clippy::struct_field_names)]
+#![allow(
+    clippy::doc_markdown,
+    clippy::struct_field_names,
+    clippy::trivially_copy_pass_by_ref
+)]
 pub mod account;
 pub mod block;
 pub mod digest;
diff --git a/crates/rust-client/src/rpc/generated/nostd/transaction.rs b/crates/rust-client/src/rpc/generated/nostd/transaction.rs
index b60bc53e4b..4d99970c6f 100644
--- a/crates/rust-client/src/rpc/generated/nostd/transaction.rs
+++ b/crates/rust-client/src/rpc/generated/nostd/transaction.rs
@@ -30,7 +30,7 @@ impl TransactionStatus {
     ///
     /// The values are not transformed in any way and thus are considered stable
     /// (if the ProtoBuf definition does not change) and safe for programmatic use.
-    pub fn as_str_name(self) -> &'static str {
+    pub fn as_str_name(&self) -> &'static str {
         match self {
             Self::Commited => "COMMITED",
             Self::Failed => "FAILED",
diff --git a/crates/rust-client/src/rpc/generated/std/mod.rs b/crates/rust-client/src/rpc/generated/std/mod.rs
index 2bbf8c7a5a..f30df8e115 100644
--- a/crates/rust-client/src/rpc/generated/std/mod.rs
+++ b/crates/rust-client/src/rpc/generated/std/mod.rs
@@ -1,4 +1,8 @@
-#![allow(clippy::doc_markdown, clippy::struct_field_names)]
+#![allow(
+    clippy::doc_markdown,
+    clippy::struct_field_names,
+    clippy::trivially_copy_pass_by_ref
+)]
 pub mod account;
 pub mod block;
 pub mod digest;
diff --git a/crates/rust-client/src/rpc/generated/std/transaction.rs b/crates/rust-client/src/rpc/generated/std/transaction.rs
index b60bc53e4b..4d99970c6f 100644
--- a/crates/rust-client/src/rpc/generated/std/transaction.rs
+++ b/crates/rust-client/src/rpc/generated/std/transaction.rs
@@ -30,7 +30,7 @@ impl TransactionStatus {
     ///
     /// The values are not transformed in any way and thus are considered stable
     /// (if the ProtoBuf definition does not change) and safe for programmatic use.
-    pub fn as_str_name(self) -> &'static str {
+    pub fn as_str_name(&self) -> &'static str {
         match self {
             Self::Commited => "COMMITED",
             Self::Failed => "FAILED",


Reviews:
user: login: SantiagoPittella
body: Left some minor comments.

Why the `package-lock.json` and `yarn.lock` files were updated?
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-04-11T14:30:13Z
user: login: tomyrd
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-11T21:40:19Z
user: login: SantiagoPittella
body: I was testing the PR and while trying to mint using the bech32 format for the faucet, I'm receiving this error:
<img width="1495" alt="image" src="https://github.com/user-attachments/assets/72e16f64-6693-4b8b-aa0f-43671c5a64f8" />

state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-04-16T15:46:27Z
user: login: igamigo
body: Looks good overall! Leaving some mostly minor comments for now. I don't think any are blocking except for the branch changes (and the problem @SantiagoPittella saw as well), so we could leave them for other PRs/issues if you preferred. 
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-04-16T18:39:19Z
user: login: tomyrd
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-16T20:50:07Z
user: login: tomyrd
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-16T21:06:46Z
user: login: SantiagoPittella
state: APPROVED
author_association: COLLABORATOR
submitted_at: 2025-04-23T12:56:27Z
user: login: igamigo
body: LGTM!
state: APPROVED
author_association: COLLABORATOR
submitted_at: 2025-04-23T15:00:08Z
user: login: igamigo
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-04-23T15:10:50Z

Review comments:
diff_hunk: @@ -149,3 +154,55 @@ impl<'de> Deserialize<'de> for CliEndpoint {
         CliEndpoint::try_from(endpoint.as_str()).map_err(serde::de::Error::custom)
     }
 }
+
+// NETWORK
+// ================================================================================================
+
+/// Represents the network to which the client connects. It is used to determine the RPC endpoint
+/// and network ID for the CLI.
+#[derive(Debug, Clone, Deserialize, Serialize)]
+pub enum Network {
+    Custom(String),
+    Devnet,
+    Localhost,
+    Testnet,
+}
+
+impl FromStr for Network {
+    type Err = String;
+
+    fn from_str(s: &str) -> Result<Self, Self::Err> {
+        match s.to_lowercase().as_str() {
+            "devnet" => Ok(Network::Devnet),
+            "localhost" => Ok(Network::Localhost),
+            "testnet" => Ok(Network::Testnet),
+            custom => Ok(Network::Custom(custom.to_string())),
+        }
+    }
+}
+
+impl Network {
+    /// Converts the Network variant to its corresponding RPC endpoint string
+    #[allow(dead_code)]
path: bin/miden-cli/src/config.rs
user: login: SantiagoPittella
body: This isn't needed anymore, right? i saw a call to it some lines above.
created_at: 2025-04-11T14:26:47Z
author_association: COLLABORATOR
diff_hunk: @@ -149,3 +154,55 @@ impl<'de> Deserialize<'de> for CliEndpoint {
         CliEndpoint::try_from(endpoint.as_str()).map_err(serde::de::Error::custom)
     }
 }
+
+// NETWORK
+// ================================================================================================
+
+/// Represents the network to which the client connects. It is used to determine the RPC endpoint
+/// and network ID for the CLI.
+#[derive(Debug, Clone, Deserialize, Serialize)]
+pub enum Network {
+    Custom(String),
+    Devnet,
+    Localhost,
+    Testnet,
+}
+
+impl FromStr for Network {
+    type Err = String;
+
+    fn from_str(s: &str) -> Result<Self, Self::Err> {
+        match s.to_lowercase().as_str() {
+            "devnet" => Ok(Network::Devnet),
+            "localhost" => Ok(Network::Localhost),
+            "testnet" => Ok(Network::Testnet),
+            custom => Ok(Network::Custom(custom.to_string())),
+        }
+    }
+}
+
+impl Network {
+    /// Converts the Network variant to its corresponding RPC endpoint string
+    #[allow(dead_code)]
+    pub fn to_rpc_endpoint(&self) -> String {
+        match self {
+            Network::Custom(custom) => custom.clone(),
+            Network::Devnet => Endpoint::devnet().to_string(),
+            Network::Localhost => Endpoint::default().to_string(),
+            Network::Testnet => Endpoint::testnet().to_string(),
+        }
+    }
+
+    /// Converts the Network variant to its corresponding [`NetworkId`]
+    #[allow(dead_code)]
path: bin/miden-cli/src/config.rs
user: login: SantiagoPittella
body: Same here.
created_at: 2025-04-11T14:26:54Z
author_association: COLLABORATOR
diff_hunk: @@ -149,3 +154,55 @@ impl<'de> Deserialize<'de> for CliEndpoint {
         CliEndpoint::try_from(endpoint.as_str()).map_err(serde::de::Error::custom)
     }
 }
+
+// NETWORK
+// ================================================================================================
+
+/// Represents the network to which the client connects. It is used to determine the RPC endpoint
+/// and network ID for the CLI.
+#[derive(Debug, Clone, Deserialize, Serialize)]
+pub enum Network {
+    Custom(String),
+    Devnet,
+    Localhost,
+    Testnet,
+}
+
+impl FromStr for Network {
+    type Err = String;
+
+    fn from_str(s: &str) -> Result<Self, Self::Err> {
+        match s.to_lowercase().as_str() {
+            "devnet" => Ok(Network::Devnet),
+            "localhost" => Ok(Network::Localhost),
+            "testnet" => Ok(Network::Testnet),
+            custom => Ok(Network::Custom(custom.to_string())),
+        }
+    }
+}
+
+impl Network {
+    /// Converts the Network variant to its corresponding RPC endpoint string
+    #[allow(dead_code)]
path: bin/miden-cli/src/config.rs
user: login: tomyrd
body: It's really strange but it seems clippy detects this as a false positive, so these are needed to remove the clippy errors.
created_at: 2025-04-11T21:40:19Z
author_association: CONTRIBUTOR
diff_hunk: @@ -19,10 +19,10 @@ repository = "https://github.com/0xPolygonMiden/miden-client"
 
 [workspace.dependencies]
 async-trait = "0.1"
-miden-lib = { version = "0.8", default-features = false }
-miden-objects = { version = "0.8", default-features = false }
-miden-tx = { version = "0.8", default-features = false, features = ["async"] }
-miden-proving-service-client = { version = "0.8", default-features = false, features = ["tx-prover"] }
+miden-lib = { git = "https://github.com/0xPolygonMiden/miden-base", branch = "tomyrd-reexport-networkiderror", default-features = false }
+miden-objects = { git = "https://github.com/0xPolygonMiden/miden-base", branch = "tomyrd-reexport-networkiderror",  default-features = false }
+miden-tx = { git = "https://github.com/0xPolygonMiden/miden-base", branch = "tomyrd-reexport-networkiderror", default-features = false, features = ["async"] }
+miden-proving-service-client = { git = "https://github.com/0xPolygonMiden/miden-base", branch = "tomyrd-reexport-networkiderror",  default-features = false, features = ["tx-prover"] }
path: Cargo.toml
user: login: igamigo
body: We should be able to move this back to `next` now, right?
created_at: 2025-04-16T18:24:44Z
author_association: COLLABORATOR
diff_hunk: @@ -18,11 +18,11 @@ WARNINGS=RUSTDOCFLAGS="-D warnings"
 
 NODE_DIR="miden-node"
 NODE_REPO="https://github.com/0xPolygonMiden/miden-node.git"
-NODE_BRANCH="main"
+NODE_BRANCH="tomyrd-tonic-web"
path: Makefile
user: login: igamigo
body: Same as the previous comment.
created_at: 2025-04-16T18:24:55Z
author_association: COLLABORATOR
diff_hunk: @@ -36,15 +36,15 @@ pub struct AccountCmd {
 }
 
 impl AccountCmd {
-    pub async fn execute(&self, client: Client) -> Result<(), CliError> {
+    pub async fn execute(&self, client: Client, cli_config: &CliConfig) -> Result<(), CliError> {
path: bin/miden-cli/src/commands/account.rs
user: login: igamigo
body: I wonder if we can instantiate the `CliConfig` within the function to avoid passing it from `main()` essentially. But maybe this is better to avoid loading the file many times (maybe it could be within a once cell?). There are other occurrences of this as well.
created_at: 2025-04-16T18:35:30Z
author_association: COLLABORATOR
diff_hunk: @@ -149,3 +154,55 @@ impl<'de> Deserialize<'de> for CliEndpoint {
         CliEndpoint::try_from(endpoint.as_str()).map_err(serde::de::Error::custom)
     }
 }
+
+// NETWORK
+// ================================================================================================
+
+/// Represents the network to which the client connects. It is used to determine the RPC endpoint
+/// and network ID for the CLI.
+#[derive(Debug, Clone, Deserialize, Serialize)]
+pub enum Network {
+    Custom(String),
+    Devnet,
+    Localhost,
+    Testnet,
+}
+
+impl FromStr for Network {
+    type Err = String;
+
+    fn from_str(s: &str) -> Result<Self, Self::Err> {
+        match s.to_lowercase().as_str() {
+            "devnet" => Ok(Network::Devnet),
+            "localhost" => Ok(Network::Localhost),
+            "testnet" => Ok(Network::Testnet),
+            custom => Ok(Network::Custom(custom.to_string())),
+        }
path: bin/miden-cli/src/config.rs
user: login: igamigo
body: Could (and should) we derive the network from the URL itself instead?
created_at: 2025-04-16T18:37:00Z
author_association: COLLABORATOR
diff_hunk: @@ -36,15 +36,15 @@ pub struct AccountCmd {
 }
 
 impl AccountCmd {
-    pub async fn execute(&self, client: Client) -> Result<(), CliError> {
+    pub async fn execute(&self, client: Client, cli_config: &CliConfig) -> Result<(), CliError> {
path: bin/miden-cli/src/commands/account.rs
user: login: tomyrd
body: Just realized that other commands load the config internally, I'll change both ocurrences of the parameter to this. I'll create an issue to replace this with once cell in the future as there are many instances of `load_config_file`.
created_at: 2025-04-16T20:50:07Z
author_association: CONTRIBUTOR
diff_hunk: @@ -149,3 +154,55 @@ impl<'de> Deserialize<'de> for CliEndpoint {
         CliEndpoint::try_from(endpoint.as_str()).map_err(serde::de::Error::custom)
     }
 }
+
+// NETWORK
+// ================================================================================================
+
+/// Represents the network to which the client connects. It is used to determine the RPC endpoint
+/// and network ID for the CLI.
+#[derive(Debug, Clone, Deserialize, Serialize)]
+pub enum Network {
+    Custom(String),
+    Devnet,
+    Localhost,
+    Testnet,
+}
+
+impl FromStr for Network {
+    type Err = String;
+
+    fn from_str(s: &str) -> Result<Self, Self::Err> {
+        match s.to_lowercase().as_str() {
+            "devnet" => Ok(Network::Devnet),
+            "localhost" => Ok(Network::Localhost),
+            "testnet" => Ok(Network::Testnet),
+            custom => Ok(Network::Custom(custom.to_string())),
+        }
path: bin/miden-cli/src/config.rs
user: login: tomyrd
body: The `Network` is derived from the initial `miden init --network <network>`, this is where the `from_str` is used. Then the URL is derived from the `Network` object. So doing it the other way wouldn't be possible unless we change the `init` command to receive the URL.
created_at: 2025-04-16T21:06:46Z
author_association: CONTRIBUTOR
diff_hunk: @@ -149,3 +154,55 @@ impl<'de> Deserialize<'de> for CliEndpoint {
         CliEndpoint::try_from(endpoint.as_str()).map_err(serde::de::Error::custom)
     }
 }
+
+// NETWORK
+// ================================================================================================
+
+/// Represents the network to which the client connects. It is used to determine the RPC endpoint
+/// and network ID for the CLI.
+#[derive(Debug, Clone, Deserialize, Serialize)]
+pub enum Network {
+    Custom(String),
+    Devnet,
+    Localhost,
+    Testnet,
+}
+
+impl FromStr for Network {
+    type Err = String;
+
+    fn from_str(s: &str) -> Result<Self, Self::Err> {
+        match s.to_lowercase().as_str() {
+            "devnet" => Ok(Network::Devnet),
+            "localhost" => Ok(Network::Localhost),
+            "testnet" => Ok(Network::Testnet),
+            custom => Ok(Network::Custom(custom.to_string())),
+        }
path: bin/miden-cli/src/config.rs
user: login: igamigo
body: I think keeping the network and URL could be redundant (and for example, if you modified the config you could have a URL that does not correspond with the network) but I'm not sure how we want to handle it.

I think we can keep it like this for a while. May be best to open an issue to discuss this briefly. 

Alternatively, if the new config field only really affects the account ID encoding, maybe we should rename it to something that reflects this better (because otherwise it's not very indicative of what it affects on the CLI).
created_at: 2025-04-23T15:10:50Z
author_association: COLLABORATOR

PR comments:
user: login: tomyrd
created_at: 2025-04-11T21:37:34Z
body: > Why the package-lock.json and yarn.lock files were updated?

I think running the web client tests also updates its dependencies
author_association: CONTRIBUTOR
user: login: tomyrd
created_at: 2025-04-16T20:39:12Z
body: While testing, I think I found a little change that can maybe make the CLI a bit more usable. This is how we currently print account information with `miden account --show`:

<img width="1504" alt="Screenshot 2025-04-16 at 5 37 14 PM" src="https://github.com/user-attachments/assets/049bdbbf-e82e-4fc3-b90a-33c351f7cd3f" />

This format makes it hard to copy and paste values as they are in separate lines. I think changing the table to a bullet point list would be better as each entry would fit in a line. Plus, the table doesn't make much sense here as it always prints one account in this way.

Do you agree? Should I add it to this PR?

author_association: CONTRIBUTOR
user: login: igamigo
created_at: 2025-04-16T21:08:53Z
body: > While testing, I think I found a little change that can maybe make the CLI a bit more usable. This is how we currently print account information with `miden account --show`:
> 
> <img alt="Screenshot 2025-04-16 at 5 37 14 PM" width="1504" src="https://private-user-images.githubusercontent.com/43424983/434520494-049bdbbf-e82e-4fc3-b90a-33c351f7cd3f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDQ4Mzc5MDQsIm5iZiI6MTc0NDgzNzYwNCwicGF0aCI6Ii80MzQyNDk4My80MzQ1MjA0OTQtMDQ5YmRiYmYtZTgyZS00ZmMzLWI5MGEtMzNjMzUxZjdjZDNmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MTYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDE2VDIxMDY0NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWZhMTYyNjVkODFlZWRiMWYwOWVlNjhiNTdiOTU1YjRiOWI4ZWM3MjlkODk2Y2M5OTQxNjMzZTQ4YTQyOThiZWYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.xPzizN_gVYvPQHdBBEg2RuQfI7R5PCcAT4unryzc9vE">
> This format makes it hard to copy and paste values as they are in separate lines. I think changing the table to a bullet point list would be better as each entry would fit in a line. Plus, the table doesn't make much sense here as it always prints one account in this way.
> 
> Do you agree? Should I add it to this PR?

Yes, this has been a bit annoying for a while so I'd agree. However, not sure if a list would look too great if you have more than one account. But we should definitely test it out or discuss it on an issue (though if you want to implement it here, it should be fine as well).
author_association: COLLABORATOR
user: login: tomyrd
created_at: 2025-04-16T21:19:23Z
body: >  not sure if a list would look too great if you have more than one account

I agree, but the `--show` command always shous only one account. The flat `miden account` command which lists would still be a table
author_association: CONTRIBUTOR
user: login: igamigo
created_at: 2025-04-16T21:21:32Z
body: > > not sure if a list would look too great if you have more than one account
> 
> I agree, but the `--show` command always shous only one account. The flat `miden account` command which lists would still be a table

Ah yes, sorry for the misunderstanding, I agree!
author_association: COLLABORATOR
user: login: tomyrd
created_at: 2025-04-16T21:42:01Z
body: <img width="1508" alt="Screenshot 2025-04-16 at 6 40 22 PM" src="https://github.com/user-attachments/assets/050298f4-3d63-4df4-afa3-0aa01272b209" />

Looks much better and is more functional for copying and pasting
author_association: CONTRIBUTOR
user: login: bobbinth
created_at: 2025-04-21T17:59:53Z
body: > Looks much better and is more functional for copying and pasting

Agreed! This looks very clean. One comment: shouldn't bech32 version of account ID start with `mm1`?
author_association: CONTRIBUTOR
user: login: tomyrd
created_at: 2025-04-21T18:29:34Z
body: > shouldn't bech32 version of account ID start with mm1?

Yes, but only for mainnet.

These are the values in miden-base:
```rust
    const MAINNET: &str = "mm";
    const TESTNET: &str = "mtst";
    const DEVNET: &str = "mdev";
```
In this case, the CLI is running on a localhost node, in those cases I chose a custom `NetworkId` ("mmlcl")

author_association: CONTRIBUTOR
user: login: bobbinth
created_at: 2025-04-21T19:06:45Z
body: I'd probably just use mainnet for everything right now since there is no way to communicate to the node which network (testnet vs. devent etc.) we are using.
author_association: CONTRIBUTOR
user: login: tomyrd
created_at: 2025-04-21T20:00:43Z
body: > since there is no way to communicate to the node which network (testnet vs. devent etc.) we are using.

There's no way to communicate this to the node but the CLI knows which network it's using. It's one of the parameters in `miden init`:
```
Options:
  -n, --network <NETWORK>
          Network configuration to use. Options are `devnet`, `testnet`, `localhost` or a custom RPC endpoint. Defaults to the testnet network [default: testnet]
```

So we use this parameter to derive the `NetworkId` for the bech32 ID.

If we prefer, I can ignore this parameter and use mainnet for the bech32 ID so it always starts with `mm1`.
author_association: CONTRIBUTOR
user: login: bobbinth
created_at: 2025-04-21T21:11:14Z
body: Ah - if we already have it, then let's use it.
author_association: CONTRIBUTOR