ADAM Layer <> Web3

joshuadparkin
Coasys
Published in
5 min readDec 15, 2023

The ADAM Layer is an agent-centric interoperability layer that enables one final social space, connecting to all the existing services you use.

ADAM allows higher level capabilities not possible on any of the individual networks. A large part of our strategy has been integrating with all the work done in the Web3 world, we are now actioning in that direction. We wish to build collaborations with many systems, supercharging the decentralization efforts that have already been made.

EAS (Ethereum Attestation Service) Integration

Our journey into Web3 begins with integrating the Ethereum Attestation Service (EAS). This integration not only serves as our foundational connection with Ethereum but also sets the stage for future collaborations with other Web3 protocols and standards. We choose Ethereum attestation service as our first point of integration due to its valuable use inside the SynergyEngine.

With SynergyEngine you are able to make a query across a distributed network of P2P agents. Each agent will look in their local data or installed integrations to find data matching your semantic query. This process can look for data created directly in the ADAM Layer or data connected into the ADAM Layer via Web2 servers or Web3 protocols.

When anyone is able to serve data as a response to some query, it is important that you are able to filter out bad actors, or automated AI responses via leveraging reputation. Leveraging reputations allows you to determine the threshold of connection, or “data fingerprint” someone has to provide before being able to correctly respond to a given query. EAS has become one of the known standards on Ethereum for making available reputation data which can be either stored on chain or off chain. EAS already has a multitude of interesting schemas & apps built. This makes it a perfect emerging solution for leveraging reputation inside SynergyEngine.

Use It Now!

Before diving into the technical aspects, it’s exciting to share that this integration is now live in ADAM’s flagship application, Flux. You can visit your profile on Flux to showcase your attestations. Here is what that looks like:

gm!

This feature marks our first step in integrating Web3 functionalities within ADAM and Flux. Stay tuned for future updates, including the addition of NFTs to profiles.

How It Works

ADAM Layer employs Decentralized Identifiers (DIDs) for agent identification. Each ADAM Agent is associated with a locally generated public/private key pair, a concept similar to blockchain wallets. To connect ADAM Agents with crypto wallets, we introduce EntanglementProofs. These proofs establish ownership of both a DID and a device key (such as an Ethereum wallet). This process allows you to represent your Ethereum address ownership within the ADAM ecosystem.

class EntanglementProof {
did: string;
didSigningKeyId: string;
deviceKeyType: string;
deviceKey: string;
deviceKeySignedByDid: string;
didSignedByDeviceKey?: string;
}

When using our DApp, you will be prompted to connect to ADAM, connect your wallet, and then sign from your wallet. After completing those steps you would have generated the above object. This object can now be taken with you anywhere inside the ADAM ecosystem to represent your ownership of a given Ethereum address!

Now we have Ethereum wallets in ADAM we want to start leveraging this and build some integrations! As mentioned above our first point of integration is with EAS. This integration was made via the development of an ADAM Language module. I wont dive into the details of the implementation of that Language here, but if you want you can find the code here. In essence this language provides the ability to get all attestations using the public EAS GraphQL server for a given address. Inside the JS AD4M client that looks like the following:

const expression = await this.client.expression.get(
"QmzSYwdiqjYXRAaoJdARpP7xRj4VQfdTT3J4HNGLohdKeuBgo1E://coasys.dao.eth"
);

Where the first part of the string is the hash of the EAS Languages and the section after :// represents the Ethereum address to fetch attestations for.

Leveraging the entanglement proofs & the EAS Language we now have a way to publish to any ADAM network, my proof of wallet ownership and my attestation resource!

Use in SynergyEngine

To tie this together lets go into how this can be leveraged inside SynergyEngine! As mentioned before SynergyEngine allows semantic queries across a network of P2P agents pulling across technologies.

A semantic query in SynergyEngine will be represented as a Prolog query which attempts to find associations between arbitrary pieces of data. In the ADAM ontology these associations look like RDF Triple Links between Expressions. Here is what that those associations may look like when looking for EAS records:

const links = [
{
subject: "did:key:zQ3shv5VUAbtY5P1jGsPzy7L27FTxeDv2hnhVp9QT3ALNCnQ2",
predicate: "ad4m://entanglement_proof",
target: "literal://[{\"deviceKey\":\"0x4fd7628984B7BebF13Ac134093245053d5845851\",\"deviceKeySignedByDid\":\"89adeec502a9311ee229754f76b0ab4046a1ea89658b971d17ba0fa9ac9dd2c68eb9be9c9f13e0748e1bbf71868e548e6d388330eb0fc122ea1871200dd6ab01\",\"deviceKeyType\":\"ethereum\",\"did\":\"did:key:z6MkvJfGzZ24qMphKyCEE2GHZXw8QQWosUtuB8rtQdtPoViR\",\"didSignedByDeviceKey\":\"0x51aa9673d0875b01a6bd7c9e54ccf822fc2e722091777fbd8a981cfcd67ff0622c40a8c9b66e08df989427efbfa330255e500a29f71ab34f5057449b62fcc54d1b\",\"didSigningKeyId\":\"did:key:z6MkvJfGzZ24qMphKyCEE2GHZXw8QQWosUtuB8rtQdtPoViR#z6MkvJfGzZ24qMphKyCEE2GHZXw8QQWosUtuB8rtQdtPoViR\"}]",
},
{
subject: "literal://[{\"deviceKey\":\"0x4fd7628984B7BebF13Ac134093245053d5845851\",\"deviceKeySignedByDid\":\"89adeec502a9311ee229754f76b0ab4046a1ea89658b971d17ba0fa9ac9dd2c68eb9be9c9f13e0748e1bbf71868e548e6d388330eb0fc122ea1871200dd6ab01\",\"deviceKeyType\":\"ethereum\",\"did\":\"did:key:z6MkvJfGzZ24qMphKyCEE2GHZXw8QQWosUtuB8rtQdtPoViR\",\"didSignedByDeviceKey\":\"0x51aa9673d0875b01a6bd7c9e54ccf822fc2e722091777fbd8a981cfcd67ff0622c40a8c9b66e08df989427efbfa330255e500a29f71ab34f5057449b62fcc54d1b\",\"didSigningKeyId\":\"did:key:z6MkvJfGzZ24qMphKyCEE2GHZXw8QQWosUtuB8rtQdtPoViR#z6MkvJfGzZ24qMphKyCEE2GHZXw8QQWosUtuB8rtQdtPoViR\"}]",
predicate: "ad4m://eas",
target: "QmzSYwdiqjYXRAaoJdARpP7xRj4VQfdTT3J4HNGLohdKeuBgo1E://coasys.dao.eth"
}
];

A query leveraging EAS and this structure inside SynergyEngine would look like:

posts(Post) :-
triple(Source, "sioc://has_post", Post),
link(Source, "sioc://likes", Post, Author, Timestamp),
link(Author, "ad4m://entanglement_proof", Proof),
link(Proof, "ad4m://eas", Attestations),
has_field(Attestations, "metIRL", Field),
is_equal(Field, true),
count_likes(Post, Count),
Count > 5.

This would now fetch the top 5 posts from any author where they have had an attestations created, marking them as having been met by someone in real life. Leveraging reputation for data fetching! This is a simple example but you can imagine these queries to be extended to use any attestation schema or other Web3 protocols such as proof of humanity.

Summary

The ADAM Layer’s integration with Web3, beginning with the Ethereum Attestation Service (EAS), signifies a groundbreaking advancement in the realm of digital interoperability and decentralized networking. By harnessing the power of agent-centric technology and decentralized identifiers, ADAM offers enhanced capabilities that transcend the limitations of individual networks.

The implementation of EntanglementProofs further bridges the gap between digital identities and crypto wallets, solidifying user presence within the ADAM ecosystem. With its live application in Flux, users can now display attestations, heralding a new era of reputation-based data verification and semantic querying. This integration not only amplifies the decentralization efforts but also opens new avenues for robust, reputation-driven data interactions in the digital world, setting the stage for future collaborations and innovations in the Web3 landscape.

--

--