{"id":21538327,"url":"https://github.com/rarimo/tss-svc","last_synced_at":"2025-04-10T03:23:54.401Z","repository":{"id":198397155,"uuid":"700324874","full_name":"rarimo/tss-svc","owner":"rarimo","description":"Threshold signature producer service that performs signing of cross chain operations","archived":false,"fork":false,"pushed_at":"2024-09-04T12:22:43.000Z","size":3966,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-09T18:11:05.644Z","etag":null,"topics":["cryptography","ecdsa","go","threshold-signature"],"latest_commit_sha":null,"homepage":"https://rarimo.github.io/tss-svc/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rarimo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-04T11:36:45.000Z","updated_at":"2024-09-04T12:22:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"6f345257-b246-4188-a7db-0f57fafb1b44","html_url":"https://github.com/rarimo/tss-svc","commit_stats":null,"previous_names":["rarimo/tss-svc"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rarimo%2Ftss-svc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rarimo%2Ftss-svc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rarimo%2Ftss-svc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rarimo%2Ftss-svc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rarimo","download_url":"https://codeload.github.com/rarimo/tss-svc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248149322,"owners_count":21055753,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cryptography","ecdsa","go","threshold-signature"],"created_at":"2024-11-24T04:11:40.569Z","updated_at":"2025-04-10T03:23:54.377Z","avatar_url":"https://github.com/rarimo.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\nlayout: default\ntitle: TSS service\n---\n\n# TSS service\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nThreshold signature service provides the signature for core APPROVED operations. \nIt works as a decentralized solution connected to the core for block timestamp bindings.\n\nThe TSS network requires a several parties launched by different validators that uses stored in the `rarimocore` \nCosmos module party addresses and public keys to connect with each other and produce signature.\n\nFore more information check the [`TSS Overview`](./index.md).\n\n## V1.0.6 Upgrade information\n\nWith `v1.0.6` the binance [`tss-lib`](https://github.com/rarimo/tss-lib) was upgraded to the `v2.0.1`. \nThe v2 version comes with the new pre-params structure. It does not affect the signing process, but \nit will cause an error during the next keygen session if you are using old params.\n\nTo avoid the errors in case you are already running the party, \nyou have to generate new pre-params and manually update the `pre` field in Vault. After setting new field data, \nplease restart the tss party service.\n\nFor more information, check: [`changes-of-preparams-of-ecdsa-in-v20`](https://github.com/rarimo/tss-lib#changes-of-preparams-of-ecdsa-in-v20).\n\n## Build\n\nRequired environment:\n```shell\nexport CGO_ENABLED=1\n```\n\nBuild command (in repository root):\n```shell\ngo build .\n```\n\n## Launch\n\n### Generate TSS account:\n  ```shell\n  rarimo-core keys add \u003ckey-name\u003e --keyring-backend test --home=$TSS_HOME\n  ```\n(it is recommended to generate the new one and do not use it in other services).\n\nAlso, you need to parse mnemonic to get corresponding private key:\n  ```shell\n  rarimo-core tx rarimocore parse-mnemonic 'mnemonic phrase'\n  ```\n\n### Pre-setup secret parameters:\n  ```shell\n  tss-svc run paramgen\n  ```\nexecute and save the response JSON.\n\n### Generate trial ECDSA private key:\n  ```shell\n  tss-svc run prvgen\n  ```\nexecute and store results.\n\n### Setup the Hashicorp Vault and create secret for your tss (type KV version 2):\n\nSecret should contain the following credentials:\n\n* \"data\": \"Leave empty\"\n\n* \"pre\": \"Generated pre params JSON\"\n\n* \"account\": \"Your Rarimo account hex key\"\n\n* \"trial\": \"Generated Trial ECDSA private key hex\"\n\nJSON example:\n  ```json\n  {\n    \"tls\": true,\n    \"data\": \"\",\n    \"pre\": \"pre-generated-secret-data\",\n    \"account\": \"rarimo-account-private-key-hex-leading-0x\",\n    \"trial\": \"trial-ecdsa-private-key-hex-leading-0x\"\n  }\n  ```\n\n### Create a configuration file (config.yaml) with the following structure:\n\n  ```yaml\n  log:\n    disable_sentry: true\n    level: debug\n\n  ## PostreSQL connection\n\n  db:\n    url: \"postgres://tss:tss@tss-2-db:5432/tss?sslmode=disable\"\n\n  ## Port to listen for incoming GRPC requests\n\n  listener:\n    addr: :9000\n\n  ## Core connections\n\n  core:\n    addr: tcp://validator:26657\n\n  cosmos:\n    addr: validator:9090\n\n  ## Session configuration (should be the same for all services accross the system)\n\n  session:\n    start_block: 15\n    start_session_id: 1\n\n  ## Swagger doc configuration\n\n  swagger:\n    addr: :1313\n    enabled: false\n\n  ## Chain configuration\n\n  chain:\n    chain_id: \"rarimo_201411-2\"\n    coin_name: \"urmo\"\n  ```\n\n### Set up host environment:\n  ```yaml\n    - name: KV_VIPER_FILE\n    value: /config/config.yaml # is the path to your config file\n    - name: VAULT_PATH\n    value: http://vault-internal:8200 # your vault endpoint\n    - name: VAULT_TOKEN\n    value: \"\" # your vault token (\"root\"/\"read/write\")\n    - name: MOUNT_PATH\n    value: secret\n    - name: SECRET_PATH\n    value: tss1 # name of the secret path vault (type KV version 2)\n  ```\n\n### Running service:\n  ```shell\n  tss-svc migrate up \u0026\u0026 tss-svc run service\n  ```\n\nExample of docker-compose file:\n  ```yaml\n  tss-1:\n    image: registry.github.com/rarimo/tss-svc:v1.0.3\n    restart: on-failure\n    depends_on:\n      - tss-1-db\n    ports:\n      - \"9001:9000\"\n      - \"1313:1313\"\n    volumes:\n      - ./config/tss/tss1.yaml:/config.yaml\n    environment:\n      - KV_VIPER_FILE=/config.yaml\n      - VAULT_PATH=http://vault:8200\n      - VAULT_TOKEN=dev-only-token\n      - MOUNT_PATH=secret\n      - SECRET_PATH=tss1\n    entrypoint: sh -c \"tss-svc migrate up \u0026\u0026 tss-svc run service\"\n\n  tss-1-db:\n    image: postgres:13\n    restart: unless-stopped\n    environment:\n      - POSTGRES_USER=tss\n      - POSTGRES_PASSWORD=tss\n      - POSTGRES_DB=tss\n      - PGDATA=/pgdata\n    volumes:\n      - tss-1-data:/pgdata\n  ```\n\n### Stake tokens to become an active party:\n  ```shell\n  rarimo-core tx rarimocore stake [tss-account-addr] [tss url] [trial ECDSA pub key] --from $ADDRESS --chain-id rarimo-201411-2 --home=$RARIMO_HOME --keyring-backend=test --fees 0urmo --node=$RARIMO_NODE\n  ```\n\nYou can stake tokens directly from your TSS account or by any other account that has enough funds.\nCurrently, to become an active party you will need exactly 100000000000urmo tokens (100000 RMO).\n\nAfter some period your TSS will generate new keys with other active parties and become an active party.\n\n### Unstake tokens (from tss account or delegator account):\n```shell\nrarimo-cored tx rarimocore unstake [tss-account-addr] --from $ADDRESS --chain-id rarimo-201411-2 --home=$RARIMO_HOME --keyring-backend=test --fees 0urmo --node=$RARIMO_NODE\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frarimo%2Ftss-svc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frarimo%2Ftss-svc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frarimo%2Ftss-svc/lists"}