mirror of
https://github.com/lux-apps/papers.git
synced 2026-10-30 18:15:21 +00:00
Restructured from flat .tex/.pdf files into per-paper subdirectories. Added Antje Worring as co-author on all papers. Synced PDFs to pdfs/ for download site.
112 lines
2.8 KiB
TeX
112 lines
2.8 KiB
TeX
\section{Blockchain Identity Integration}
|
|
|
|
|
|
\subsection{Wallet Connection}
|
|
|
|
Lux.id integrates with major wallet providers through standardized interfaces:
|
|
|
|
\subsubsection{EIP-1193 Provider Interface}
|
|
|
|
\begin{lstlisting}[language=Solidity]
|
|
const accounts = await window.ethereum.request({
|
|
method: 'eth_requestAccounts'
|
|
});
|
|
|
|
const signature = await window.ethereum.request({
|
|
method: 'personal_sign',
|
|
params: [message, accounts[0]]
|
|
});
|
|
\end{lstlisting}
|
|
|
|
\subsubsection{Signature Verification}
|
|
|
|
Wallet signatures are verified server-side:
|
|
|
|
\begin{equation}
|
|
\text{Address} = \text{ecrecover}(\text{hash}(\text{message}), v, r, s)
|
|
\end{equation}
|
|
|
|
Where $(v, r, s)$ are ECDSA signature components.
|
|
|
|
\subsection{Decentralized Identifiers (DIDs)}
|
|
|
|
Lux.id implements DID methods conforming to W3C specifications:
|
|
|
|
\subsubsection{DID Document Structure}
|
|
|
|
\begin{lstlisting}[language=json]
|
|
{
|
|
"@context": ["https://www.w3.org/ns/did/v1"],
|
|
"id": "did:lux:1234567890abcdef",
|
|
"verificationMethod": [{
|
|
"id": "did:lux:1234567890abcdef#keys-1",
|
|
"type": "EcdsaSecp256k1VerificationKey2019",
|
|
"controller": "did:lux:1234567890abcdef",
|
|
"publicKeyHex": "04f3c7d7..."
|
|
}],
|
|
"authentication": ["did:lux:1234567890abcdef#keys-1"],
|
|
"service": [{
|
|
"type": "IdentityHub",
|
|
"serviceEndpoint": "https://id.lux.network/did/"
|
|
}]
|
|
}
|
|
\end{lstlisting}
|
|
|
|
\subsubsection{DID Resolution}
|
|
|
|
DID resolution follows the universal resolver pattern:
|
|
|
|
\begin{equation}
|
|
\text{resolve}(\text{did:lux:xyz}) \rightarrow \text{DIDDocument}
|
|
\end{equation}
|
|
|
|
\subsection{On-chain Identity Verification}
|
|
|
|
Lux.id verifies on-chain identity attributes:
|
|
|
|
\begin{lstlisting}[language=Solidity]
|
|
contract IdentityVerifier {
|
|
mapping(address => bytes32) public identityHashes;
|
|
|
|
function verifyIdentity(
|
|
address user,
|
|
bytes32 attributeHash,
|
|
bytes memory signature
|
|
) public view returns (bool) {
|
|
bytes32 messageHash = keccak256(
|
|
abi.encodePacked(user, attributeHash)
|
|
);
|
|
address signer = ECDSA.recover(messageHash, signature);
|
|
return signer == user && identityHashes[user] == attributeHash;
|
|
}
|
|
}
|
|
\end{lstlisting}
|
|
|
|
\subsection{NFT-Based Access Control}
|
|
|
|
Access control based on NFT ownership:
|
|
|
|
\begin{lstlisting}[language=Solidity]
|
|
function hasAccess(address user, uint256 tokenId) public view returns (bool) {
|
|
return nftContract.ownerOf(tokenId) == user;
|
|
}
|
|
\end{lstlisting}
|
|
|
|
\subsection{Soulbound Tokens for Reputation}
|
|
|
|
Non-transferable tokens represent reputation:
|
|
|
|
\begin{lstlisting}[language=Solidity]
|
|
contract SoulboundToken is ERC721 {
|
|
function _beforeTokenTransfer(
|
|
address from,
|
|
address to,
|
|
uint256 tokenId
|
|
) internal override {
|
|
require(from == address(0), "Token is soulbound");
|
|
super._beforeTokenTransfer(from, to, tokenId);
|
|
}
|
|
}
|
|
\end{lstlisting}
|
|
|