|
38 | 38 | from typing import Sequence, Tuple |
39 | 39 |
|
40 | 40 | import electrumx.lib.util as util |
41 | | -from electrumx.lib.hash import Base58, double_sha256, hash_to_hex_str |
| 41 | +from electrumx.lib.hash import Base58, double_sha256, double_sha3_256, hash_to_hex_str |
42 | 42 | from electrumx.lib.hash import HASHX_LEN, hex_str_to_hash |
43 | 43 | from electrumx.lib.script import (_match_ops, Script, ScriptError, |
44 | 44 | ScriptPubKey, OpCodes) |
@@ -4239,3 +4239,68 @@ class FerriteTestnet(Ferrite): |
4239 | 4239 | 'enode2.ferritecoin.org s t', |
4240 | 4240 | 'enode3.ferritecoin.org s t', |
4241 | 4241 | ] |
| 4242 | + |
| 4243 | + |
| 4244 | +class Kylacoin(Coin): |
| 4245 | + NAME = "Kylacoin" |
| 4246 | + SHORTNAME = "KCN" |
| 4247 | + NET = "mainnet" |
| 4248 | + VALUE_PER_COIN = 1000000000000 |
| 4249 | + DEFAULT_MAX_SEND = 8000000 |
| 4250 | + XPUB_VERBYTES = bytes.fromhex("038f332e") |
| 4251 | + XPRV_VERBYTES = bytes.fromhex("038f2ef4") |
| 4252 | + P2PKH_VERBYTE = bytes.fromhex("1c") |
| 4253 | + P2SH_VERBYTES = bytes.fromhex("1a") |
| 4254 | + WIF_BYTE = bytes.fromhex("41") |
| 4255 | + GENESIS_HASH = ('0000000091ddc5a0b9f0ed098a4db06e' |
| 4256 | + 'e9bc286a104f092f4fb476eb9364b7c9') |
| 4257 | + DESERIALIZER = lib_tx.DeserializerKylacoin |
| 4258 | + ESTIMATE_FEE = 0.0001 |
| 4259 | + RELAY_FEE = 0.0001 |
| 4260 | + TX_COUNT = 2237124 |
| 4261 | + TX_COUNT_HEIGHT = 1463512 |
| 4262 | + TX_PER_BLOCK = 1 |
| 4263 | + RPC_PORT = 5110 |
| 4264 | + REORG_LIMIT = 800 |
| 4265 | + PEERS = [ |
| 4266 | + 'electrum.kcnxp.com t51001 s51002', |
| 4267 | + ] |
| 4268 | + |
| 4269 | + @classmethod |
| 4270 | + def header_hash(cls, header): |
| 4271 | + '''Given a header return hash''' |
| 4272 | + return double_sha3_256(header) |
| 4273 | + |
| 4274 | + |
| 4275 | +class Lyncoin(AuxPowMixin, Coin): |
| 4276 | + NAME = "Lyncoin" |
| 4277 | + SHORTNAME = "LCN" |
| 4278 | + NET = "mainnet" |
| 4279 | + VALUE_PER_COIN = 100000000 |
| 4280 | + DEFAULT_MAX_SEND = 8000000 |
| 4281 | + XPUB_VERBYTES = bytes.fromhex("019c354f") |
| 4282 | + XPRV_VERBYTES = bytes.fromhex("019c3115") |
| 4283 | + P2PKH_VERBYTE = bytes.fromhex("ea") |
| 4284 | + P2SH_VERBYTES = bytes.fromhex("37") |
| 4285 | + WIF_BYTE = bytes.fromhex("7e") |
| 4286 | + GENESIS_HASH = ('000000002b8761c63862f5047afb9ac5' |
| 4287 | + 'fdd1c67e87cd376c387628bc772bb39d') |
| 4288 | + DESERIALIZER = lib_tx.DeserializerLyncoin |
| 4289 | + ESTIMATE_FEE = 1 |
| 4290 | + RELAY_FEE = 1 |
| 4291 | + TX_COUNT = 906114 |
| 4292 | + TX_COUNT_HEIGHT = 555605 |
| 4293 | + TX_PER_BLOCK = 1 |
| 4294 | + RPC_PORT = 5053 |
| 4295 | + REORG_LIMIT = 800 |
| 4296 | + PEERS = [ |
| 4297 | + 'electrum.lcnxp.com t52001 s52002', |
| 4298 | + ] |
| 4299 | + |
| 4300 | + @classmethod |
| 4301 | + def header_hash(cls, header): |
| 4302 | + '''Given a header return hash''' |
| 4303 | + version = int.from_bytes(header[:4], 'little') |
| 4304 | + if version & 0x8000: |
| 4305 | + return double_sha3_256(header[:cls.BASIC_HEADER_SIZE]) |
| 4306 | + return double_sha256(header[:cls.BASIC_HEADER_SIZE]) |
0 commit comments