-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from rarimo/update/v1.1.0
Update: v1.1.0
- Loading branch information
Showing
107 changed files
with
6,513 additions
and
1,823 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
before: | ||
hooks: | ||
- go mod tidy | ||
- go mod vendor | ||
|
||
builds: | ||
- id: linux-amd64-build | ||
main: ./cmd/rarimo-cored | ||
binary: rarimo-core | ||
env: | ||
- CGO_ENABLED=1 | ||
goos: | ||
- linux | ||
goarch: | ||
- amd64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,33 +6,47 @@ title: Identity transfers | |
# Identity transfers | ||
|
||
Identity transfers currently implemented in the following way: | ||
- There is an operation type `IDENTITY_DEFAULT_TRANSFER` that should be used to transfer simple state from one chain to another. | ||
|
||
- There are an operation types `IDENTITY_GIST_TRANSFER` and `IDENTITY_STATE_TRANSFER` that have to be used fore | ||
transferring state transitions from one chain to another. | ||
|
||
- An [evm-identity-oracle-svc](https://github.com/rarimo/evm-identity-saver-svc) exists, that is responsible | ||
for delivering information from certain Iden3 state contract into the Rarimo chain. | ||
|
||
- After delivering information about state update, oracles (`evm-identity-saver-svc`) vote for information correctness. | ||
- After delivering information about state or GIST update, oracles (`evm-identity-saver-svc`) vote for information | ||
correctness. | ||
|
||
- After successful voting, the threshold signature producers provides the ECDSA signature for state update information hash. | ||
- After successful voting, the threshold signature producers provides the ECDSA signature for state update information | ||
hash. | ||
|
||
- There is a [modified state smart contracts](https://gitlab.com/rarimo/polygonid/contracts) that accepts state updates with ECDSA signature instead of ZK proof of state update validity. | ||
- There is a [modified state smart contracts](https://github.com/rarimo/polygonid-integration-contracts) that accepts | ||
state updates with ECDSA signature instead of ZK proof of state update validity. | ||
|
||
- Such smart contract should be deployed into every chain that we have to support. | ||
|
||
- The information about state update with its witness (ECDSA signature) can be delivered into modified state smart contracts on the target chain by everyone. | ||
Also, the [relayer service](https://gitlab.com/rarimo/polygonid/relayer-svc/) exists, that tracks new state update operations, their signatures and submits state update transactions to the target chain. | ||
- The information about state update with its witness (ECDSA signature) can be delivered into modified state smart | ||
contracts on the target chain by everyone. | ||
|
||
- Also, the [relayer service](https://github.com/rarimo/identity-relayer-svc) exists, that tracks new state and | ||
GIST update operations, their signatures and submits if requested transactions to the target chain. For the DApp it | ||
can | ||
be used in the following way: | ||
- PolygonID wallet generates on-chain zkp based on information from Polygon chain state smart contact. | ||
- After receiving the proof on your application, using corresponding public signals you can trigger the transfer of | ||
required state and GIST hashes. | ||
|
||
---- | ||
|
||
## Iden3 | ||
|
||
TBD | ||
To explore how the Iden3 protocol works please visit their [documentation](https://docs.iden3.io/). | ||
|
||
---- | ||
|
||
## Identity saver (oracle) | ||
## [Identity saver (oracle)](https://github.com/rarimo/evm-identity-saver-svc) | ||
|
||
In the current implementation the identity saver subscribes to the certain EVM chain state smart contract and tracks the `StateLibStateUpdated` events. | ||
In the current implementation the identity saver subscribes to the certain EVM chain state smart contract and tracks | ||
the `StateLibStateUpdated` events. | ||
|
||
Event definition: | ||
|
||
|
@@ -42,16 +56,16 @@ package main | |
import "math/big" | ||
|
||
type StateLibStateUpdated struct { | ||
Id *big.Int | ||
BlockN *big.Int | ||
Timestamp *big.Int | ||
State *big.Int | ||
Raw types.Log // Blockchain specific contextual infos | ||
Id *big.Int | ||
BlockN *big.Int | ||
Timestamp *big.Int | ||
State *big.Int | ||
Raw types.Log // Blockchain specific contextual infos | ||
} | ||
|
||
``` | ||
|
||
The following configuration .yaml file should be provided to launch your oracle: | ||
The following configuration ___.yaml___ file should be provided to launch your oracle: | ||
|
||
```yaml | ||
log: | ||
|
@@ -102,7 +116,8 @@ state_contract_cfg: | |
After fetching of some event, oracle will create the corresponding transaction and submit it to the Rarimo blockchain. | ||
After transaction appears in Rarimo blockchain all chain oracles have to vote for its correctness. | ||
So they will fetch the information about state update from Rarimo chain, verify it and submit their votes (YES/NO answers). | ||
So they will fetch the information about state update from Rarimo chain, verify it and submit their votes (YES/NO | ||
answers). | ||
For submitting transactions, savers (oracles) uses the [broadcaster-svc](https://github.com/rarimo/broadcaster-svc). | ||
It accepts the transaction by GRPC endpoint, signs it with configured private key and submits it to the Rarimo chain. | ||
|
@@ -135,13 +150,14 @@ cosmos: | |
``` | ||
Explore the simple docker-compose file to run the described services: | ||
```yaml | ||
version: "3.7" | ||
|
||
services: | ||
|
||
broadcaster: | ||
image: registry.github.com/rarimo/broadcaster-svc:v1.0.1 | ||
image: ghcr.io/rarimo/broadcaster-svc:v1.0.2 | ||
restart: unless-stopped | ||
depends_on: | ||
- broadcaster-db | ||
|
@@ -163,47 +179,40 @@ services: | |
- broadcaster-data:/pgdata | ||
|
||
evm-identity-saver: | ||
image: registry.github.com/rarimo/evm-identity-saver-svc:v1.0.2 | ||
image: ghcr.io/rarimo/evm-identity-saver-svc:v1.0.6 | ||
restart: unless-stopped | ||
depends_on: | ||
- broadcaster | ||
- broadcaster | ||
volumes: | ||
- ./config/evm-saver.yaml:/config.yaml | ||
- ./config/evm-saver.yaml:/config.yaml | ||
environment: | ||
- KV_VIPER_FILE=/config.yaml | ||
- KV_VIPER_FILE=/config.yaml | ||
entrypoint: sh -c "evm-identity-saver-svc run state-update-all" | ||
``` | ||
---- | ||
## Relayer service | ||
## [Relayer service](https://github.com/rarimo/identity-relayer-svc) | ||
Relayer service is responsible for fetching information from Rarimo chain about new signatures for `IDENTITY_DEFAULT_TRANSFER` operations. | ||
When the signature has been provided, relayer creates the EVM transaction to the configured smart contract with given signature, merkle path and state information. | ||
|
||
It will be the call to | ||
``` | ||
function signedTransitState( | ||
uint256 prevState_, | ||
uint256 prevGist_, | ||
(uint256,uint256,uint256,uint256,uint256) stateData_, | ||
(uint256,uint256,uint256,uint256) gistData_, | ||
bytes proof_ | ||
) returns() | ||
``` | ||
Relayer service is responsible for fetching information from Rarimo chain about new signatures | ||
for `IDENTITY_GIST_TRANSFER` and `IDENTITY_STATE_TRANSFER` operations. | ||
|
||
The following configuration .yaml file should be provided to launch your raleyer service: | ||
|
||
```yaml | ||
log: | ||
disable_sentry: true | ||
level: debug | ||
## Redis connect information | ||
redis: | ||
addr: redis:6379 | ||
## Password can be empty | ||
password: | ||
# The port to run on | ||
listener: | ||
addr: :8000 | ||
# PostgreSQL DB connect | ||
db: | ||
url: "postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable" | ||
# Rarimo core RPCs | ||
core: | ||
addr: tcp://validator:26657 | ||
|
@@ -223,14 +232,12 @@ evm: | |
chain_id: 1 | ||
relay: | ||
target_chain: "Ethereum" | ||
## Configuration to perform insta submitting (on launch) for any old confirmation from core that contains state update messages. | ||
insta_submit_enabled: false | ||
insta_submit_conf: "" | ||
# Flag the indicates should service iterate over all existing transfer operation and fill the database | ||
catchup_disabled: true | ||
``` | ||
|
||
Explore the simple docker-compose file to run described services: | ||
|
||
```yaml | ||
version: "3.7" | ||
|
@@ -260,10 +267,6 @@ services: | |
|
||
2. Currently, running of your oracle service requires staking of RMO tokens in Rarimo chain. | ||
|
||
3. Oracle service in current implementation supports subscribing only for one certain issuer state updates. (Not relevant with `[email protected]`) | ||
|
||
4. Relayer service in current implementation submits all state updates to the target chain. No filtering for issuer id is provided. | ||
|
||
5. Support of certain smart contract and issuer by oracles requires the voting between all active oracles for that chain. | ||
It means that for your chain all other oracles have to update their configuration to support your smart contract and issuer. | ||
Also, the chain-clone can be added to the Rarimo to split oracle groups. | ||
3. Support of certain smart contract and issuer by oracles requires the voting between all active oracles for that | ||
chain. It means that for your chain all other oracles have to update their configuration to support your smart | ||
contract and issuer. Also, the chain-clone can be added to the Rarimo to split oracle groups. |
Oops, something went wrong.