sgkim126 on master
Bug fix in on_request_commit_me… (compare)
Current DEX protocols have solved problems wrt to the risk of accidentally losing users custody due to security breaches. But two big issues remain unsolved. 1) centralized listing/delisting processes and 2) front-running issues due to the decentralized and transparent nature.
I and @joojis designed a new protocol, named CodeChain DEX protocol, that solves both of these problems. CodeChain DEX has a delegation system that encourages stakeholders to list assets that are in great demand and delist assets that are in poor demand. In addition, CodeChain DEX adopts time-release cryptography and ID-based encryption to prevent front-running attacks. Our commit-reveal scheme does not require any interaction between the participants, allowing traders to send orders non-interactively to the network.
Here is the link for the proposal we've written. We're open to new suggestions and ideas. https://research.codechain.io/t/codechain-dex-protocol/30
_______________________________________________ test_from_string_mutisig _______________________________________________
def test_from_string_mutisig():
address = AssetAddress.from_string(
> "tcaqypsyqg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyfzyg3zyg3zyg3zyg3zyg3zyg3zyg3zygsn28hf0"
)
tests/test_AssetAddress.py:61:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
codechain/primitives/AssetAddress.py:80: in from_string
return AssetAddress(address_type, MultiSig(n, m, pubkeys), address)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <codechain.primitives.AssetAddress.AssetAddress object at 0x7f012617fe48>, address_type = 3
payload = MultiSig(n=2, m=1, pubkeys=[b'\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11', b'""""""""""""""""""""'])
address = 'tcaqypsyqg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyfzyg3zyg3zyg3zyg3zyg3zyg3zyg3zygsn28hf0'
def __init__(
self, address_type: int, payload: Union[H160, str, MultiSig], address: str
):
self.address_type = address_type
if isinstance(payload, (H160, str)):
self.payload = H160(payload)
else:
> n, m, pubkeys = payload
E TypeError: 'MultiSig' object is not iterable
codechain/primitives/AssetAddress.py:27: TypeError
__________________________________________ test_from_type_and_payload_mutisig __________________________________________
def test_from_type_and_payload_mutisig():
sig = MultiSig(
2,
1,
[
H160("1111111111111111111111111111111111111111"),
H160("2222222222222222222222222222222222222222"),
],
)
address1 = AssetAddress.from_string(
> "tcaqypsyqg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyfzyg3zyg3zyg3zyg3zyg3zyg3zyg3zygsn28hf0"
)
tests/test_AssetAddress.py:87:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
codechain/primitives/AssetAddress.py:80: in from_string
return AssetAddress(address_type, MultiSig(n, m, pubkeys), address)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <codechain.primitives.AssetAddress.AssetAddress object at 0x7f01263df4e0>, address_type = 3
payload = MultiSig(n=2, m=1, pubkeys=[b'\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11', b'""""""""""""""""""""'])
address = 'tcaqypsyqg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyfzyg3zyg3zyg3zyg3zyg3zyg3zyg3zygsn28hf0'
def __init__(
self, address_type: int, payload: Union[H160, str, MultiSig], address: str
):
self.address_type = address_type
if isinstance(payload, (H160, str)):
self.payload = H160(payload)
else:
> n, m, pubkeys = payload
E TypeError: 'MultiSig' object is not iterable
codechain/primitives/AssetAddress.py:27: TypeError