common/defs: add 'confidential_assets' section to coin definitions (#399)

Enable 'confidential_assets' for Elements (following #66 and #317) to allow
deriving confidential addresses and signing confidential transactions.

The following Python helper script was used to update the JSON files:
```
import json
import sys

for f in sys.argv[1:]:
    d = json.load(open(f))
    d["confidential_assets"] = None
    with open(f, "w") as o:
        json.dump(d, o, indent=2)
        o.write("\n")
```

Set it to `{'address_prefix': 4, 'blech32_prefix': 'el'}` for Elements.

`coins.json` and `coininfo.py` were re-generated using:
```
$ pipenv run make gen gen_check
```
pull/392/head
Roman Zeyde 5 years ago committed by Pavol Rusnak
parent 2923f3390f
commit 7210a2f56d

@ -36,5 +36,6 @@
"blockbook": [], "blockbook": [],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -36,5 +36,6 @@
"blockbook": [], "blockbook": [],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -45,5 +45,6 @@
], ],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -36,5 +36,6 @@
"blockbook": [], "blockbook": [],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -39,5 +39,6 @@
], ],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -45,5 +45,6 @@
], ],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -39,5 +39,6 @@
"blockbook": [], "blockbook": [],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -39,5 +39,6 @@
"blockbook": [], "blockbook": [],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -36,5 +36,6 @@
"blockbook": [], "blockbook": [],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -45,5 +45,6 @@
], ],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -36,5 +36,6 @@
"blockbook": [], "blockbook": [],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -39,5 +39,6 @@
], ],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -38,5 +38,6 @@
"blockbook": [], "blockbook": [],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -36,5 +36,6 @@
"blockbook": [], "blockbook": [],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -36,5 +36,6 @@
"blockbook": [], "blockbook": [],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -41,5 +41,6 @@
], ],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -39,5 +39,6 @@
"blockbook": [], "blockbook": [],
"negative_fee": false, "negative_fee": false,
"cooldown": 1000, "cooldown": 1000,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -38,5 +38,6 @@
"blockbook": [], "blockbook": [],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -42,5 +42,6 @@
], ],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -44,5 +44,6 @@
], ],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -36,5 +36,6 @@
"blockbook": [], "blockbook": [],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -40,5 +40,6 @@
"blockbook": [], "blockbook": [],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -42,5 +42,6 @@
], ],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -36,5 +36,6 @@
"blockbook": [], "blockbook": [],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -38,5 +38,6 @@
"blockbook": [], "blockbook": [],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -38,5 +38,6 @@
"blockbook": [], "blockbook": [],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -36,5 +36,6 @@
"blockbook": [], "blockbook": [],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -42,5 +42,6 @@
], ],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -42,5 +42,6 @@
], ],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -36,5 +36,9 @@
"blockbook": [], "blockbook": [],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": {
"address_prefix": 4,
"blech32_prefix": "el"
}
} }

@ -36,5 +36,6 @@
"blockbook": [], "blockbook": [],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -38,5 +38,6 @@
"blockbook": [], "blockbook": [],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -38,5 +38,6 @@
"blockbook": [], "blockbook": [],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -41,5 +41,6 @@
], ],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -38,5 +38,6 @@
], ],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -38,5 +38,6 @@
], ],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -41,5 +41,6 @@
], ],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -40,5 +40,6 @@
], ],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -38,5 +38,6 @@
"blockbook": [], "blockbook": [],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -43,5 +43,6 @@
"2": 0, "2": 0,
"3": 1537743641, "3": 1537743641,
"4": 1991772603 "4": 1991772603
} },
"confidential_assets": null
} }

@ -38,5 +38,6 @@
"blockbook": [], "blockbook": [],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -42,5 +42,6 @@
], ],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -38,5 +38,6 @@
"blockbook": [], "blockbook": [],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -36,5 +36,6 @@
"blockbook": [], "blockbook": [],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -41,5 +41,6 @@
], ],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -38,5 +38,6 @@
], ],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -39,5 +39,6 @@
"blockbook": [], "blockbook": [],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -39,5 +39,6 @@
], ],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -32,9 +32,12 @@
"uri_prefix": "nix", "uri_prefix": "nix",
"min_address_length": 27, "min_address_length": 27,
"max_address_length": 34, "max_address_length": 34,
"bitcore": ["https://blockchain.nixplatform.io"], "bitcore": [
"https://blockchain.nixplatform.io"
],
"blockbook": [], "blockbook": [],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -39,5 +39,6 @@
"blockbook": [], "blockbook": [],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -36,5 +36,6 @@
"blockbook": [], "blockbook": [],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -38,5 +38,6 @@
"blockbook": [], "blockbook": [],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -38,5 +38,6 @@
], ],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -38,5 +38,6 @@
], ],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -38,5 +38,6 @@
], ],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -36,5 +36,6 @@
"blockbook": [], "blockbook": [],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -39,5 +39,6 @@
"blockbook": [], "blockbook": [],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -39,5 +39,6 @@
"blockbook": [], "blockbook": [],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -40,5 +40,6 @@
], ],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -40,5 +40,6 @@
], ],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -41,5 +41,6 @@
"blockbook": [], "blockbook": [],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -39,5 +39,6 @@
"blockbook": [], "blockbook": [],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -39,5 +39,6 @@
"blockbook": [], "blockbook": [],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -38,5 +38,6 @@
"blockbook": [], "blockbook": [],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -42,5 +42,6 @@
], ],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -41,5 +41,6 @@
"blockbook": [], "blockbook": [],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -43,5 +43,6 @@
], ],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -47,5 +47,6 @@
"2": 0, "2": 0,
"3": 1537743641, "3": 1537743641,
"4": 1991772603 "4": 1991772603
} },
"confidential_assets": null
} }

@ -43,5 +43,6 @@
"2": 0, "2": 0,
"3": 1537743641, "3": 1537743641,
"4": 1991772603 "4": 1991772603
} },
"confidential_assets": null
} }

@ -38,5 +38,6 @@
"blockbook": [], "blockbook": [],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -41,5 +41,6 @@
"blockbook": [], "blockbook": [],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -39,5 +39,6 @@
"blockbook": [], "blockbook": [],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -38,5 +38,6 @@
], ],
"negative_fee": false, "negative_fee": false,
"cooldown": 100, "cooldown": 100,
"consensus_branch_id": null "consensus_branch_id": null,
"confidential_assets": null
} }

@ -28,6 +28,7 @@ class CoinInfo:
decred: bool, decred: bool,
negative_fee: bool, negative_fee: bool,
curve_name: str, curve_name: str,
confidential_assets: dict,
): ):
self.coin_name = coin_name self.coin_name = coin_name
self.coin_shortcut = coin_shortcut self.coin_shortcut = coin_shortcut
@ -48,6 +49,7 @@ class CoinInfo:
self.decred = decred self.decred = decred
self.negative_fee = negative_fee self.negative_fee = negative_fee
self.curve_name = curve_name self.curve_name = curve_name
self.confidential_assets = confidential_assets
if curve_name == "secp256k1-groestl": if curve_name == "secp256k1-groestl":
self.b58_hash = groestl512d_32 self.b58_hash = groestl512d_32
self.sign_hash_double = False self.sign_hash_double = False
@ -96,6 +98,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Testnet": elif name == "Testnet":
return CoinInfo( return CoinInfo(
@ -118,6 +121,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Actinium": elif name == "Actinium":
return CoinInfo( return CoinInfo(
@ -140,6 +144,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Axe": elif name == "Axe":
return CoinInfo( return CoinInfo(
@ -162,6 +167,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Bellcoin": elif name == "Bellcoin":
return CoinInfo( return CoinInfo(
@ -184,6 +190,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "BitCash": elif name == "BitCash":
return CoinInfo( return CoinInfo(
@ -206,6 +213,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Bitgreen": elif name == "Bitgreen":
return CoinInfo( return CoinInfo(
@ -228,6 +236,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "BitZeny": elif name == "BitZeny":
return CoinInfo( return CoinInfo(
@ -250,6 +259,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Bitcloud": elif name == "Bitcloud":
return CoinInfo( return CoinInfo(
@ -272,6 +282,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Bcash": elif name == "Bcash":
return CoinInfo( return CoinInfo(
@ -294,6 +305,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Bcash Testnet": elif name == "Bcash Testnet":
return CoinInfo( return CoinInfo(
@ -316,6 +328,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Bgold": elif name == "Bgold":
return CoinInfo( return CoinInfo(
@ -338,6 +351,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Bgold Testnet": elif name == "Bgold Testnet":
return CoinInfo( return CoinInfo(
@ -360,6 +374,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Bprivate": elif name == "Bprivate":
return CoinInfo( return CoinInfo(
@ -382,6 +397,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Brhodium": elif name == "Brhodium":
return CoinInfo( return CoinInfo(
@ -404,6 +420,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Bitcore": elif name == "Bitcore":
return CoinInfo( return CoinInfo(
@ -426,6 +443,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Bitsend": elif name == "Bitsend":
return CoinInfo( return CoinInfo(
@ -448,6 +466,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "BlockStamp": elif name == "BlockStamp":
return CoinInfo( return CoinInfo(
@ -470,6 +489,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "CPUchain": elif name == "CPUchain":
return CoinInfo( return CoinInfo(
@ -492,6 +512,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Capricoin": elif name == "Capricoin":
return CoinInfo( return CoinInfo(
@ -514,6 +535,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Dash": elif name == "Dash":
return CoinInfo( return CoinInfo(
@ -536,6 +558,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Dash Testnet": elif name == "Dash Testnet":
return CoinInfo( return CoinInfo(
@ -558,6 +581,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Decred": elif name == "Decred":
return CoinInfo( return CoinInfo(
@ -580,6 +604,7 @@ def by_name(name: str) -> CoinInfo:
decred=True, decred=True,
negative_fee=False, negative_fee=False,
curve_name='secp256k1-decred', curve_name='secp256k1-decred',
confidential_assets=None,
) )
elif name == "Decred Testnet": elif name == "Decred Testnet":
return CoinInfo( return CoinInfo(
@ -602,6 +627,7 @@ def by_name(name: str) -> CoinInfo:
decred=True, decred=True,
negative_fee=False, negative_fee=False,
curve_name='secp256k1-decred', curve_name='secp256k1-decred',
confidential_assets=None,
) )
elif name == "Denarius": elif name == "Denarius":
return CoinInfo( return CoinInfo(
@ -624,6 +650,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "DigiByte": elif name == "DigiByte":
return CoinInfo( return CoinInfo(
@ -646,6 +673,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Dogecoin": elif name == "Dogecoin":
return CoinInfo( return CoinInfo(
@ -668,6 +696,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Elements": elif name == "Elements":
return CoinInfo( return CoinInfo(
@ -690,6 +719,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets={'address_prefix': 4, 'blech32_prefix': 'el'},
) )
elif name == "FairCoin": elif name == "FairCoin":
return CoinInfo( return CoinInfo(
@ -712,6 +742,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Feathercoin": elif name == "Feathercoin":
return CoinInfo( return CoinInfo(
@ -734,6 +765,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Florincoin": elif name == "Florincoin":
return CoinInfo( return CoinInfo(
@ -756,6 +788,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Fujicoin": elif name == "Fujicoin":
return CoinInfo( return CoinInfo(
@ -778,6 +811,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Gincoin": elif name == "Gincoin":
return CoinInfo( return CoinInfo(
@ -800,6 +834,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "GameCredits": elif name == "GameCredits":
return CoinInfo( return CoinInfo(
@ -822,6 +857,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Groestlcoin": elif name == "Groestlcoin":
return CoinInfo( return CoinInfo(
@ -844,6 +880,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1-groestl', curve_name='secp256k1-groestl',
confidential_assets=None,
) )
elif name == "Groestlcoin Testnet": elif name == "Groestlcoin Testnet":
return CoinInfo( return CoinInfo(
@ -866,6 +903,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1-groestl', curve_name='secp256k1-groestl',
confidential_assets=None,
) )
elif name == "Horizen": elif name == "Horizen":
return CoinInfo( return CoinInfo(
@ -888,6 +926,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Komodo": elif name == "Komodo":
return CoinInfo( return CoinInfo(
@ -910,6 +949,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=True, negative_fee=True,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Koto": elif name == "Koto":
return CoinInfo( return CoinInfo(
@ -932,6 +972,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Litecoin": elif name == "Litecoin":
return CoinInfo( return CoinInfo(
@ -954,6 +995,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Litecoin Testnet": elif name == "Litecoin Testnet":
return CoinInfo( return CoinInfo(
@ -976,6 +1018,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Megacoin": elif name == "Megacoin":
return CoinInfo( return CoinInfo(
@ -998,6 +1041,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Monacoin": elif name == "Monacoin":
return CoinInfo( return CoinInfo(
@ -1020,6 +1064,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "MonetaryUnit": elif name == "MonetaryUnit":
return CoinInfo( return CoinInfo(
@ -1042,6 +1087,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Myriad": elif name == "Myriad":
return CoinInfo( return CoinInfo(
@ -1064,6 +1110,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "NIX": elif name == "NIX":
return CoinInfo( return CoinInfo(
@ -1086,6 +1133,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Namecoin": elif name == "Namecoin":
return CoinInfo( return CoinInfo(
@ -1108,6 +1156,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "PIVX": elif name == "PIVX":
return CoinInfo( return CoinInfo(
@ -1130,6 +1179,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "PIVX Testnet": elif name == "PIVX Testnet":
return CoinInfo( return CoinInfo(
@ -1152,6 +1202,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Particl": elif name == "Particl":
return CoinInfo( return CoinInfo(
@ -1174,6 +1225,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Particl Testnet": elif name == "Particl Testnet":
return CoinInfo( return CoinInfo(
@ -1196,6 +1248,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Pesetacoin": elif name == "Pesetacoin":
return CoinInfo( return CoinInfo(
@ -1218,6 +1271,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Polis": elif name == "Polis":
return CoinInfo( return CoinInfo(
@ -1240,6 +1294,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Primecoin": elif name == "Primecoin":
return CoinInfo( return CoinInfo(
@ -1262,6 +1317,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Qtum": elif name == "Qtum":
return CoinInfo( return CoinInfo(
@ -1284,6 +1340,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Qtum Testnet": elif name == "Qtum Testnet":
return CoinInfo( return CoinInfo(
@ -1306,6 +1363,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Ravencoin": elif name == "Ravencoin":
return CoinInfo( return CoinInfo(
@ -1328,6 +1386,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Regtest": elif name == "Regtest":
return CoinInfo( return CoinInfo(
@ -1350,6 +1409,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Ritocoin": elif name == "Ritocoin":
return CoinInfo( return CoinInfo(
@ -1372,6 +1432,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "SmartCash": elif name == "SmartCash":
return CoinInfo( return CoinInfo(
@ -1394,6 +1455,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1-smart', curve_name='secp256k1-smart',
confidential_assets=None,
) )
elif name == "SmartCash Testnet": elif name == "SmartCash Testnet":
return CoinInfo( return CoinInfo(
@ -1416,6 +1478,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1-smart', curve_name='secp256k1-smart',
confidential_assets=None,
) )
elif name == "Stakenet": elif name == "Stakenet":
return CoinInfo( return CoinInfo(
@ -1438,6 +1501,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "VIPSTARCOIN": elif name == "VIPSTARCOIN":
return CoinInfo( return CoinInfo(
@ -1460,6 +1524,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Vertcoin": elif name == "Vertcoin":
return CoinInfo( return CoinInfo(
@ -1482,6 +1547,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Viacoin": elif name == "Viacoin":
return CoinInfo( return CoinInfo(
@ -1504,6 +1570,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "ZClassic": elif name == "ZClassic":
return CoinInfo( return CoinInfo(
@ -1526,6 +1593,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Zcash": elif name == "Zcash":
return CoinInfo( return CoinInfo(
@ -1548,6 +1616,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Zcash Testnet": elif name == "Zcash Testnet":
return CoinInfo( return CoinInfo(
@ -1570,6 +1639,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Zcoin": elif name == "Zcoin":
return CoinInfo( return CoinInfo(
@ -1592,6 +1662,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "Zcoin Testnet": elif name == "Zcoin Testnet":
return CoinInfo( return CoinInfo(
@ -1614,6 +1685,7 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
elif name == "ZelCash": elif name == "ZelCash":
return CoinInfo( return CoinInfo(
@ -1636,5 +1708,6 @@ def by_name(name: str) -> CoinInfo:
decred=False, decred=False,
negative_fee=False, negative_fee=False,
curve_name='secp256k1', curve_name='secp256k1',
confidential_assets=None,
) )
raise ValueError('Unknown coin name "%s"' % name) raise ValueError('Unknown coin name "%s"' % name)

@ -28,6 +28,7 @@ class CoinInfo:
decred: bool, decred: bool,
negative_fee: bool, negative_fee: bool,
curve_name: str, curve_name: str,
confidential_assets: dict,
): ):
self.coin_name = coin_name self.coin_name = coin_name
self.coin_shortcut = coin_shortcut self.coin_shortcut = coin_shortcut
@ -48,6 +49,7 @@ class CoinInfo:
self.decred = decred self.decred = decred
self.negative_fee = negative_fee self.negative_fee = negative_fee
self.curve_name = curve_name self.curve_name = curve_name
self.confidential_assets = confidential_assets
if curve_name == "secp256k1-groestl": if curve_name == "secp256k1-groestl":
self.b58_hash = groestl512d_32 self.b58_hash = groestl512d_32
self.sign_hash_double = False self.sign_hash_double = False
@ -79,6 +81,11 @@ def hexfmt(x):
else: else:
return "0x{:08x}".format(x) return "0x{:08x}".format(x)
def optional_dict(x):
if x is None:
return None
return dict(x)
ATTRIBUTES = ( ATTRIBUTES = (
("coin_name", lambda _: "name"), ("coin_name", lambda _: "name"),
("coin_shortcut", black_repr), ("coin_shortcut", black_repr),
@ -99,6 +106,7 @@ ATTRIBUTES = (
("decred", bool), ("decred", bool),
("negative_fee", bool), ("negative_fee", bool),
("curve_name", lambda r: repr(r.replace("_", "-"))), ("curve_name", lambda r: repr(r.replace("_", "-"))),
("confidential_assets", optional_dict),
) )
%>\ %>\
def by_name(name: str) -> CoinInfo: def by_name(name: str) -> CoinInfo:

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save