{"id":37056387,"url":"https://github.com/baking-bad/beacon-dotnet-sdk","last_synced_at":"2026-01-14T06:22:12.988Z","repository":{"id":43286182,"uuid":"353698815","full_name":"baking-bad/beacon-dotnet-sdk","owner":"baking-bad","description":"Beacon .NET SDK for Tezos wallet developers to seamlessly connect to multiple dApps","archived":false,"fork":false,"pushed_at":"2023-06-26T18:15:15.000Z","size":907,"stargazers_count":12,"open_issues_count":1,"forks_count":7,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-04T01:42:43.076Z","etag":null,"topics":["beacon-sdk","interaction","tezos","wallet"],"latest_commit_sha":null,"homepage":"https://www.nuget.org/packages/Beacon.Sdk","language":"C#","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/baking-bad.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}},"created_at":"2021-04-01T12:51:04.000Z","updated_at":"2023-09-29T19:12:23.000Z","dependencies_parsed_at":"2023-02-11T22:01:56.435Z","dependency_job_id":null,"html_url":"https://github.com/baking-bad/beacon-dotnet-sdk","commit_stats":null,"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"purl":"pkg:github/baking-bad/beacon-dotnet-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baking-bad%2Fbeacon-dotnet-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baking-bad%2Fbeacon-dotnet-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baking-bad%2Fbeacon-dotnet-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baking-bad%2Fbeacon-dotnet-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/baking-bad","download_url":"https://codeload.github.com/baking-bad/beacon-dotnet-sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baking-bad%2Fbeacon-dotnet-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28412209,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T05:26:33.345Z","status":"ssl_error","status_checked_at":"2026-01-14T05:21:57.251Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["beacon-sdk","interaction","tezos","wallet"],"created_at":"2026-01-14T06:22:12.551Z","updated_at":"2026-01-14T06:22:12.981Z","avatar_url":"https://github.com/baking-bad.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **Beacon .NET SDK**\n\n![beacon-logo](beacon-logo.svg)\n\n[Beacon](https://walletbeacon.io) is the implementation of the wallet interaction\nstandard [tzip-10](https://gitlab.com/tzip/tzip/blob/master/proposals/tzip-10/tzip-10.md) which describes the\nconnnection of a dApp with a wallet.\n\n## Supported Platforms\n\n* .NET Standard 2.1\n\n## Installation\n\nBeacon .NET SDK is [available on NuGet](https://www.nuget.org/packages/Beacon.Sdk/):\n\n```\ndotnet add package Beacon.Sdk\n```\n\n## Usage\n\nFor a complete example, refer\nto [`Dapp sample`](https://github.com/baking-bad/beacon-dotnet-sdk/blob/main/Beacon.Sdk.Sample.Dapp/Sample.cs)\nor to [`Wallet sample`](https://github.com/baking-bad/beacon-dotnet-sdk/blob/main/Beacon.Sdk.Sample.Wallet/Sample.cs).\n\n### Wallet workflow\n\nHere is step by step **guide** how to create and use `WalletBeaconClient`:\n\n#### 1. Create\n\nUse `BeaconClientFactory` to create an instance of `WalletBeaconClient`\n\n```cs\nconst string path = \"wallet-beacon-sample.db\";\n\nvar factory = new WalletBeaconClientFactory();\n\nvar options = new BeaconOptions\n{\n    AppName = \"Wallet sample\",\n    AppUrl = \"https://awesome-wallet.io\",\n    IconUrl = \"https://services.tzkt.io/v1/avatars/KT1TxqZ8QtKvLu3V3JH7Gx58n7Co8pgtpQU5\",\n    KnownRelayServers = Constants.KnownRelayServers,\n\n    // for some operating systems compability reasons we should use Mode=Exclusive for LiteDB.\n    DatabaseConnectionString = RuntimeInformation.IsOSPlatform(OSPlatform.Windows)\n        ? $\"Filename={path}; Connection=Shared;\"\n        : $\"Filename={path}; Mode=Exclusive;\"\n};\n\n// creating test logger, you can provide your own app-context logger here.\nLogger = new LoggerConfiguration()\n    .MinimumLevel.Information()\n    .WriteTo.Console()\n    .CreateLogger();\n\nILoggerProvider loggerProvider = new SerilogLoggerProvider(Logger);\n\nIWalletBeaconClient beaconWalletClient = BeaconClientFactory.Create\u003cIWalletBeaconClient\u003e(options, loggerProvider);\n```\n\n#### 2. Start listening for incoming events\n\nTo listen for the incoming Beacon messages you need to subscribe to `OnBeaconMessageReceived;`\n\n```cs\nbeaconWalletClient.OnBeaconMessageReceived += async (object? sender, BeaconMessageEventArgs args) =\u003e\n{\n    BaseBeaconMessage message = args.Request;\n    if (message == null) return;\n\n    case BeaconMessageType.permission_request:\n    {\n        if (message is not PermissionRequest permissionRequest)\n            return;\n\n        // here we give all permissions that dApp request, you can modify permissionRequest.Scopes\n        var response = new PermissionResponse(\n            id: permissionRequest.Id,\n            senderId: beaconWalletClient.SenderId,\n            appMetadata: beaconWalletClient.Metadata,\n            network: permissionRequest.Network,\n            scopes: permissionRequest.Scopes,\n            publicKey: \"your tezos wallet address public key\",\n            version: permissionRequest.Version);\n            \n        await beaconWalletClient.SendResponseAsync(receiverId: permissionRequest.SenderId, response);\n        break;\n    }\n\n    case BeaconMessageType.sign_payload_request:\n    {\n        if (message is not SignPayloadRequest signRequest)\n            return;\n\n        // do some stuff here and send response. \n        break;\n    }\n\n    case BeaconMessageType.operation_request:\n    {\n        if (message is not OperationRequest operationRequest)\n            return;\n\n        // do some stuff here and send response. \n        break;\n    }\n\n    default:\n    {\n        var error = new BeaconAbortedError(\n            id: KeyPairService.CreateGuid(),\n            senderId: beaconWalletClient.SenderId);\n\n        await beaconWalletClient.SendResponseAsync(receiverId: message.SenderId, error);\n        break;\n    }\n};\n```\n\nYou can also subscribe to\n\n```cs\nbeaconWalletClient.OnConnectedClientsListChanged += (object sender, ConnectedClientsListChangedEventArgs e) =\u003e {}\n```\n\nThis event is triggered at the moments of issuing permissions or disconnecting peers, it's good to change your\nconnected apps list here.\n\nI recommend that you don't use anonymous functions to subscribe to events if you have to unsubscribe from the event at\nsome later point in your code.\n\n#### 3. Init\n\n```cs\nawait beaconWalletClient.InitAsync()\n```\n\n#### 4. Connect\n\n```cs\nbeaconWalletClient.Connect();\n```\n\n#### 5. Add Peer\n\n```cs\nstring pairingQrCode = \"paste-qrcode-here\";\n\nvar pairingRequest = beaconWalletClient.GetPairingRequest(pairingQrCode);\nawait beaconWalletClient.AddPeerAsync(pairingRequest);\n```\n\n#### 6. Disconnect\n\n```cs\nbeaconWalletClient.Disconnect();\n```\n\n### Wallet demo\n\nFollow these steps to reproduce the typical wallet workflow:\n\n1. Clone this repo and restore nuget packages\n2. Open Beacon [playground](https://docs.walletbeacon.io/getting-started/first-dapp#setup), scroll to Setup and press \"\n   Run Code\"\n3. Choose \"Pair wallet on another device\" and click on the QR code to copy\n4. Start `Beacon.Sdk.Sample.Wallet` sample project (`make wallet-sample`)\n5. Paste copied QR code to console\n6. In the browser you should see \"Got permissions\" message, sample project response with all requested permissions to\n   dApp\n7. Scroll down to \"Operation Request\" item and do the \"Run Code\" thing again\n8. You should see the successful operation message\n\nTake a look at the [`Wallet sample`](https://github.com/baking-bad/beacon-dotnet-sdk/blob/main/Beacon.Sdk.Sample.Wallet/Sample.cs) project.\n\n### Dapp workflow\n\nHere is step by step **guide** how to create and use `DappBeaconClient`:\n\n#### 1. Create\n\nUse `BeaconClientFactory` to create an instance of `DappBeaconClient`\n\n```cs\nIDappBeaconClient beaconDappClient = BeaconClientFactory.Create\u003cIDappBeaconClient\u003e(options, loggerProvider);\n```\n\nOptions are same as during `WalletBeaconClient` creation\n\n#### 2. Start listening for incoming events\n\nTo listen for the incoming responses from wallet you need to subscribe to `OnBeaconMessageReceived`\n\n```cs\nbeaconDappClient.OnBeaconMessageReceived += async (object? sender, BeaconMessageEventArgs args) =\u003e\n{\n     if (args.PairingDone)\n     {\n         var network = new Network\n         {\n             Type = NetworkType.mainnet,\n             Name = \"mainnet\",\n             RpcUrl = \"https://rpc.tzkt.io/mainnet\"\n         };\n\n         var permissionScopes = new List\u003cPermissionScope\u003e\n         {\n             PermissionScope.operation_request,\n             PermissionScope.sign\n         };\n\n         // after pairing complete we request permissions from wallet\n         await BeaconDappClient.RequestPermissions(permissionScopes, network);\n         return;\n     }\n     \n     var message = args.Request;\n     if (message == null) return;\n     \n     // almost like as in WalletClient, but we receiving Reponses here and sending Requests\n     switch (message.Type)\n     {\n         case BeaconMessageType.permission_response:\n         {\n             if (message is not PermissionResponse)\n                 return;\n                 \n             // do some stuff here and send response.\n             break;\n         }\n         \n         case BeaconMessageType.operation_response:\n         // ...\n         \n         case BeaconMessageType.sign_payload_response:\n         // ...\n     }\n};\n```\n\n`OnConnectedClientsListChanged` also available as in `DappBeaconClient`. They both inherited from `BaseBeaconClient`\nclass\n\n#### 3. Init\n\n```cs\nawait beaconDappClient.InitAsync()\n```\n\n#### 4. Connect\n\n```cs\nbeaconDappClient.Connect();\n```\n\n#### 5. Get pairing request data if we need pairing\n\n```cs\nvar pairingRequestQrData = beaconDappClient.GetPairingRequestInfo();\n```\n\nCopy `pairingRequestQrData` and paste it to Beacon wallet\n\n#### 6. Try get active account\n\n```cs\nvar activeAccountPermissions = beaconDappClient.GetActiveAccount();\n```\n\n#### 7. If active account is not null we can\n\n```cs\nbeaconDappClient.RequestPermissions(permissionScopes, network);\nbeaconDappClient.RequestSign(PayloadToSign, SignPayloadType.raw);\nbeaconDappClient.RequestOperation(operationDetails);\n```\n\n#### 8. Disconnect\n\n```cs\nbeaconDappClient.Disconnect();\n```\n\n### Dapp demo\n\nFollow these steps to reproduce a typical dapp workflow:\n\n1. Clone this repo and restore nuget packages\n2. Start `Beacon.Sdk.Sample.Dapp` project (`make dapp-sample`)\n3. Go to https://debug.walletbeacon.io/ and create account (or connect your wallet)\n4. Copy pairing data string from console, paste it to the site, and press \"Connect\"\n5. You should see that Beacon wallet received permissions from `Beacon.Sdk.Sample.Dapp` (\"Messages\" section)\n6. You can print `sign` command in console to send `sign request` to the wallet\n7. You can print `operation` command in console to send `operation request` to the wallet\n\nTake a look at the [`Dapp sample`](https://github.com/baking-bad/beacon-dotnet-sdk/blob/main/Beacon.Sdk.Sample.Dapp/Sample.cs) project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaking-bad%2Fbeacon-dotnet-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbaking-bad%2Fbeacon-dotnet-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaking-bad%2Fbeacon-dotnet-sdk/lists"}