Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
ef1d7e2
initial implementation and file generation
xoloki Nov 19, 2025
37b2411
implement stacks address functionality; get tests to pass
xoloki Nov 26, 2025
c5ae159
add two well known test vectors for derive
xoloki Nov 26, 2025
271ced1
fix TWDerivation conversion
xoloki-stacks Dec 22, 2025
0f39bb3
remove incorrect btc style prefixes from registry.json; implement TWA…
xoloki-stacks Dec 30, 2025
94a01d2
remove debugging println from codegen-v2
xoloki-stacks Dec 31, 2025
8e42409
fill in todo for test_coin_address_derivation and add it to stacks_ad…
xoloki-stacks Dec 31, 2025
25b1070
fix coin_address_derivation_test.rs; add expected stacks address in C…
xoloki-stacks Dec 31, 2025
52728e3
Add signing test
xoloki-stacks Jan 4, 2026
df414bf
get stacks signing working
xoloki-stacks Jan 4, 2026
9724767
implement signing inside the chains API
xoloki-stacks Jan 4, 2026
5fb40af
signing test now works using coin entry signer
xoloki-stacks Jan 5, 2026
b3b715a
clean up debug println and comments
xoloki-stacks Jan 5, 2026
ebc1dd2
clean up debug println
xoloki-stacks Jan 5, 2026
a6eb367
implement C++ signing test
xoloki-stacks Jan 5, 2026
d064d3f
fix coin type in C++ stacks sign test
xoloki-stacks Jan 5, 2026
e614921
fix stacks coin type test by removing prefix checks since they were r…
xoloki-stacks Jan 5, 2026
101cb57
use CoinType instead of magic number for stacks
xoloki-stacks Jan 5, 2026
1e1cd94
remove todo from test_stacks_compile since compilation will not be su…
xoloki-stacks Jan 5, 2026
76cccd5
add proper normalization and test; fmt fix
xoloki-stacks Jan 7, 2026
70664cb
version byte is encoded explicitly not via base32 encode
xoloki-stacks Jan 7, 2026
e80efdb
use c32 from stacks-core crate since it doesnt use standard base32
xoloki-stacks Jan 8, 2026
92e01d2
pull in and prune c32 module from stacks-core crate to avoid extraneo…
xoloki-stacks Jan 8, 2026
a736751
fmt fix c32
xoloki-stacks Jan 8, 2026
724e600
use correct c32 addresses in C++ tests
xoloki-stacks Jan 8, 2026
4231c67
use correct c32 address in test_coin_address_derivation
xoloki-stacks Jan 8, 2026
1c3053c
add recipient type to payload; include real nonce and fee in auth blo…
xoloki-stacks Jan 9, 2026
6c1a73d
add cleared signature to unsigned auth used in initial sighash
xoloki-stacks Jan 14, 2026
496b78e
return signing errors when unwrap can fail during signing and add com…
xoloki-stacks Jan 14, 2026
522ec19
remove k256 from tw_tests Cargo.toml and lock since no longer being used
xoloki-stacks Jan 14, 2026
79c83f5
add explicit check for invalid memo length
xoloki-stacks Jan 20, 2026
ac18cc4
add test cases for all possible signer failures
xoloki-stacks Jan 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/registry.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ This list is generated from [./registry.json](../registry.json)
| 4200 | Merlin | BTC | <img src="https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/merlin/info/logo.png" width="32" /> | <https://merlinchain.io> |
| 5000 | Mantle | MNT | <img src="https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/mantle/info/logo.png" width="32" /> | <https://www.mantle.xyz> |
| 5600 | BNB Greenfield | BNB | <img src="https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/greenfield/info/logo.png" width="32" /> | <https://greenfield.bnbchain.org> |
| 5757 | Stacks | STX | <img src="https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/stacks/info/logo.png" width="32" /> | <https://stacks.org> |
| 6001 | BounceBit | BB | <img src="https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/bouncebit/info/logo.png" width="32" /> | <https://bouncebit.io> |
| 6060 | GoChain | GO | <img src="https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/gochain/info/logo.png" width="32" /> | <https://gochain.io> |
| 7332 | Zen EON | ZEN | <img src="https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/zeneon/info/logo.png" width="32" /> | <https://eon.horizen.io> |
Expand Down
1 change: 1 addition & 0 deletions include/TrustWalletCore/TWBlockchain.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ enum TWBlockchain {
TWBlockchainPactus = 56,
TWBlockchainKomodo = 57,
TWBlockchainPolymesh = 58, // Substrate
TWBlockchainStacks = 59,
};

TW_EXTERN_C_END
1 change: 1 addition & 0 deletions include/TrustWalletCore/TWCoinType.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ enum TWCoinType {
TWCoinTypePolymesh = 595,
TWCoinTypePlasma = 9745,
TWCoinTypeMonad = 10143,
TWCoinTypeStacks = 5757,
// end_of_tw_coin_type_marker_do_not_modify
};

Expand Down
2 changes: 2 additions & 0 deletions include/TrustWalletCore/TWDerivation.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ enum TWDerivation {
TWDerivationPactusMainnet = 9,
TWDerivationPactusTestnet = 10,
TWDerivationSmartChainStableAccount = 11,
TWDerivationStacksMainnet = 12,
TWDerivationStacksTestnet = 13,
// end_of_derivation_enum - USED TO GENERATE CODE
};

Expand Down
39 changes: 39 additions & 0 deletions registry.json
Original file line number Diff line number Diff line change
Expand Up @@ -4945,5 +4945,44 @@
"rpc": "https://rpc.monad.xyz",
"documentation": "https://docs.monad.xyz"
}
},
{
"id": "stacks",
"name": "Stacks",
"coinId": 5757,
"symbol": "STX",
"decimals": 8,
"blockchain": "Stacks",
"derivation": [
{
"name": "mainnet",
"path": "m/44'/5757'/0'/0/0",
"xpub": "xpub",
"xprv": "xprv"
},
{
"name": "testnet",
"path": "m/44'/5757/0'/0/0",
"xpub": "xpub",
"xprv": "xprv"
}
],
"curve": "secp256k1",
"publicKeyType": "secp256k1",
"publicKeyHasher": "sha256ripemd",
"base58Hasher": "sha256d",
"explorer": {
"url": "https://explorer.hiro.so",
"txPath": "/txid/",
"accountPath": "/address/",
"sampleTx": "0x2aeb646c13a0261ebc02003877d2db6c839d3bcbeea6ba7ede877f484f6ce70c",
"sampleAccount": "SP3XXK8BG5X7CRH7W07RRJK3JZJXJ799WX3Y0SMCR"
},
"info": {
"url": "https://stacks.org",
"source": "https://github.com/stacks-network/stacks-core",
"rpc": "",
"documentation": "https://docs.hiro.so/en"
}
}
]
83 changes: 49 additions & 34 deletions rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ members = [
"chains/tw_ripple",
"chains/tw_ronin",
"chains/tw_solana",
"chains/tw_stacks",
"chains/tw_sui",
"chains/tw_thorchain",
"chains/tw_ton",
Expand Down
14 changes: 14 additions & 0 deletions rust/chains/tw_stacks/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[package]
name = "tw_stacks"
version = "0.1.0"
edition = "2021"

[dependencies]
tw_coin_entry = { path = "../../tw_coin_entry" }
tw_encoding = { path = "../../tw_encoding" }
tw_keypair = { path = "../../tw_keypair" }
tw_memory = { path = "../../tw_memory" }
tw_misc = { path = "../../tw_misc" }
tw_proto = { path = "../../tw_proto" }
tw_hash = { path = "../../tw_hash" }
once_cell = "1.21.3"
Loading