{"id":38452131,"url":"https://github.com/bolt-observer/go-runes","last_synced_at":"2026-01-17T04:49:02.860Z","repository":{"id":65536801,"uuid":"589616626","full_name":"bolt-observer/go-runes","owner":"bolt-observer","description":"Runes for authentication (like macaroons only simpler) - go implementation","archived":false,"fork":false,"pushed_at":"2023-03-16T13:35:41.000Z","size":31,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2023-08-06T07:54:19.857Z","etag":null,"topics":["bitcoin","cookie","lightning","macaroons","runes"],"latest_commit_sha":null,"homepage":"","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/bolt-observer.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":"2023-01-16T14:39:57.000Z","updated_at":"2023-02-12T17:58:15.000Z","dependencies_parsed_at":"2023-02-15T11:01:19.804Z","dependency_job_id":null,"html_url":"https://github.com/bolt-observer/go-runes","commit_stats":null,"previous_names":[],"tags_count":1,"template":null,"template_full_name":null,"purl":"pkg:github/bolt-observer/go-runes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bolt-observer%2Fgo-runes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bolt-observer%2Fgo-runes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bolt-observer%2Fgo-runes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bolt-observer%2Fgo-runes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bolt-observer","download_url":"https://codeload.github.com/bolt-observer/go-runes/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bolt-observer%2Fgo-runes/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28496581,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T04:31:57.058Z","status":"ssl_error","status_checked_at":"2026-01-17T04:31:45.816Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["bitcoin","cookie","lightning","macaroons","runes"],"created_at":"2026-01-17T04:49:02.245Z","updated_at":"2026-01-17T04:49:02.848Z","avatar_url":"https://github.com/bolt-observer.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-runes\n\n## Introduction\n\nThis is a Go implementation of [runes](https://github.com/rustyrussell/runes).\nRunes are contextual authentication tokens like cookies with the additional feature that they can be extended by third parties. (Imagine a JWT where anybody can add a further restriction.)\nThey are somewhat similar to macaroons described in [\"Macaroons: Cookies with Contextual Caveats for Decentralized Authorization in the Cloud\"](https://research.google/pubs/pub41892/) just simpler (but read the first link for more details). There is a [macaroon go implementation](https://github.com/go-macaroon/macaroon) already, but runes are not well supported yet unless you want to wrap some [C code](https://github.com/ElementsProject/lightning/tree/master/ccan/ccan/rune).\n\nJust to avoid confusion `rune` is also the name of a unicode character in Go. This has nothing to do with string manipulation except that the rune restrictions can also be represented as a string.\n\n## Why would you need this?\n\nIf you plan to interact with Bitcoin Lightning Daemon [CoreLightning](https://github.com/ElementsProject/lightning/) runes are a way to authenticate. Then you can remote control a node via [commando plugin](https://lightning.readthedocs.io/lightning-commando.7.html).\nThe restriction language of CoreLightning offers a few well-known [field names](https://lightning.readthedocs.io/lightning-commando-rune.7.html) like `time`. Go-runes supports any kind of field name and restriction (and should be fully compatible with Python and C implementations), but `time` by itself has no meaning (and you need application logic to enforce that the field means current UNIX time).\n\nThis library is in no way tied to Lightning, you can use runes in a standalone fashion for your application too.\n\n## Examples\n\nCreate a master rune, derive a restricted rune and check it:\n\n```\nimport \"github.com/bolt-observer/go-runes/runes\"\n\nsecret := make([]byte, 55)\n_, err := rand.Read(secret)\nif err != nil {\n    // handle error\n}\n\nmaster := runes.MustMakeMasterRune(secret)\nrestricted := master.MustGetRestrictedFromString(\"method^list|method^get\u0026time\u003e100\")\n\nfmt.Printf(\"%v\\n\", master.IsRuneAuthorized(\u0026restricted)) // returns true\nif peers.Check(map[string]any{\"method\": \"listpeers\", \"time\": 1674742049}) == nil {\n    fmt.Printf(\"Check succeeded\\n\")\n}\n```\n\nObtain existing rune, restrict it and evaluate it:\n\n```\nimport \"github.com/bolt-observer/go-runes/runes\"\n\nrune := runes.MustGetFromBase64(\"EMXekLFLz2z-I7bEOBkfQmR5bR_V78iaf-L-LeFu8Mc9MA\")\nrestricted := rune.MustGetRestrictedFromString(\"method^list|method^get|method=summary\u0026method/listdatastore\")\nfmt.Printf(\"Restricted rune: %s (string representation %s)\\n\", restricted.ToBase64(), restricted.String())\n\nok, msg := restricted.Evaluate(map[string]any{\"method\": \"listdatastore\", \"time\": 1674742049}) // ok will be false and msg will be a verbose error\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbolt-observer%2Fgo-runes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbolt-observer%2Fgo-runes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbolt-observer%2Fgo-runes/lists"}