{"id":19625554,"url":"https://github.com/makemake-kbo/stasis","last_synced_at":"2025-09-10T14:10:01.842Z","repository":{"id":193313986,"uuid":"688515135","full_name":"makemake-kbo/stasis","owner":"makemake-kbo","description":"State channels for layer 2s","archived":false,"fork":false,"pushed_at":"2023-09-07T15:36:45.000Z","size":607,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-24T08:46:48.215Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/makemake-kbo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"licenses/Apache-2.0","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-09-07T14:00:58.000Z","updated_at":"2023-09-07T14:02:15.000Z","dependencies_parsed_at":"2023-09-07T17:15:52.846Z","dependency_job_id":null,"html_url":"https://github.com/makemake-kbo/stasis","commit_stats":null,"previous_names":["makemake-kbo/stasis"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makemake-kbo%2Fstasis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makemake-kbo%2Fstasis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makemake-kbo%2Fstasis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makemake-kbo%2Fstasis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/makemake-kbo","download_url":"https://codeload.github.com/makemake-kbo/stasis/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240926390,"owners_count":19879738,"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":[],"created_at":"2024-11-11T11:42:09.877Z","updated_at":"2025-02-26T19:52:27.517Z","avatar_url":"https://github.com/makemake-kbo.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stasis\n\nState channels for layer 2s.\n\n## What?\n\nThis is an implementation of Stasis in Rust for arbitrum stylus. Stasis is a generic state channel protocol for off chain communication of settlements between distrusting parties.\n\n## Lite-spec\n\nStasis is designed to lock up user funds and release them when a settlement is triggered. For this we first need a funding transaction:\n\n### Funding transaction\n\nThe initial funding transaction contains the addresses of the parties, token amounts, token addresses and signature made by both parties to confirm the opening of a channel. After a channel is opened, the parties can start communicating via off chain messages, known as commitment transactions.\n\n### Commitment transactions\n\nContrary to the Lightning Network, commitment transactions do not represent transactions that can be broadcast to the network and do not include a time lock. A commitment transaction includes the following data:\n```\naddresses and balances of counterparties:\n- balance0(u256)\n- balance1 (u256)\ncommitment tx nonce:\n- nonce (u32)\nsignatures of the specified parameters hashed together:\n- sig0 (bytes32[2])\n- sig1 (bytes32[2])\n```\n\n### Settlement\n\nStasis is fully trustless. Channels can be settled in 2 modes: cooperative and unilateral.\n\n#### Cooperative close\n\nA cooperative close means that both are cooperating during settlement. To initate a cooperative close, the parties must sign a commitment transaction with a nonce of u32::MAX. The commitment tx is then submited on chain and final balances are settled.\n\n#### Unilateral close\n\nIn case a party is not responsive, the other party can initiate a unilateral close. The user would take the commitment transaction with the highest nonce and submit it to the chain. The commitment is then recorded along with a timestamp.  \n\nDue to the potential for fraud, we add a 7 day grace period to allow the other party to respond. If the other party can respond with a higher nonce transaction, the party submitting the unilateral close loses all of their funds which are then transfered to the party submitting the justice transaction.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmakemake-kbo%2Fstasis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmakemake-kbo%2Fstasis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmakemake-kbo%2Fstasis/lists"}