Sign 백서

bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 14쪽 중 13쪽

in attestation. ### getDelegatedOffchainAttestBatchHash ```solidity function getDelegatedOffchainAttestBatchHash(string[] offchainAttestationIds) external pure returns (bytes32) ``` Returns the hash that will be used to authorize a delegated batch offchain attestation. ### getDelegatedRevokeHash ```solidity function getDelegatedRevokeHash(uint64 attestationId, string reason) external pure returns (bytes32) ``` Returns the hash that will be used to authorize a delegated revocation. ### getDelegatedRevokeBatchHash ```solidity function getDelegatedRevokeBatchHash(uint64[] attestationIds, string[] reasons) external pure returns (bytes32) ``` Returns the hash that will be used to authorize a delegated batch revocation. ### getDelegatedOffchainRevokeHash ```solidity function getDelegatedOffchainRevokeHash(string offchainAttestationId, string reason) external pure returns (bytes32) ``` Returns the hash that will be used to authorize a delegated offchain revocation. ### getDelegatedOffchainRevokeBatchHash ```solidity function getDelegatedOffchainRevokeBatchHash(string[] offchainAttestationIds, string[] reasons) external pure returns (bytes32) ``` Returns the hash that will be used to authorize a delegated batch offchain revocation. ### schemaCounter ```solidity function schemaCounter() external view returns (uint64) ``` Returns the current schema counter. This is incremented for each `Schema` registered. ### attestationCounter ```solidity function attestationCounter() external view returns (uint64) ``` Returns the current on-chain attestation counter. This is incremented for each `Attestation` made. # ISPHook The hook is called for every attestation or revocation if the schema used specifies a hook. ## didReceiveAttestation ```solidity function didReceiveAttestation(address attester, uint64 schemaId, uint64 attestationId, bytes extraData) external payable ``` ## didReceiveAttestation ```solidity function didReceiveAttestation(address attester, uint64 schemaId, uint64 attestationId, contract IERC20 resolverFeeERC20Token, uint256 resolverFeeERC20Amount, bytes extraData) external ``` ## didReceiveRevocation ```solidity function didReceiveRevocation(address attester, uint64 schemaId, uint64 attestationId, bytes extraData) external payable ``` ## didReceiveRevocation ```solidity function didReceiveRevocation(address attester, uint64 schemaId, uint64 attestationId, contract IERC20 resolverFeeERC20Token, uint256 resolverFeeERC20Amount, bytes extraData) external ``` # IVersionable This interface helps contracts to keep track of their versioning. ## version ```solidity function version() external pure returns (string) ``` # Data Models # Schema ## Schema This struct represents an on-chain Schema that Attestations can conform to. `registrant`: The address that registered this schema. `revocable`: Whether Attestations that adopt this Schema can be revoked. `dataLocation`: Where `Schema.data` is stored. See `DataLocation.DataLocation`. `maxValidFor`: The maximum number of seconds that an Attestation can remain valid. 0 means Attestations can be valid forever. This is enforced through `Attestation.validUntil`. `hook`: The `ISPHook` that is called at the end of every function. 0 means there is no hook set. See `ISPHook`. `timestamp`: When the schema was registered. This is automatically populated by `_register(...)`. `data`: The raw schema that `Attestation.data` should follow. Since there is no way to enforce this, it is a `string` for easy readability. ```solidity struct Schema { address registrant; bool revocable; enum DataLocation dataLocation; uint64 maxValidFor; ISPHook hook; uint64 timestamp; string data; } ``` # Attestation ## Attestation This struct represents an on-chain attestation record. This record is not deleted after revocation. `schemaId`: The `Schema` that this Attestation is based on. It must exist. `linkedAttestationId`: Useful if the current Attestation references a previous Attestation. It can either be 0 or an existing attestation ID. `attestTimestamp`: When the attestation was made. This is automatically populated by `_attest(...)`. `revokeTimestamp`: When the attestation was revoked. This is automatically populated by `_revoke(...)`. `attester`: The attester. At this time, the attester must be the caller of `attest()`. `validUntil`: The expiration timestamp of the Attestation. Must respect `Schema.maxValidFor`. 0 indicates no expiration date. `dataLocation`: Where `Attestation.data` is stored. See `DataLocation.DataLocation`. `revoked`: If the Attestation has been revoked. It is possible to make a revoked Attestation. `recipients`: The intended ABI-encoded recipients of this Attestation. This is of type `bytes` to support non-EVM repicients. `data`: The raw data of the Attestation based on `Schema.schema`. There is no enforcement here, however. Recommended to use `abi.encode`. ```solidity struct Attestation { uint64 schemaId; uint64 linkedAttestationId; uint64 attestTimestamp; uint64 revokeTimestamp; address attester; uint64 validUntil; DataLocation dataLocation; bool revoked; bytes[] recipients; bytes data; } ``` ## OffchainAttestation This struct represents an off-chain attestation record. This record is not deleted after revocation. `attester`: The attester. At this time, the attester must be the caller of `attestOffchain()`. `timestamp`: The `block.timestamp` of the function call. ```solidity struct OffchainAttestation { address attester; uint64 timestamp; } ``` # DataLocation ## DataLocation This enum indicates where `Schema.data` and `Attestation.data` are stored. ```solidity enum DataLocation { ONCHAIN, ARWEAVE, IPFS, CUSTOM } ``` # A Future Of Verifiable Trust ## Introduction Traditional trust systems have relied on institutional integrity, which has proven fallible. Recent scandals have highlighted the need for a new approach. Sign Protocol aims to restore trust through verifiable methodologies. ## Verifiable Trust Verifiable Trust replaces blind trust with a system that ensures: * **Soundness and Verifiability**: Information is well-defined, confirmed, and verifiable. * **Hardness and Immutability**: Information is tamper-proof and finalized. Cryptographic solutions and blockchain systems ensure this. * **Reliability and High Availability**: Information is always accessible for validation. Redundant data storage and blockchain incentives support this. EthSign uses Attestations to deliver Verifiable Trust, forming the basis of Sign Protocol. ## Strategy: Web First, Then Global The web serves as a testing ground for trust systems. EthSign's Next platform enables digital contract signing with cryptographic signatures and blockchain storage. Sign Protocol extends verification to all web interactions. ## Attestation Ecosystem An attestation ecosystem coordinates operators, infrastructure, and methodologies to verify authenticity and integrity. It consists of four layers: * **Trust Layer**: Societal infrastructures and institutions. * **Application Layer**: Apps and services using verified trust. * **Infrastructure Layer**: Processes attestation data for applications. * **Attestation Layer**: Manages attestations and their elements. <figure><img src="https://3152654701-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fw182g9YzR34mTxEBTKXX%2Fuploads%2F6JIVbDt4H0fcymf7gh96%2FAttestation_Ecosystem_1.png?alt=media&amp;token=c1b0a320-d1c9-4ed2-92b0-8a60ae612824" alt="Attestation Ecosystem Diagram"><figcaption><p>Figure: Hierarchical structure of the attestation ecosystem layers.</p></figcaption></figure> ## Summary Sign Protocol is a platform-independent attestation protocol with tools and infrastructure to create a robust attestation ecosystem. It leverages blockchains, decentralized storage, and social networks to enhance digital trust systems. # Effective Attestations Sign Protocol introduces Effective Attestations (e/att) to address the limitations of current attestation systems. This approach enhances attestation systems by focusing on verifiability, relevancy, insightfulness, and universality, advancing trust systems for both web and global applications. ## Technical Attributes Effective Attestations provide a framework for a resilient attestation ecosystem. Key technical attributes include: * **Verifiability**: Attestations must be provably correct, supported by schemas and verification tools that ensure data integrity and authenticity. Developers can automate verification processes using these tools. * **Relevancy**: Components should deliver meaningful impact, offering tangible value to developers and stakeholders. This involves creating attestations applicable to real-world scenarios. * **Insightfulness**: Attestations should provide comprehensive context, facilitated by detailed schemas and attestation builders that enhance data interpretation. This allows developers to extract actionable insights from attestation data. * **Universality**: Attestations and their components must be adaptable and interoperable across diverse environments, ensuring seamless integration and global applicability. This requires designing attestations with cross-platform compatibility in mind. Sign Protocol is committed to leading the development of Effective Attestations, fostering a developer community and ecosystem that embodies these principles, and constructing efficient trust systems for both web and global use cases. # Incentive-Aligned Public Good ## Overview To build a trustworthy web powered by attestations, strategies must be pragmatic and impactful. The attestation ecosystem should be open, impactful, and neutral, rewarding contributors while benefiting the public. Sign Protocol balances ongoing development with impactful outputs, termed Pragmatic Sustainability and Net Positive Impact. Inspired by protocols like Git and Ethereum, it emphasizes practicality for sustainability and growth. ## Net Positive Impact Sign Protocol provides tools for a robust attestation ecosystem, aiming for widespread adoption by offering neutral and open benefits. Users globally should experience improvements in trust systems without needing special permissions. The progress of Sign Protocol is expected to enhance related ecosystems, such as Ethereum and DAO governance. Establishing an ideal attestation ecosystem is a long-term goal, engaging the public to achieve a net positive impact. ## Pragmatic Sustainability Sign Protocol's development must be reliable and sustainable. Traditional grant funding is unreliable, so alternative strategies are necessary. EthSign explores revenue models that maintain neutrality and impact, such as subscriptions and product sales, similar to GitHub and Red Hat. This initiative, Pragmatic Sustainability, aims to diversify contributors and ensure long-term success. ## Conclusion Achieving a trustworthy web with attestations requires pragmatic strategies for Sign Protocol as an Incentive-Aligned Public Good. Balancing Pragmatic Sustainability and Net Positive Impact, EthSign aims to democratize benefits globally, inspired by protocols like Git and Ethereum. Diverse funding avenues ensure Sign Protocol's long-term viability. # Glossary # Attestations ## Overview <figure><img src="https://3152654701-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fw182g9YzR34mTxEBTKXX%2Fuploads%2Fgit-blob-6f07d5cf4189e1f3b67d7382642a65f9a8073185%2Fsign_scan_02.jpeg?alt=media" alt=""><figcaption><p>An EthSign attestation on Sign Protocol</p></figcaption></figure> An attestation confirms and certifies the validity of a claim or assertion, such as a statement, event, or legal document. It supports verifiers in confidently accepting or rejecting claims. Sign Protocol implements attestations as digitally signed structured data adhering to a registered schema, stored securely on-chain or off-chain. ## Evolution of Attestations Attestations have evolved significantly, especially with the advent of computers and the internet. Historically, they involved physical seals or signatures. Today, they are structured data with digital signatures, driving Sign Protocol's work. ## Components of an Attestation <figure><img src="https://3152654701-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fw182g9YzR34mTxEBTKXX%2Fuploads%2Fgit-blob-f8eb95994bbe0407e9ea479bb89b4cad01fe861b%2Fattestation_00.png?alt=media" alt="" width="400"><figcaption><p>How Sign Protocol attestations are structured in Solidity</p></figcaption></figure> An attestation in Sign Protocol includes: * **Schema**: Defines the format and organization of data. * **Context**: Provides additional details for insight. * **Digital Signature**: Certifies the authenticity of the attester’s identity using asymmetric cryptography. * **Cryptographic Proofs**: Prove data integrity, often without revealing the data itself (e.g., zero-knowledge proofs). ## Storage of Attestations <figure><img src="https://3152654701-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fw182g9YzR34mTxEBTKXX%2Fuploads%2Fgit-blob-298b44737903afa705e917e64bffe1a7416ddd73%2Fdatalocation_00.png?alt=media" alt="" width="400"><figcaption><p>Data locations available on Sign Protocol</p></figcaption></figure> Attestations are stored in repositories, with accessibility determined by the hosting platform. Sign Protocol supports: 1. **Blockchain Systems (Onchain)**: Offer censorship-resistance, tamper-resistance, and global access. Examples: Ethereum, Optimism, Solana. 2. **Data Storage and Information Exchange Systems (Offchain)**: Focus on data storage and sharing, with privacy measures. Examples: Google Drive, iCloud, Arweave, IPFS. ## Applications <figure><img src="https://3152654701-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fw182g9YzR34mTxEBTKXX%2Fuploads%2Fgit-blob-ccecbfd07e3f27ab1716910134b6466ef5bf99f2%2Fattestation_03.png?alt=media" alt=""><figcaption><p>ZetaChain used TokenTable and Sign Protocol to perform a KYC-gated airdrop</p></figcaption></figure> Attestations are crucial for confirming and certifying claims, with applications in: * **Credit Scoring Systems**: Assess creditworthiness based on payment attestations. * **Reward Distribution Systems**: Distribute rewards based on performance attestations. * **Reputation Systems**: Evaluate entities based on feedback attestations. * **Judicial Systems**: Resolve disputes using attestations from witnesses. Attestations reinforce trust systems, making them verifiable and trustworthy. Sign Protocol is designed to be a tool for navigating this landscape. For more on the value of attestations, see our blog post: [Attestations: A New Era of Trust and Verification](https://medium.com/ethsign/attestations-a-new-era-of-trust-and-verification-b7907e2801ab). # Schema ## Overview <figure><img src="https://3152654701-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fw182g9YzR34mTxEBTKXX%2Fuploads%2Fgit-blob-cb825656568d39e29790752cf82d33b8e7b0ffe0%2Fsign_scan_00.png?alt=media" alt=""><figcaption><p>An EthSign schema on Sign Protocol</p></figcaption></figure> A schema defines the type and structure of data used in attestations, creating standards for accuracy and composability. It ensures attestations are insightful and verifiable. A Schema Registry stores and references schemas, coordinating standards and processes for efficient schema use. ## Purpose Schemas establish rules for data organization in attestations, ensuring they are insightful and valid. They define structure and selection criteria for data points, providing context and provability. Schemas shape attestation standards, enhancing trust system efficiency. ## Design <figure><img src="https://3152654701-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fw182g9YzR34mTxEBTKXX%2Fuploads%2Fgit-blob-ce77e0eb987d41f19cd6556608fa09ed954d23ce%2Fschema_00.png?alt=media" alt="" width="400"><figcaption><p>How Sign Protocol schemas are structured in Solidity</p></figcaption></figure> Sign Protocol schemas consist of two core modules: 1. **Header**: Contains metadata for initial attestation analysis, including: * **Attestation ID**: Unique identifier for cross-referencing. * **Claim Reference**: Points to a related claim or assertion. * **Attester ID**: Identifies the attestation creator. * **Signature**: Cryptographic certification of the attestation. * **Schema Registry ID**: References the schema used. 2. **Body**: Contains detailed attestation data, including: * **Timestamp**: When the event was observed. * **Subject ID**: Identifies the attestation subject. * **Boolean**: Indicates claim truthfulness. * **Cryptographic Proof**: Ensures data integrity. * **Evidence Data**: Supports or refutes the claim. ## Building a Schema Schemas are typically JSON structures, organized as key-value pairs. They can be created using text editors or implemented as blockchain-based scripts. Sign Protocol's Schema Builder streamlines schema creation, offering intuitive flows and reducing complexity. Schemas are vital for defining attestation nature, ensuring clarity and standardization. A well-crafted schema forms the basis for a robust attestation ecosystem. For more on schemas, see our blog post: [Schemas: The Blueprint of Attestations](https://medium.com/ethsign/schemas-the-blueprint-of-attestations-c6b0e6faf430). # Schema Registry ## Overview A schema registry is a centralized repository for storing, managing, validating, and referencing schemas. It serves as an authoritative system that enforces standards for schema creation, ensuring compliance and efficiency within an attestation ecosystem. ## Role of a Schema Registry Schema creators need a platform to store and publicize their schemas, while attesters require a reference point for schemas to make robust attestations. A schema registry acts as this central hub, offering an environment for schema validation against predefined rules and standards. When creating an attestation, an attester can design a new schema or search for an existing one. The schema registry provides a comprehensive selection of schemas, contributed by both registry proprietors and third-party creators. Sign Protocol offers a dedicated schema registry for public schema recording and referencing, facilitating the attestation process. ## Locating a Schema Registry To reference or submit a schema, you must know the registry's location, which determines interaction permissions. Popular platforms for hosting a schema registry include: 1. **Blockchain Systems (Onchain)**: Provide censorship-resistance, tamper-resistance, and global access. Examples: Ethereum, Optimism, Solana. 2. **Data Storage and Information Exchange Systems (Offchain)**: Focus on data storage and sharing, with robust security measures. Examples: Google Drive, iCloud, Arweave, IPFS. ## Benefits of a Schema Registry A schema registry offers several advantages: * **Version Control**: Tracks changes and improvements, mitigating incompatibilities and conflicts. * **Schema Evolution**: Allows schemas to improve over time, maintaining version control and provenance. * **Validation**: Ensures schemas meet ecosystem standards, preventing errors and inefficiencies. * **Governance**: Coordinates standards and guidelines, fostering growth and innovation. * **Conformity**: Enforces quality control through strict rules for schema crafting. A schema registry is essential for maintaining a high-quality attestation ecosystem, driving standardization and innovation. # Attestation Repository ## Overview An attestation repository is a dedicated location for storing, referencing, and analyzing attestations issued by an attester. It is equipped with robust tools and infrastructure to enhance accessibility and user experience for both end-users and developers. #
프로젝트로 돌아가기