{"id":17129598,"url":"https://github.com/janos/eas-sdk-go","last_synced_at":"2026-05-02T13:35:45.330Z","repository":{"id":227953725,"uuid":"772798782","full_name":"janos/eas-sdk-go","owner":"janos","description":"Ethereum Attestation Service - Go SDK","archived":false,"fork":false,"pushed_at":"2024-06-11T15:47:36.000Z","size":309,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-24T04:35:36.632Z","etag":null,"topics":["attestation","client","ethereum","go","golang","sdk","sdk-go"],"latest_commit_sha":null,"homepage":"https://attest.sh/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/janos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2024-03-15T23:31:49.000Z","updated_at":"2024-06-11T09:32:20.000Z","dependencies_parsed_at":"2024-06-21T12:56:39.446Z","dependency_job_id":"b800645a-2561-468b-b690-b5974d5a63aa","html_url":"https://github.com/janos/eas-sdk-go","commit_stats":null,"previous_names":["janos/eas","janos/eas-sdk-go"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/janos/eas-sdk-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janos%2Feas-sdk-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janos%2Feas-sdk-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janos%2Feas-sdk-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janos%2Feas-sdk-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/janos","download_url":"https://codeload.github.com/janos/eas-sdk-go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janos%2Feas-sdk-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32536580,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T12:25:33.646Z","status":"ssl_error","status_checked_at":"2026-05-02T12:24:51.733Z","response_time":132,"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":["attestation","client","ethereum","go","golang","sdk","sdk-go"],"created_at":"2024-10-14T19:10:02.549Z","updated_at":"2026-05-02T13:35:45.312Z","avatar_url":"https://github.com/janos.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ethereum Attestation Service - Go SDK\n\n[![Go](https://github.com/janos/eas-sdk-go/workflows/Go/badge.svg)](https://github.com/janos/eas-sdk-go/actions)\n[![PkgGoDev](https://pkg.go.dev/badge/resenje.org/eas)](https://pkg.go.dev/resenje.org/eas)\n[![NewReleases](https://newreleases.io/badge.svg)](https://newreleases.io/github/janos/eas-sdk-go)\n\nThis repository contains the Ethereum Attestation Service SDK for the Go programming language, used to interact with the Ethereum Attestation Service Protocol.\n\n[Ethereum Attestation Service](https://attest.sh/) (EAS) is an open-source infrastructure public good for making attestations onchain or offchain.\n\nGo SDK interacts with [EAS Smart Contracts](https://github.com/ethereum-attestation-service/eas-contracts) deployed on different EVM-compatible blockchains using smart contract bindings. The list off deployed contracts could be found in [EAS Contracts README file](https://github.com/ethereum-attestation-service/eas-contracts?tab=readme-ov-file#deployments). EAS contract address for a desired network in that list should be passed as an argument to the client constructor `eas.NewCLient`.\n\n## Installing the Go EAS SDK\n\nRun `go get resenje.org/eas` from command line in your Go module directory.\n\n## Usage\n\nPlease refer to the generated package documentation on \u003chttps://pkg.go.dev/resenje.org/eas\u003e, examples bellow and, of course, tests and code in this repository as the last resource of open source projects.\n\n## Schemas\n\nAttestations are structured by defining and registering Schemas. Schemas follow the Solidity ABI for acceptable types. Below is a list of current Solidity types and corresponding Go types.\n\n| Go type                                    | Solidity type                               |\n|--------------------------------------------|---------------------------------------------|\n| `common.Address`                           | `address`                                   |\n| `string`                                   | `string`                                    |\n| `bool`                                     | `bool`                                      |\n| `[32]byte`                                 | `bytes32`                                   |\n| `eas.UID`                                  | `bytes32`                                   |\n| `[]byte`                                   | `bytes`                                     |\n| `uint8`                                    | `uint8`                                     |\n| `uint16`                                   | `uint16`                                    |\n| `uint32`                                   | `uint32`                                    |\n| `uint64`                                   | `uint64`                                    |\n| `uint256`                                  | `uint256`                                   |\n| `struct{\u003cname\u003e \u003ctype\u003e; \u003cname\u003e \u003ctype\u003e;...}` | `tuple = (\u003ctype\u003e \u003cname\u003e, \u003ctype\u003e \u003cname\u003e...)` |\n| `slice = []\u003ctype\u003e`                         | `\u003ctype\u003e[]`                                  |\n| `array = [\u003csize\u003e]\u003ctype\u003e`                   | `\u003ctype\u003e[\u003csize\u003e]`                            |\n\nAll supported types can be nested inside tuples (Go structs), fixed-sized arrays (Go arrays) and variable-length arrays (So slices).\n\n### Field names\n\nSolidity tuples are represented with Go struct type where names of the struct fields are used for tuple field names. It is possible to set a custom name with Go struct field tag `abi`. En example of a tuple related type:\n\n```go\ntype MyTuple struct {\n\tID        eas.UID `abi:\"id\"`\n\tMsg       string  `abi:\"message\"`\n\tTimestamp uint64  `abi:\"timeStamp\"`\n\tRawData   []byte  `abi:\"raw_data\"`\n\tSender    common.Address\n}\n```\n\nwhich corresponds to this schema definition:\n\n```solidity\nbytes32 id, string message, uint64 timeStamp, bytes raw_data, address Sender\n```\n\n## Examples\n\n### Get an existing attestation\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"log\"\n\n\t\"github.com/ethereum/go-ethereum/common\"\n\t\"github.com/ethereum/go-ethereum/crypto\"\n\t\"resenje.org/eas\"\n)\n\nvar (\n\tendpointSepolia        = \"https://ethereum-sepolia-rpc.publicnode.com/\"\n\tcontractAddressSepolia = common.HexToAddress(\"0xC2679fBD37d54388Ce493F1DB75320D236e1815e\")\n)\n\nfunc main() {\n\tctx := context.Background()\n\n\tprivateKey, err := crypto.GenerateKey()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tc, err := eas.NewClient(ctx, endpointSepolia, privateKey, contractAddressSepolia, nil)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tattestationUID := eas.HexDecodeUID(\"0xac812932f5cee90a457d57a9fbd7b142b21ba99b809f982bbf86947f295281ff\")\n\n\ta, err := c.EAS.GetAttestation(ctx, attestationUID)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tlog.Println(\"Attestation UID\", a.UID)\n\tlog.Println(\"Attestation Time\", a.Time)\n\n\tvar schemaUID eas.UID\n\tvar name string\n\n\tif err := a.ScanValues(\u0026schemaUID, \u0026name); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tlog.Println(\"Attestation\")\n\tlog.Println(\"Schema UID:\", schemaUID)\n\tlog.Println(\"Name:\", name)\n}\n```\n\n### Structured schema\n\nCreate a structured schema, make attestation and get attestation.\n\n```go\n// Attest a road trip by defining a schema.\npackage main\n\nimport (\n\t\"context\"\n\t\"log\"\n\n\t\"github.com/ethereum/go-ethereum/common\"\n\t\"github.com/ethereum/go-ethereum/crypto\"\n\t\"resenje.org/eas\"\n)\n\nvar (\n\tendpointSepolia        = \"https://ethereum-sepolia-rpc.publicnode.com/\"\n\tcontractAddressSepolia = common.HexToAddress(\"0xC2679fBD37d54388Ce493F1DB75320D236e1815e\")\n)\n\ntype RoadTrip struct {\n\tID           uint64      `abi:\"id\"`\n\tVIN          string      `abi:\"vin\"` // Vehicle Identification Number\n\tVehicleOwner string      `abi:\"vehicleOwner\"`\n\tPassengers   []Passenger `abi:\"passengers\"`\n}\n\ntype Passenger struct {\n\tName     string `abi:\"name\"`\n\tCanDrive bool   `abi:\"canDrive\"`\n}\n\nfunc (p Passenger) CanDriveString() string {\n\tif p.CanDrive {\n\t\treturn \"can drive\"\n\t}\n\treturn \"cannot drive\"\n}\n\n// Attest a road trip by defining a schema.\nfunc main() {\n\tctx := context.Background()\n\n\t// Use a fake key here. Use your own funded key to be able to send transactions.\n\tprivateKey, err := eas.HexParsePrivateKey(\"a896e1f28a6453e8db4794f11ea185befd04c4e4f06790e37e8d1cc90a611948\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tlog.Println(\"Wallet address:\", crypto.PubkeyToAddress(privateKey.PublicKey))\n\n\t// Construct a client that will interact with EAS contracts.\n\tc, err := eas.NewClient(ctx, endpointSepolia, privateKey, contractAddressSepolia, nil)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// Create the Schema on chain.\n\ttx, waitRegistration, err := c.SchemaRegistry.Register(ctx, eas.MustNewSchema(RoadTrip{}), common.Address{}, true)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(\"Waiting schema registration transaction:\", tx.Hash())\n\tschemaRegistration, err := waitRegistration(ctx)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// Just check the schema definition.\n\tschema, err := c.SchemaRegistry.GetSchema(ctx, schemaRegistration.UID)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(\"Schema UID:\", schema.UID)\n\tlog.Println(\"Schema:\", schema.Schema)\n\n\t// Attest a road trip on chain.\n\ttx, waitAttestation, err := c.EAS.Attest(ctx,\n\t\tschema.UID,\n\t\t\u0026eas.AttestOptions{Revocable: true},\n\t\tRoadTrip{\n\t\t\tID:           4242,\n\t\t\tVIN:          \"1FA6P8CF5L5100421\",\n\t\t\tVehicleOwner: \"Richard Hammond\",\n\t\t\tPassengers: []Passenger{\n\t\t\t\t{\n\t\t\t\t\tName:     \"James May\",\n\t\t\t\t\tCanDrive: true,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tName:     \"Jeremy Clarkson\",\n\t\t\t\t\tCanDrive: true,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tName:     \"The Stig\",\n\t\t\t\t\tCanDrive: false,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(\"Waiting attest transaction:\", tx.Hash())\n\tattestConfirmation, err := waitAttestation(ctx)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// Get the attestation to verify it.\n\ta, err := c.EAS.GetAttestation(ctx, attestConfirmation.UID)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tlog.Println(\"Attestation UID\", a.UID)\n\tlog.Println(\"Attestation Time\", a.Time)\n\n\tvar roadTrip RoadTrip\n\tif err := a.ScanValues(\u0026roadTrip); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tlog.Println(\"Road trip:\", roadTrip.ID)\n\tlog.Println(\"Vehicle Identification Number:\", roadTrip.VIN)\n\tlog.Println(\"Vehicle owner:\", roadTrip.VehicleOwner)\n\tfor i, p := range roadTrip.Passengers {\n\t\tlog.Printf(\"Passenger %v: %s (%s)\", i, p.Name, p.CanDriveString())\n\t}\n}\n```\n\n## Versioning\n\nEach version of the client is tagged and the version is updated accordingly.\n\nThis package uses Go modules.\n\nTo see the list of past versions, run `git tag`.\n\n## Contributing\n\nWe love pull requests! Please see the [contribution guidelines](CONTRIBUTING.md).\n\n## License\n\nThis library is distributed under the BSD-style license found in the [LICENSE](LICENSE) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanos%2Feas-sdk-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjanos%2Feas-sdk-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanos%2Feas-sdk-go/lists"}