Container Image Signing & Verifying on Ethereum [Testnet]

Overview

cosigneth

An experimental decentralized application for storing and verifying container image signatures as an NFT on Ethereum

MIT GitHub release Go Report Netlify


cosigneth, is a decentralized application that runs on Ethereum Rinkeby Testnet. Each signature stored as an NFT using EIP-721 standard. Sign your image digest using your public address and verify them on the blockchain by Solidity contract. Custom serverless function is created to interact with OCI registiries with your given JWT token. We use ethers.signMessage() to sign given image digest using your injected wallet. By giving digest and corresponding signature, we can recover public wallet address by using ECDSA-tryRecover method. See Appendix F in yellowpaper for more information.

GIF

Active contract: 0x1a0278c2402aa06d88a8d29c0cac8422e983bd55

How to use

Prerequisites

Instructions

Signing

  1. Jump to https://cosigneth.dev
  2. Connect your wallet
  3. Create a registry token
$ curl -L -X POST 'https://auth.docker.io/token' \
-H 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=password' \
--data-urlencode 'username=$USERNAME' \
--data-urlencode 'password=$PASSWORD' \
--data-urlencode 'service=registry.docker.io' \
--data-urlencode 'client_id=dockerengine' \
--data-urlencode 'access_type=offline' \
--data-urlencode 'scope=repository:$IMAGE:pull,push'

Replace $USERNAME, $PASSWORD and $IMAGE with yours to get an access token from Docker Registry v2 with 300s expire duration. This is an example for Docker Registry.

  1. Pass your OCI image reference and token (Without Bearer)
  2. Wait until image reference validation and signing process
  3. Done! Click the generated Transaction Hash (Txn) on the UI and jump to Etherscan

Verifying

  1. Jump to https://cosigneth.dev
  2. Connect your wallet
  3. Pass your OCI image reference and a public wallet address
  4. Wait until fetching signature tags from registry API and verifying process on EVM
  5. Done! Check your verification result on the UI

How It Works?

sequenceDiagram
    autonumber
    
	Frontend->>Web3.js: Initialize Contract ABI

    Frontend->>Web3.js: window.ethereum
	Web3.js->>+Wallet: Connect

	Wallet--)-Frontend: Accounts

	Note over Frontend: Sign

	rect rgba(0, 0, 255, .1)
		  Frontend->>+Function: Image Check Prelight
		  Function--)-Frontend: Return Digest
	  
		  Frontend->>+Web3.js: web3.eth.sign()
		  Web3.js--)-Frontend: Signature
	  
		  Frontend->>+Ethereum: mint()
		  Ethereum--)-Frontend: Transaction Hash
	  
		  Frontend->>+Function: Attach ETH Object to Image
		  Function--)-Frontend: Status Code
	end

	Note over Frontend: Verify

	rect rgba(0, 255, 0, .1)
		Frontend->>+Function: Get ETH Object
		Function--)-Frontend: Signatures

		Frontend->>+Ethereum: nft.methods.verify()
		Ethereum--)-Frontend: Verify Result
	end

Verify ETH Object

You can use crane to check your .eth tag:

$ crane ls furkanturkal/busybox
0.2.0
sha256-c734ddd2cee195855d0b5b1906afdf84b68940bc736fca03e2d05d2bd228ea9d.eth

$ crane manifest furkanturkal/busybox:sha256-c734ddd2cee195855d0b5b1906afdf84b68940bc736fca03e2d05d2bd228ea9d.eth | jq

You should expect the following output:

{
  "schemaVersion": 2,
  "mediaType": "application/vnd.oci.image.manifest.v1+json",
  "config": {
    "mediaType": "application/vnd.oci.image.config.v1+json",
    "size": 233,
    "digest": "sha256:0a151380f4116c9388e53fd6fae56e0769eaf539e6a5e67116a40f37a8e24f20"
  },
  "layers": [
    {
      "mediaType": "application/vnd.dev.cosign.simplesigning.v1+json",
      "size": 252,
      "digest": "sha256:4a9735466ab2e5ddf42968a8e283fc2232b04b8c3a93cb710a934d6307ea220f",
      "annotations": {
        "dev.cosignproject.cosign/blockchain": "Ethereum",
        "dev.cosignproject.cosign/chainId": "4",
        "dev.cosignproject.cosign/network": "rinkeby",
        "dev.cosignproject.cosign/signature": "0x5c4d29575dbb038b12ee2cc49911a8418c243fd404b8c0dfd13e3a24de244c3d7b45e23521a880e6972df76305c662ace2b93006e09865a3e10194cb2bfb30731b",
        "dev.cosignproject.cosign/signer": "0xd8f88dc38071f700ee5003ebfef73266cf16e5f1",
        "dev.cosignproject.cosign/timestamp": "1647261544",
        "dev.cosignproject.cosign/transaction": "0x3f09bbc6ada48c1233bf9f1167c427483234312f8ee907efaa9f91a618aef36f"
      }
    }
  ]
}

Motivation

Because, why not? NFTs are trend topic nowadays. This idea is a good opportunity to create a decentralized application from scratch. Building a website using Next.js with Material UI was a good experince. We learned to interact with the contract using Web3.js.

Running on Local

Web

$ cd src
$ yarn install
$ yarn dev

Server

$ cd src/functions
$ go run . -port 8080

Known Issues

  • If transaction failed, we attach ETH object anyway. (not actually signed but it will look like that)
  • We haven't a resiliency mechanism in case we couldn't talk with Registry API. (actually signed but won't look like that)
  • Reverse proxy does not work well on localhost if you want to run local server.

Tech Stack

Frontend

Backend

Hosting

License

The base project code is licensed under Apache License 2.0 unless otherwise specified. Please see the LICENSE file for more information.

You might also like...

A container-friendly alternative to os.cpus().length. Both cgroups v1 and cgroups v2 are supported.

node-cpu-count A container-friendly alternative to os.cpus().length. Both cgroups v1 and cgroups v2 are supported. Installation $ npm install node-cpu

Jan 17, 2022

The invoker based on event model provides an elegant way to call your methods in another container via promisify functions

The invoker based on event model provides an elegant way to call your methods in another container via promisify functions. (like child-processes, iframe, web worker etc).

Dec 29, 2022

Mailbox is the predictable states & transitions container for actors.

Mailbox is the predictable states & transitions container for actors.

Mailbox (turns XState Machine into a REAL Actor) Mailbox is an NPM module built on top of the XState machine, by adding a message queue to the XState

Aug 24, 2022

ContainerMenu is an API for BDSX that allows you to create fake interactive container menus !

ContainerMenu is an API for BDSX that allows you to create fake interactive container menus !

ContainerMenu - A BDSX API ContainerMenu is an API for BDSX that allows you to create fake interactive container menus ! Features Multiple containers

Oct 28, 2022

Jugglr is a tool for managing test data and running tests with a dedicated database running in a Docker container.

Jugglr Jugglr is a tool for managing test data and running tests with a lightweight, dedicated database. Jugglr enables developers, testers, and CI/CD

Aug 20, 2022

A docker container with a wide variety of tools for debugging and setting up micro-services

Frame One Software Placeholder There are numerous times during the dev ops deployments, that a placeholder container is needed. In the past, Frame One

May 29, 2022

Pin any element within a container

jQuery.pin Ever wanted to pin something to the side of a text? Ever needed a subtle sticky element to quietly hang around as you scroll down? Jquery.P

Nov 30, 2022

Public repository of assets used during editions of AWS LATAM Container Roadshow event.

LATAM Containers Roadshow This is the official repository of assets related to LATAM Containers Roadshow, an all-day customer-facing event to highligh

Dec 6, 2022

Make text fit container, prevent overflow and underflow.

Make text fit container, prevent overflow and underflow.

AutoTextSize Make text fit container, prevent overflow and underflow. The font size of the text is adjusted so that it precisely fills its container.

Dec 30, 2022
Releases(v0.1.0)
Owner
Furkan Türkal
Focus on k8s, containers, cloud, gnu/linux, arch, emacs, electronics, writing, diy
Furkan Türkal
A jQuery plugin allowing you to scroll an image within a container element

jQuery Scroll Image Inside v0.1 A jQuery plugin allowing you to scroll an image within a container element Usage <div id="window"> <img src="reall

Derek Ashauer 1 Apr 11, 2021
zkPoB is a mobile compatible tool that lets anyone prove they own a Bufficorn (or any NFT) without revealing which Buffi they own or the address they are verifying themselves with

zkPoB is a mobile compatible tool that lets anyone prove they own a Bufficorn (or any NFT) without revealing which Buffi they own or the address they are verifying themselves with

Marto.eth 10 Aug 25, 2022
Node.js module for verifying Plumo proofs and reading states based on it

plumo-verifier Node.js module for verifying Plumo proofs and reading states based on it. Plumo is a SNARK-based light client verifier for the Celo blo

Celo 3 Dec 15, 2022
FIXYL is a tool for testing and verifying software that uses the FIX protocol.

FIXYL FIXYL is a tool for testing and verifying software that uses the FIX protocol. It allows establishing FIX sessions and exchanging (and manipulat

Yaala Labs 22 Dec 29, 2022
Digital Identifier is a secure, decentralized, anonymous and tampered proof way of maintaining and verifying all essential identity-based documents to create a unique digital identity of a person.

Digital Identifier ?? To design and develop a secure, decentralized, anonymous and tampered proof way of maintaining and verifying all essential ident

Mukul Kolpe 4 Dec 17, 2022
Your Ethereum control panel. Interact with smart contracts on Ethereum.

etherfunk Your Ethereum control panel. Interact with smart contracts on Ethereum. ?? https://etherfunk.io ?? Devleopment First, run the development se

Tom Quirk 23 Sep 24, 2022
PokemonNFT started as Buildspace Project - "Create your own mini turn-based NFT browser game" - ROSE Emerald Paratime Testnet

Welcome to PokemonNFTGame ?? Buildspace Project - Create your own mini turn-based NFT browser game ✨ Demo Install npm install Usage npm run dev Blockc

Alberto Cruz Luis 7 Oct 3, 2022
Danger is near (play to earn game, gamefi on near chain testnet) - user play as a fireknight in a PIXELVERSE world who go to forest and kill monster.

Danger is near (play to earn game, gamefi on near chain testnet) - user play as a fireknight in a PIXELVERSE world who go to forest and kill monster. User can earn $DANGER token and score to compete with others user.

Jason Factor 21 Dec 30, 2022
Decentralised Oracle Network for Subjective Data Feeds (testnet).

deOracle.xyz deOracle.xyz is a decentralised P2P oracle platform with a cross-chain reputation system for digital identities. Our goal is to bring rel

DeOracle.xyz 2 Oct 28, 2022
optimize image & upload file to cloud as image bed with tiny image automic.

Rush! 图片压缩 & 直传图床工具 这是一个兴趣使然的项目, 希望 Rush! 能让这个世界的网络资源浪费减少一点点 下载 Downloads 获取最新发行版 功能 Features 拖拽批量压缩图片, 支持格式 jpg/png/gif Drop to optimize, jpg/png/gif

{ Chao } 3 Nov 12, 2022