https://github.com/datachainlab/lcp-solidity
https://github.com/datachainlab/lcp-solidity
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/datachainlab/lcp-solidity
- Owner: datachainlab
- License: apache-2.0
- Created: 2023-09-19T13:04:26.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-12T10:46:14.000Z (about 1 year ago)
- Last Synced: 2025-03-13T03:33:24.635Z (about 1 year ago)
- Language: Solidity
- Size: 688 KB
- Stars: 1
- Watchers: 7
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# lcp-solidity
lcp-solidity is an implementation of [lcp client](https://docs.lcp.network/protocol/lcp-client) in solidity. It can be integrated with [ibc-solidity](https://github.com/hyperledger-labs/yui-ibc-solidity).
An e2e demo is available [here](https://github.com/datachainlab/cosmos-ethereum-ibc-lcp).
**DISCLAIMER: This repository has not been audited yet, so use it at your own risk.**
## Gas cost
- registerEnclaveKey: 500k: first registration in the client or signing key changed(very rare)
- registerEnclaveKey: 160k
- updateState: 71k
- verifyMembership: 15k
- verifyNonMembership: 14k
## How to generate test data
You can find the LCP commitment data for the test in `./test/data`.
Also, you can generate the test data with the following steps:
```
$ git clone https://github.com/datachainlab/lcp-cgen
$ cd ./lcp-cgen
# if execute it under non-sgx environment, you must enable anoption `--features=simulation`
$ cargo build -r --features=simulation
# Example for using RA simulation
$ export LCP_PATH=/path/to/lcp-repo
$ ./target/release/lcp-cgen \
--simulate \
--signing_cert_path=${LCP_PATH}/tests/certs/signing.crt.der \
--signing_key=${LCP_PATH}/tests/certs/signing.key \
--enclave=${LCP_PATH}/bin/enclave.signed.so \
--out=/path/to/testdatadir \
--eknum=1 \
--commands \
wait_blocks:1 \
update_client:0 \
verify_channel:0 \
wait_blocks:1 \
update_client:0 \
verify_packet:0 \
verify_packet_receipt_absence:0
```