Xenium is a noninteractive protocol for producing and redeeming single-use claim codes

Overview

Xenium

Xenium is a noninteractive protocol for producing and redeeming single-use claim codes.

What this means in practice is that you can have a device - software or hardware - that produces a (potentially) infinite sequence of unique URLs. Each URL can be used for a single 'claim' - which can have an effect such as transferring a token (ERC20, ERC721, ERC1155...) or anything else you like. Once a claim code is used, it can't be used again, and the protocol is noninteractive - meaning that the device doing the issuing doesn't need two-way communcation with the device and user making the claim.

Claim codes are commonly displayed as QR codes or transmitted over NFC, but any system that allows sending a link to someone will work. You can even print claim codes off on paper and hand them out.

The main components of a Xenium deployment are:

  • An issuer, which produces claim codes.
  • A claimant, who takes a claim code, converts it into a valid claim, and submits it to the blockchain.
  • A validator, a smart contract that verifies a claim and acts on it.

xenium-js

Xenium-js is a Typescript library that provides functionality for two use-cases:

  • Claim code generation - this functionality lets you implement a Xenium 'issuer' that generates claim codes using a signing key.
  • Claim code redemption - this functionality lets you convert a claim code into a valid claim transaction that can be submitted to the blockchain.

validator

The validator package implements a kind of 'construction kit' for building validator smart contracts. It consists of a set of building blocks that handle specific parts of the validation process - determining which issuers are allowed to issue claims, checking uniqueness of claims, and acting on them - and makes it easy to combine the primitives that suit your application to create a validator that meets your needs.

The library also includes a set of 'factory' contracts that produce commonly used validator types. These will be deployed on Ethereum and other Ethereum-compatible networks for general use once they are mature.

arm32-issuer

The arm32-issuer repository contains firmware for a physical claim code issuer. The code is written for the STM32L4x3 series of microcontrollers, but should be easily ported to any other system that supports the MBED platform.

Comments
  • Add claimAndConfigure; add executor configuration pass through

    Add claimAndConfigure; add executor configuration pass through

    This PR makes a few changes to the ValidatorRegistry and associated plumbing:

    1. Adds a configure method to IExecutor, callable only by the ValidatorRegistry to allow configuring an executor in the same transaction as the user setting the executor.
    2. Removes the executorData stored by the ValidatorRegistry
    3. Makes the configure method on ValidatorRegistry call configure on the newly set executor, passing in the data provided.
    4. Adds a claimAndConfigure method that submits a claim and then a configuration request, so users can set up a new issuer entirely in a single transaction.
    opened by Arachnid 2
  • Shibboleth-js auto recover issuer

    Shibboleth-js auto recover issuer

    Added auto-recovery of issuer address within ClaimCode initialization. It's useful to have automatically pre-computed issuer as it's needed to call Validator.metadata() function.

    opened by Dobrokhvalov 1
  • Make `BaseExecutor` implement `IValidator`

    Make `BaseExecutor` implement `IValidator`

    With this simple change executors could be used directly or via the ValidatorRegistry. Configurable issuers can use them directly, saving gas on configuration and execution.

    Doing this will require making the methods implemented by subclasses for claim and configure internal, and having external methods that do separate permission checks depending on how the executor is being called.

    invalid 
    opened by Arachnid 0
  • Single use claimant executor

    Single use claimant executor

    Single-use claimant executor implemented according to https://gist.github.com/Arachnid/df9c7e3738ee76bf171c46ef38e4f18b#single-use-claimant-addresses

    Had to change contracts/ValidatorLib.sol to return claimant and added claimant param to executor.executeClaim.

    opened by Dobrokhvalov 0
  • ERC721 transfer unique nonce validator

    ERC721 transfer unique nonce validator

    The PR implements Validator for transferring ERC721 tokens based on UniqueNonceDedup for replay protection and an incremental counter for determining the next token id to transfer.

    opened by Dobrokhvalov 2
  • Nonce-based dedups should allow for multiple issuers

    Nonce-based dedups should allow for multiple issuers

    Right now they expect the nonce space to be global across issuers; it would make more sense to namespace it per issuer. Should write tests for this before making the change.

    opened by Arachnid 0
  • ERC20 Executor

    ERC20 Executor

    The PR implements ERC20 Executor that is able to transfer ERC20 tokens from Sender to the beneficiary on a claim.

    • Sender must give permission for the executor contract to transfer tokens via ERC20 approval.
    • This implementation of ERC20 Executor inherits from SingleClaimantExecutor for replay protection
    • Sender needs to specify the deadline until which claim code can be used.
    opened by Dobrokhvalov 1
Owner
Nick Johnson
eipnft:0xb8c2C29ee19D8307cb7255e1Cd9CbDE883A267d5
Nick Johnson
A bounded single-producer single-consumer wait-free and lock-free queue written in C++11

SPSCQueue.h A single producer single consumer wait-free and lock-free fixed size queue written in C++11. Example SPSCQueue<int> q(2); auto t = std::th

Erik Rigtorp 576 Dec 27, 2022
A fast single-producer, single-consumer lock-free queue for C++

A single-producer, single-consumer lock-free queue for C++ This mini-repository has my very own implementation of a lock-free queue (that I designed f

Cameron 2.9k Jan 5, 2023
C++20's jthread for C++11 and later in a single-file header-only library

jthread lite: C++20's jthread for C++11 and later A work in its infancy. Suggested by Peter Featherstone. Contents Example usage In a nutshell License

Martin Moene 50 Dec 8, 2022
Fork of rpmalloc to be used with single thread applications and old C compilers

srpmalloc - Small rpmalloc This is a fork of rpmalloc, with the intent to be used in single threaded applications only, with old C99 compilers, and in

Eduardo Bart 8 Oct 28, 2022
Px - Single header C++ Libraries for Thread Scheduling, Rendering, and so on...

px 'PpluX' Single header C++(11/14) Libraries Name Code Description px_sched px_sched.h Task oriented scheduler. See more px_render px_render.h Multit

PpluX 450 Dec 9, 2022
Single header asymmetric stackful cross-platform coroutine library in pure C.

minicoro Minicoro is single-file library for using asymmetric coroutines in C. The API is inspired by Lua coroutines but with C use in mind. The proje

Eduardo Bart 405 Dec 29, 2022
A competitive programming helper tool, which packages included libraries into a single file, suitable for online judges.

cpack Cpack is a competitive programming helper tool, which packages the main source file along with included libraries into a single file, suitable f

PetarMihalj 11 Apr 22, 2022
Mx - C++ coroutine await, yield, channels, i/o events (single header + link to boost)

mx C++11 coroutine await, yield, channels, i/o events (single header + link to boost). This was originally part of my c++ util library kit, but I'm se

Grady O'Connell 4 Sep 21, 2019
Coroutine - C++11 single .h asymmetric coroutine implementation via ucontext / fiber

C++11 single .h asymmetric coroutine implementation API in namespace coroutine: routine_t create(std::function<void()> f); void destroy(routine_t id);

null 390 Dec 20, 2022
Coro - Single-header library facilities for C++2a Coroutines

coro This is a collection of single-header library facilities for C++2a Coroutines. coro/include/ co_future.h Provides co_future<T>, which is like std

Arthur O'Dwyer 66 Dec 6, 2022
A easy to use multithreading thread pool library for C. It is a handy stream like job scheduler with an automatic garbage collector. This is a multithreaded job scheduler for non I/O bound computation.

A easy to use multithreading thread pool library for C. It is a handy stream-like job scheduler with an automatic garbage collector for non I/O bound computation.

Hyoung Min Suh 12 Jun 4, 2022
An easy to use C++ Thread Pool

mvThreadPool (This library is available under a free and permissive license) mvThreadPool is a simple to use header only C++ threadpool based on work

Jonathan Hoffstadt 30 Dec 8, 2022
CppThreadPool - The original intention of this project is to learn the new C++20 standard in use.

CppThreadPool Introduction The original intention of this project is to learn the new C++20 standard in use. Therefore, make sure your compiler suppor

Hello_World 2 Sep 27, 2022
Concurrency Kit 2.1k Jan 4, 2023
An implementation of Actor, Publish-Subscribe, and CSP models in one rather small C++ framework. With performance, quality, and stability proved by years in the production.

What is SObjectizer? What distinguishes SObjectizer? SObjectizer is not like TBB, taskflow or HPX Show me the code! HelloWorld example Ping-Pong examp

Stiffstream 314 Dec 26, 2022
Simple and fast C library implementing a thread-safe API to manage hash-tables, linked lists, lock-free ring buffers and queues

libhl C library implementing a set of APIs to efficiently manage some basic data structures such as : hashtables, linked lists, queues, trees, ringbuf

Andrea Guzzo 392 Dec 3, 2022
Sqrt OS is a simulation of an OS scheduler and memory manager using different scheduling algorithms including Highest Priority First (non-preemptive), Shortest Remaining Time Next, and Round Robin

A CPU scheduler determines an order for the execution of its scheduled processes; it decides which process will run according to a certain data structure that keeps track of the processes in the system and their status.

null 10 Sep 7, 2022
RocketOS is a Unix based OS that uses legacy BIOS and GRUB and is written in C17. It is being developed for educational purposes primarily, but it still is a serious project. It is currently in its infancy.

RocketOS What is RocketOS? RocketOS is a Unix based OS that uses legacy BIOS and GRUB and is written in C17. It is being developed for educational pur

null 30 Sep 19, 2022