Feature Request: Add encoding/decoding commands for Soroban types in Stellar CLI
@fnando is already working on this.
Since Feb 11, 2026.
Assessment
This issue has not been assessed yet.
Description
What problem does your feature solve?
Developers frequently need to convert between different Soroban type representations, especially when using tools like Stellar Lab that require exact hex encoding. Currently, there's an inconsistency: Stellar CLI automatically handles type conversions during contract invocations (e.g., accepting "ABCD" for a BytesN<32> parameter), but there's no standalone command to perform these conversions independently.
Common scenarios: converting strings to BytesN<32> hex format for use in Stellar Lab, encoding addresses to bytes, decoding hex values back to human-readable formats, preparing parameters for contract calls or inspection.
What would you like to see?
Encoding/decoding commands added to the Stellar CLI:
# Encode example
stellar contract encode --type bytes-n-32 --value "ABCD"
# Output: 4142434400000000000000000000000000000000000000000000000000000000
# Decode example
stellar contract decode --type bytes-n-32 --value "4142434400000000000000000000000000000000000000000000000000000000"
# Output: ABCD (or hex if not valid UTF-8)
This would reduce friction when switching between CLI and Lab and would improve developer experience.
What alternatives are there?
Using Python/Node/Unix commands, custom scripts or online converters.
- Dominant language
- Rust
- Stars
- 123
- Forks
- 141
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 17
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from stellar/stellar-cli
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
stellar/stellar-cli#2384 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
stellar/stellar-cli#2347 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
stellar/stellar-cli#2723 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
stellar/stellar-cli#2722 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
stellar/stellar-cli#2703 ·
All issues in stellar/stellar-cli
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100