zycoin 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
zycoin-1.0.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 SpaceZ
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
zycoin-1.0.0/PKG-INFO ADDED
@@ -0,0 +1,154 @@
1
+ Metadata-Version: 2.4
2
+ Name: zycoin
3
+ Version: 1.0.0
4
+ Summary: Python client library for BitcoinZ and related Zcoin-family blockchain networks using Electrum and Bitcore APIs.
5
+ Author: BitcoinZ Community
6
+ License: MIT
7
+ Keywords: bitcoinz,btcz,electrum,blockchain,zcash,zycoin
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.10
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ Requires-Dist: ecdsa>=0.19.2
15
+ Requires-Dist: pbkdf2>=1.3
16
+ Requires-Dist: pyaes>=1.6.1
17
+ Requires-Dist: aiohttp>=3.14.3; platform_system != "Emscripten"
18
+ Requires-Dist: websockets>=16.1.1; platform_system != "Emscripten"
19
+ Dynamic: author
20
+ Dynamic: classifier
21
+ Dynamic: description
22
+ Dynamic: description-content-type
23
+ Dynamic: keywords
24
+ Dynamic: license
25
+ Dynamic: license-file
26
+ Dynamic: requires-dist
27
+ Dynamic: requires-python
28
+ Dynamic: summary
29
+
30
+ # zycoin
31
+
32
+ Python client library for BitcoinZ and related Zcoin-family blockchain networks.
33
+
34
+ This package exposes lightweight async clients for Electrum and Bitcore-compatible APIs, plus wallet, key, and transaction helpers used to interact with BitcoinZ networks. It is designed for developers who want to query blockchain data, monitor address activity, broadcast transactions, or build wallet tooling around the BTCZ ecosystem.
35
+
36
+ ## Features
37
+
38
+ - Async connection management for Electrum servers and Bitcore APIs
39
+ - Address, transaction, balance, mempool, and UTXO queries
40
+ - Header and address subscription support
41
+ - Support for BitcoinZ, Zero, Zclassic, and Flux networks
42
+ - Wallet/key primitives and mnemonic support
43
+ - Simple client manager for registering and managing multiple coins
44
+
45
+ ## Installation
46
+
47
+ ```bash
48
+ pip install zycoin
49
+ ```
50
+
51
+ ## Quick start
52
+
53
+ ```python
54
+ import asyncio
55
+ from src.manager import ClientManager
56
+
57
+ async def on_status(status):
58
+ print("status:", status)
59
+
60
+ async def on_notification(message):
61
+ print("notification:", message)
62
+
63
+ async def main():
64
+ manager = ClientManager()
65
+ manager.on_status = on_status
66
+ manager.on_notification = on_notification
67
+
68
+ client = manager.add("btcz", "bitcore")
69
+ await manager.connect("btcz")
70
+
71
+ await client.subscribe_address("t1Rci9gRmkJZ22vH7dToFe2Up6TpZypgimH")
72
+ print(await client.get_balance("t1Rci9gRmkJZ22vH7dToFe2Up6TpZypgimH"))
73
+
74
+ await manager.disconnect("btcz")
75
+
76
+ asyncio.run(main())
77
+ ```
78
+
79
+ ## Using the Electrum client directly
80
+
81
+ ```python
82
+ import asyncio
83
+ from src.constants import BitcoinZ
84
+ from src.clients import ElectrumClient
85
+
86
+ async def main():
87
+ client = ElectrumClient(BitcoinZ, protocol="ssl")
88
+ client.on_status = lambda status: print("status:", status)
89
+
90
+ await client.connect()
91
+ print(await client.server_version())
92
+ print(await client.get_balance("t1Rci9gRmkJZ22vH7dToFe2Up6TpZypgimH"))
93
+ await client.close()
94
+
95
+ asyncio.run(main())
96
+ ```
97
+
98
+ ## Using the Bitcore client directly
99
+
100
+ ```python
101
+ import asyncio
102
+ from src.constants import BitcoinZ
103
+ from src.clients import BitcoreClient
104
+
105
+ async def main():
106
+ client = BitcoreClient(BitcoinZ)
107
+ client.on_status = lambda status: print("status:", status)
108
+
109
+ await client.connect()
110
+ print(await client.get_history("t1Rci9gRmkJZ22vH7dToFe2Up6TpZypgimH", limit=5))
111
+ await client.close()
112
+
113
+ asyncio.run(main())
114
+ ```
115
+
116
+ ## Managing several coins
117
+
118
+ ```python
119
+ import asyncio
120
+ from src.manager import ClientManager
121
+
122
+ async def main():
123
+ manager = ClientManager()
124
+ manager.add("btcz", "bitcore")
125
+ manager.add("zcl")
126
+ manager.add("zer")
127
+ manager.add("flux")
128
+
129
+ await manager.connect_all()
130
+ print({coin: manager[coin].coin.NAME for coin in manager.clients})
131
+
132
+ await manager.disconnect_all()
133
+
134
+ asyncio.run(main())
135
+ ```
136
+
137
+ ## Available networks
138
+
139
+ The following coin definitions are included:
140
+
141
+ - `btcz` — BitcoinZ
142
+ - `zer` — Zero
143
+ - `zcl` — Zclassic
144
+ - `flux` — Flux
145
+
146
+ ## Notes
147
+
148
+ - The library uses async IO throughout.
149
+ - For Electrum connections, it selects the fastest reachable server automatically.
150
+ - For Bitcore connections, it communicates with the explorer's WebSocket and REST API.
151
+
152
+ ## License
153
+
154
+ MIT
zycoin-1.0.0/README.md ADDED
@@ -0,0 +1,125 @@
1
+ # zycoin
2
+
3
+ Python client library for BitcoinZ and related Zcoin-family blockchain networks.
4
+
5
+ This package exposes lightweight async clients for Electrum and Bitcore-compatible APIs, plus wallet, key, and transaction helpers used to interact with BitcoinZ networks. It is designed for developers who want to query blockchain data, monitor address activity, broadcast transactions, or build wallet tooling around the BTCZ ecosystem.
6
+
7
+ ## Features
8
+
9
+ - Async connection management for Electrum servers and Bitcore APIs
10
+ - Address, transaction, balance, mempool, and UTXO queries
11
+ - Header and address subscription support
12
+ - Support for BitcoinZ, Zero, Zclassic, and Flux networks
13
+ - Wallet/key primitives and mnemonic support
14
+ - Simple client manager for registering and managing multiple coins
15
+
16
+ ## Installation
17
+
18
+ ```bash
19
+ pip install zycoin
20
+ ```
21
+
22
+ ## Quick start
23
+
24
+ ```python
25
+ import asyncio
26
+ from src.manager import ClientManager
27
+
28
+ async def on_status(status):
29
+ print("status:", status)
30
+
31
+ async def on_notification(message):
32
+ print("notification:", message)
33
+
34
+ async def main():
35
+ manager = ClientManager()
36
+ manager.on_status = on_status
37
+ manager.on_notification = on_notification
38
+
39
+ client = manager.add("btcz", "bitcore")
40
+ await manager.connect("btcz")
41
+
42
+ await client.subscribe_address("t1Rci9gRmkJZ22vH7dToFe2Up6TpZypgimH")
43
+ print(await client.get_balance("t1Rci9gRmkJZ22vH7dToFe2Up6TpZypgimH"))
44
+
45
+ await manager.disconnect("btcz")
46
+
47
+ asyncio.run(main())
48
+ ```
49
+
50
+ ## Using the Electrum client directly
51
+
52
+ ```python
53
+ import asyncio
54
+ from src.constants import BitcoinZ
55
+ from src.clients import ElectrumClient
56
+
57
+ async def main():
58
+ client = ElectrumClient(BitcoinZ, protocol="ssl")
59
+ client.on_status = lambda status: print("status:", status)
60
+
61
+ await client.connect()
62
+ print(await client.server_version())
63
+ print(await client.get_balance("t1Rci9gRmkJZ22vH7dToFe2Up6TpZypgimH"))
64
+ await client.close()
65
+
66
+ asyncio.run(main())
67
+ ```
68
+
69
+ ## Using the Bitcore client directly
70
+
71
+ ```python
72
+ import asyncio
73
+ from src.constants import BitcoinZ
74
+ from src.clients import BitcoreClient
75
+
76
+ async def main():
77
+ client = BitcoreClient(BitcoinZ)
78
+ client.on_status = lambda status: print("status:", status)
79
+
80
+ await client.connect()
81
+ print(await client.get_history("t1Rci9gRmkJZ22vH7dToFe2Up6TpZypgimH", limit=5))
82
+ await client.close()
83
+
84
+ asyncio.run(main())
85
+ ```
86
+
87
+ ## Managing several coins
88
+
89
+ ```python
90
+ import asyncio
91
+ from src.manager import ClientManager
92
+
93
+ async def main():
94
+ manager = ClientManager()
95
+ manager.add("btcz", "bitcore")
96
+ manager.add("zcl")
97
+ manager.add("zer")
98
+ manager.add("flux")
99
+
100
+ await manager.connect_all()
101
+ print({coin: manager[coin].coin.NAME for coin in manager.clients})
102
+
103
+ await manager.disconnect_all()
104
+
105
+ asyncio.run(main())
106
+ ```
107
+
108
+ ## Available networks
109
+
110
+ The following coin definitions are included:
111
+
112
+ - `btcz` — BitcoinZ
113
+ - `zer` — Zero
114
+ - `zcl` — Zclassic
115
+ - `flux` — Flux
116
+
117
+ ## Notes
118
+
119
+ - The library uses async IO throughout.
120
+ - For Electrum connections, it selects the fastest reachable server automatically.
121
+ - For Bitcore connections, it communicates with the explorer's WebSocket and REST API.
122
+
123
+ ## License
124
+
125
+ MIT
@@ -0,0 +1,3 @@
1
+ [build-system]
2
+ requires = ["setuptools>=42", "wheel"]
3
+ build-backend = "setuptools.build_meta"
zycoin-1.0.0/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
zycoin-1.0.0/setup.py ADDED
@@ -0,0 +1,41 @@
1
+ from pathlib import Path
2
+ from setuptools import setup
3
+ README = Path(__file__).resolve().parent / "README.md"
4
+
5
+ setup(
6
+ name="zycoin",
7
+ version="1.0.0",
8
+ description="Python client library for BitcoinZ and related Zcoin-family blockchain networks using Electrum and Bitcore APIs.",
9
+ long_description=README.read_text(encoding="utf-8"),
10
+ long_description_content_type="text/markdown",
11
+ author="BitcoinZ Community",
12
+ license="MIT",
13
+ packages=["zycoin"],
14
+ package_dir={"zycoin": "src"},
15
+ package_data={
16
+ 'zycoin': [
17
+ 'wordlist/*.txt'
18
+ ]
19
+ },
20
+ python_requires=">=3.10",
21
+ install_requires=[
22
+ "ecdsa>=0.19.2",
23
+ "pbkdf2>=1.3",
24
+ "pyaes>=1.6.1",
25
+ "aiohttp>=3.14.3; platform_system != 'Emscripten'",
26
+ "websockets>=16.1.1; platform_system != 'Emscripten'"
27
+ ],
28
+ keywords=[
29
+ "bitcoinz",
30
+ "btcz",
31
+ "electrum",
32
+ "blockchain",
33
+ "zcash",
34
+ "zycoin"
35
+ ],
36
+ classifiers=[
37
+ "Programming Language :: Python :: 3",
38
+ "License :: OSI Approved :: MIT License",
39
+ "Operating System :: OS Independent",
40
+ ],
41
+ )
@@ -0,0 +1,143 @@
1
+
2
+ class Coin:
3
+ NAME = None
4
+ SYMBOL = None
5
+
6
+ WIF_PREFIX = None
7
+ ADDRTYPE_P2PKH = None
8
+ ADDRTYPE_P2SH = None
9
+
10
+ DEFAULT_PORTS = {}
11
+ SERVERS = []
12
+ BITCORE_API = None
13
+
14
+ XPUB_HEADERS = {}
15
+ XPRV_HEADERS = {}
16
+
17
+ BRANCH_ID = None
18
+
19
+ @classmethod
20
+ def set_as_network(cls) -> None:
21
+ global net
22
+ net = cls
23
+
24
+
25
+ class BitcoinZ(Coin):
26
+
27
+ NAME = "BitcoinZ"
28
+ SYMBOL = "BTCZ"
29
+
30
+ WIF_PREFIX = 0x80
31
+ ADDRTYPE_P2PKH = bytes.fromhex('1CB8')
32
+ ADDRTYPE_P2SH = bytes.fromhex('1CBD')
33
+ DEFAULT_PORTS = {'t': '50001', 's': '50002', 'w': '50004'}
34
+
35
+ SERVERS = [
36
+ "electrum1.btcz.rocks",
37
+ "electrum2.btcz.rocks",
38
+ "electrum4.btcz.rocks"
39
+ ]
40
+
41
+ BITCORE_API = "https://explorer.btcz.rocks/"
42
+
43
+ XPRV_HEADERS = {
44
+ 'standard': 0x0488ade4,
45
+ }
46
+ XPUB_HEADERS = {
47
+ 'standard': 0x0488b21e,
48
+ }
49
+
50
+ BRANCH_ID = 0xe9ff75a6
51
+
52
+
53
+ class ZeroCurrency(Coin):
54
+
55
+ NAME = "Zero"
56
+ SYMBOL = "ZER"
57
+
58
+ WIF_PREFIX = 0x80
59
+ ADDRTYPE_P2PKH = bytes.fromhex('1CB8')
60
+ ADDRTYPE_P2SH = bytes.fromhex('1CBD')
61
+ DEFAULT_PORTS = {'t': '50001', 's': '50002', 'w': '50004'}
62
+
63
+ SERVERS = []
64
+
65
+ BITCORE_API = "https://explorer.zer.zelcore.io/"
66
+
67
+ XPRV_HEADERS = {
68
+ 'standard': 0x0488ade4,
69
+ }
70
+ XPUB_HEADERS = {
71
+ 'standard': 0x0488b21e,
72
+ }
73
+
74
+ BRANCH_ID = 0x7361707a
75
+
76
+
77
+
78
+ class Zclassic(Coin):
79
+
80
+ NAME = "Zclassic"
81
+ SYMBOL = "ZCL"
82
+
83
+ WIF_PREFIX = 0x80
84
+ ADDRTYPE_P2PKH = bytes.fromhex('1CB8')
85
+ ADDRTYPE_P2SH = bytes.fromhex('1CBD')
86
+ DEFAULT_PORTS = {'t': '50001', 's': '50002', 'w': '50004'}
87
+
88
+ SERVERS = []
89
+
90
+ BITCORE_API = "https://explorer.zcl.zelcore.io/"
91
+
92
+ XPRV_HEADERS = {
93
+ 'standard': 0x0488ade4,
94
+ }
95
+ XPUB_HEADERS = {
96
+ 'standard': 0x0488b21e,
97
+ }
98
+
99
+ BRANCH_ID = 0x930b540d
100
+
101
+
102
+ class Flux(Coin):
103
+
104
+ NAME = "Flux"
105
+ SYMBOL = "FLUX"
106
+
107
+ WIF_PREFIX = 0x80
108
+ ADDRTYPE_P2PKH = bytes.fromhex('1CB8')
109
+ ADDRTYPE_P2SH = bytes.fromhex('1CBD')
110
+ DEFAULT_PORTS = {'t': '50001', 's': '50002', 'w': '50004'}
111
+
112
+ SERVERS = []
113
+
114
+ BITCORE_API = "https://explorer.runonflux.io/"
115
+
116
+ XPRV_HEADERS = {
117
+ 'standard': 0x0488ade4,
118
+ }
119
+ XPUB_HEADERS = {
120
+ 'standard': 0x0488b21e,
121
+ }
122
+
123
+ BRANCH_ID = 0x76b809bb
124
+
125
+
126
+
127
+ COINS = {
128
+ BitcoinZ.SYMBOL.lower(): BitcoinZ,
129
+ ZeroCurrency.SYMBOL.lower(): ZeroCurrency,
130
+ Zclassic.SYMBOL.lower(): Zclassic,
131
+ Flux.SYMBOL.lower(): Flux
132
+ }
133
+
134
+ net = BitcoinZ
135
+
136
+ def set_coin(coin):
137
+ global net
138
+
139
+ key = coin.strip().lower()
140
+ if key not in COINS:
141
+ raise ValueError(f"Unknown coin: {coin}")
142
+ net = COINS[key]
143
+ return net