MCPcopy Index your code
hub / github.com/SmartTokenLabs/attestation

github.com/SmartTokenLabs/attestation @0.4.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.4.0 ↗ · + Follow
2,655 symbols 9,644 edges 322 files 187 documented · 7%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

TokenScript - Attestation

This repository host the attestation libraries as part of TokenScript. Discussion goes to the forum https://community.tokenscript.org/

You can always use this project in your own code through Maven central, by adding the following dependency in your POM: dtd <dependency> <groupId>org.tokenscript</groupId> <artifactId>attestation</artifactId> <version>0.4</version> </dependency>

This repository's library serves 3 use-cases of attestations.

Use-case Description Protocol Cmd Demo
Identifier attestation Identifies a person by their Internet identifier such as Twitter Handle and email address. See below
Cheque Cheque: a signed message allows the beneficiary to perform an action, such as withdrawing Ether. Send-token-by-identifier demo.
Attestation as token An attestation that can be used as a non-fungible token.

How is the code organised?

The code is not compartmentalised by use-cases, since they share common components. We provide the common components as library, then, for each use-case, a commandline utility.

Since in most cases these attestations are used on the web, Web-developers should be more interested in attestations being implemented as part of token-neogotiation instead of the basic commandline form. Therefore, this repository should be more of interest by the protocol developers. Our JavaScript based token negotiation implementation is at the token-negotiator repo.

Together with repos that uses the library code, in total we maintain 4 repos. The relationship between these 4 repos are demonstrated here. This one is the first (the upper-left one).

various repos for components

Build

You need the following installed:

  • JDK (version 11 or higher)
  • Gradle (version 7.1.1 is used by our devs)
  • node.js (version 15 is used by our devs)

Once you have them installed, run:

$ gradle build

The build script will run a few tests, resulting a few pem files created in build/test-results/ directory.

Try it yourself

To create a jar file for running the demo, run:

$ gradle shadowJar

Which will create a jar file that you can run in the commandline

build/libs/attestation-all.jar

There is a walk-through to use the functionalities provided by this library through commandline: commandline cheque demonstration and the commandline EIP712 attestation demonstration

Organisation of this repo

This repository has the following content:

data-modules :the data modules definitions used in this project

src :the implementation of the attestation and protocols. We use a Java-Solidity model for quick prototyping - testing.

ethereum/lib : lib for smart contracts which uses attestations

ethereum/issuers : example smart contracts used by issuers, for example, revocation list management.

ethereum/trustlist : members of trustlists to be adopted by smart contracts

ethereum/experiments : work not in the published specifications

ethereum/example-james-squire : an example to be used in your projects which requires attestations

paper : the paper behind the design of this project. The current version there is dated (2018) and doesn't reflect the new work in the last a few years. The current focus is the cheque/attestation protocol

ERC publications

ERC's related to this stream of work are:

ERC1386, ERC1387 & ERC1388

Extension points exported contracts — how you extend this code

Signable (Interface)
Interface for Singable data, for stuff like TBSData (to-be-signed-data), with the view that EthereumMessage, EthereumTyp [8 …
src/main/java/com/alphawallet/token/entity/Signable.java
Validateable (Interface)
(no doc) [39 implementers]
src/main/javascript/crypto/src/libs/Validateable.ts
Verifiable (Interface)
(no doc) [51 implementers]
src/main/javascript/crypto/src/libs/Verifiable.ts
Attestable (Interface)
(no doc) [10 implementers]
src/main/javascript/crypto/src/libs/Attestable.ts
TokenValidateable (Interface)
(no doc) [7 implementers]
src/main/javascript/crypto/src/libs/TokenValidateable.ts

Core symbols most depended-on inside this repo

add
called by 250
src/main/javascript/crypto/src/libs/Point.ts
logger
called by 161
src/main/javascript/crypto/src/libs/utils.ts
getDerEncoding
called by 142
src/main/java/org/tokenscript/attestation/core/ASNEncodable.java
verify
called by 133
src/main/java/org/tokenscript/attestation/core/Signature.java
getEncoded
called by 119
src/main/javascript/crypto/src/libs/Point.ts
encode
called by 102
src/main/javascript/crypto/src/libs/DerUtility.ts
checkValidity
called by 83
src/main/java/org/tokenscript/attestation/core/Validateable.java
toString
called by 67
src/main/javascript/crypto/assets/js/buffer.js

Shape

Method 2,094
Class 408
Function 100
Interface 42
Enum 11

Languages

Java69%
TypeScript31%

Modules by API surface

src/main/java/com/alphawallet/token/tools/TokenDefinition.java56 symbols
src/main/javascript/crypto/assets/js/buffer.js51 symbols
src/main/javascript/crypto/src/libs/KeyPair.ts41 symbols
src/test/java/org/tokenscript/attestation/eip712/EIP712ObjectTest.java34 symbols
src/main/java/org/tokenscript/attestation/core/SignatureUtility.java34 symbols
src/main/java/org/tokenscript/attestation/Attestation.java34 symbols
src/test/java/org/tokenscript/attestation/core/SignatureUtilityTest.java33 symbols
src/test/java/io/alchemynft/attestation/NFTAttestationTest.java33 symbols
src/main/javascript/crypto/src/libs/utils.ts32 symbols
src/test/java/org/tokenscript/attestation/safeconnect/SignedEthereumKeyLinkingAttestationTest.java28 symbols
src/test/java/org/tokenscript/attestation/eip712/TestAttestationRequestEip712.java28 symbols
src/test/java/org/tokenscript/eip712/Eip712Test.java27 symbols

For agents

$ claude mcp add attestation \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact