{"id":40198757,"url":"https://github.com/fabianbormann/cip-0045-demo-implementation","last_synced_at":"2026-01-19T20:07:56.302Z","repository":{"id":69442089,"uuid":"573084086","full_name":"fabianbormann/cip-0045-demo-implementation","owner":"fabianbormann","description":"This is a demo implementation of CIP-0045 that uses cardano-peer-connect","archived":false,"fork":false,"pushed_at":"2025-02-24T20:10:49.000Z","size":2344,"stargazers_count":9,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-02-24T21:23:32.260Z","etag":null,"topics":["connection","dapp","p2p","torrent-tracker","wallet","webrtc"],"latest_commit_sha":null,"homepage":"https://github.com/cardano-foundation/CIPs/pull/395","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fabianbormann.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":"2022-12-01T17:00:18.000Z","updated_at":"2025-02-24T20:10:53.000Z","dependencies_parsed_at":"2025-02-24T21:21:20.417Z","dependency_job_id":"5e5371f2-4c77-4fd2-8b27-cec9c6404a69","html_url":"https://github.com/fabianbormann/cip-0045-demo-implementation","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fabianbormann/cip-0045-demo-implementation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabianbormann%2Fcip-0045-demo-implementation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabianbormann%2Fcip-0045-demo-implementation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabianbormann%2Fcip-0045-demo-implementation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabianbormann%2Fcip-0045-demo-implementation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fabianbormann","download_url":"https://codeload.github.com/fabianbormann/cip-0045-demo-implementation/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabianbormann%2Fcip-0045-demo-implementation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28583649,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T19:46:29.903Z","status":"ssl_error","status_checked_at":"2026-01-19T19:45:54.560Z","response_time":67,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["connection","dapp","p2p","torrent-tracker","wallet","webrtc"],"created_at":"2026-01-19T20:07:55.561Z","updated_at":"2026-01-19T20:07:56.294Z","avatar_url":"https://github.com/fabianbormann.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CIP-0045 Demo Implementation\n\nThis is a demo implementation of [CIP-0045](https://github.com/cardano-foundation/CIPs/pull/395) that uses [cardano-peer-connect](https://github.com/fabianbormann/cardano-peer-connect).\n\n\u003cimg src=\"https://user-images.githubusercontent.com/1525818/209772566-54ac650b-efb2-4f84-8f7b-eaeedb6f5f90.gif\" width=\"600\" /\u003e\n\n## Getting Started\n\n### Run the Server (aka the dApp)\n\nOpen the [dApp.html](./dApp.html) file and your dev tools to see the console log outputs.\n\n### Explanation\n\nThe server (dApp) is just a blank VSCode HTML5 template with the following changes:\n\n1. Import cardano-peer-connect in the header\n\n```html\n\u003cscript src=\"https://fabianbormann.github.io/cardano-peer-connect/latest/index.js\"\u003e\u003c/script\u003e\n```\n\n2. Create a new DAppPeerConnect instance, plot the QR code and print the address (identifier)\n\n```html\n\u003cscript\u003e\n  const dAppInfo = {\n    name: 'My awesome DApp',\n    url: 'http://my-awesome-dapp-url.tld/'\n  }\n\n  // Define a function that will be called when the client tries to connect to your DApp.\n  const verifyConnection = (\n    walletInfo,\n    callback\n  ) =\u003e {\n    callback(\n      window.confirm(`Do you want to connect to wallet ${walletInfo.name} (${walletInfo.address})?`)\n    );\n  }\n\n  const onApiInject = (api) =\u003e {\n    console.log('API injected:', api);\n  };\n\n  const onApiEject = () =\u003e {\n    console.log('API ejected');\n  };\n\n  const dAppConnect = new CardanoPeerConnect.DAppPeerConnect({\n    dAppInfo: dAppInfo,\n    verifyConnection: verifyConnection,\n    onApiInject: onApiInject, // will be call when api was successfully injected\n    onApiEject: onApiEject,   // will be call when api was ejected\n  });\n  \n  dAppConnect.generateQRCode(document.getElementById('qr-code'));\n  document.getElementById('address').innerText = dAppConnect.getAddress();\n\u003c/script\u003e\n```\n\nThe DAppPeerConnect instance is now waiting for clients to connect. It provides api rpc methods under the hood to allow a client to connect and inject it's api to the global window object.\n\n## Client (aka Wallet App)\n\n### Run the Client\n\n```zsh\ncd demo-wallet-app\nnpm i\nnpm start\n```\n\n#### Testing (PoC)\n\nOnce you have the server and client running you should see something like\n\n```js\n[info] [Meerkat]: injected api of boostwallet into window.cardano\n```\n\nin your dApp logs. Now you can issue\n\n```js\nwindow.cardano.boostwallet\n  .getRewardAddresses()\n  .then((result) =\u003e console.log(result));\n```\n\nto execute the remote call and get the reward address from your Wallet (dApp.html).\n\n### Explanation\n\nThe wallet app is actually the result of:\n\n1. The blank ionic react template with cardano-peer-connect as an additional npm package\n\n```zsh\nionic start demo-wallet-app blank --type react\ncd demo-wallet-app\nnpm i @fabianbormann/cardano-peer-connect\n```\n\n2. An Implementation of the abstract class `CardanoPeerConnect` within [BoostPeerConnect.tsx](./demo-wallet-app/src/BoostPeerConnect.tsx) (feel free to adjust the name to e.g. `[MyWalletName]PeerConnect`)\n\n3. BoostPeerConnect is now ready to use. Please see the example usage in [Home.tsx](./demo-wallet-app/src/pages/Home.tsx)\n\n```ts\nimport { BoostPeerConnect } from '../BoostPeerConnect';\n\n...\n\nconst connectWithDApp = () =\u003e {\n  const seed = boostPeerConnect.current.connect(\n    dAppIdentifier,\n    [\n      'wss://dev.btt.cf-identity-wallet.metadata.dev.cf-deployments.org',\n      'wss://tracker.files.fm:7073/announce',\n      'wss://tracker.btorrent.xyz',\n      'ws://tracker.files.fm:7072/announce',\n      'wss://tracker.openwebtorrent.com:443/announce',\n    ],\n    localStorage.getItem('meerkat-boostwallet-seed')\n  );\n  localStorage.setItem('meerkat-boostwallet-seed', seed);\n};\n\nreturn (\n...\n  \u003cIonInput\n    onIonChange={(event) =\u003e\n      setDAppIdentifier(`${event.target.value}`)\n    }\n    placeholder=\"dApp identifier\"\n  \u003e\u003c/IonInput\u003e\n  ...\n  \u003cIonButton onClick={connectWithDApp} fill=\"solid\"\u003e\n    Connect\n  \u003c/IonButton\u003e\n...\n)\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabianbormann%2Fcip-0045-demo-implementation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffabianbormann%2Fcip-0045-demo-implementation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabianbormann%2Fcip-0045-demo-implementation/lists"}