diff --git a/compression-docs/.gitbook/assets/1000xHackathon_banner.png b/compression-docs/.gitbook/assets/1000xHackathon_banner.png deleted file mode 100644 index f207fcf..0000000 Binary files a/compression-docs/.gitbook/assets/1000xHackathon_banner.png and /dev/null differ diff --git a/compression-docs/.gitbook/assets/1000x_35_banner (1).png b/compression-docs/.gitbook/assets/1000x_35_banner (1).png deleted file mode 100644 index bddc9bb..0000000 Binary files a/compression-docs/.gitbook/assets/1000x_35_banner (1).png and /dev/null differ diff --git a/compression-docs/.gitbook/assets/1000x_35_banner.png b/compression-docs/.gitbook/assets/1000x_35_banner.png deleted file mode 100644 index bddc9bb..0000000 Binary files a/compression-docs/.gitbook/assets/1000x_35_banner.png and /dev/null differ diff --git a/compression-docs/.gitbook/assets/Build_Anything.png b/compression-docs/.gitbook/assets/Build_Anything.png deleted file mode 100644 index 04e018f..0000000 Binary files a/compression-docs/.gitbook/assets/Build_Anything.png and /dev/null differ diff --git a/compression-docs/.gitbook/assets/Group 632668.png b/compression-docs/.gitbook/assets/Group 632668.png deleted file mode 100644 index a9f4a6d..0000000 Binary files a/compression-docs/.gitbook/assets/Group 632668.png and /dev/null differ diff --git a/compression-docs/.gitbook/assets/ScaleAnything (1).png b/compression-docs/.gitbook/assets/ScaleAnything (1).png deleted file mode 100644 index da99be4..0000000 Binary files a/compression-docs/.gitbook/assets/ScaleAnything (1).png and /dev/null differ diff --git a/compression-docs/.gitbook/assets/ScaleAnything (2).png b/compression-docs/.gitbook/assets/ScaleAnything (2).png deleted file mode 100644 index 6c6d571..0000000 Binary files a/compression-docs/.gitbook/assets/ScaleAnything (2).png and /dev/null differ diff --git a/compression-docs/.gitbook/assets/ScaleAnything.png b/compression-docs/.gitbook/assets/ScaleAnything.png deleted file mode 100644 index 6c6d571..0000000 Binary files a/compression-docs/.gitbook/assets/ScaleAnything.png and /dev/null differ diff --git a/compression-docs/.gitbook/assets/Screenshot 2024-05-10 at 06.22.52.png b/compression-docs/.gitbook/assets/Screenshot 2024-05-10 at 06.22.52.png deleted file mode 100644 index e399eb6..0000000 Binary files a/compression-docs/.gitbook/assets/Screenshot 2024-05-10 at 06.22.52.png and /dev/null differ diff --git a/compression-docs/.gitbook/assets/Screenshot 2024-05-10 at 06.37.41.png b/compression-docs/.gitbook/assets/Screenshot 2024-05-10 at 06.37.41.png deleted file mode 100644 index 10f2e43..0000000 Binary files a/compression-docs/.gitbook/assets/Screenshot 2024-05-10 at 06.37.41.png and /dev/null differ diff --git a/compression-docs/.gitbook/assets/Screenshot 2024-05-13 at 14.40.53.png b/compression-docs/.gitbook/assets/Screenshot 2024-05-13 at 14.40.53.png deleted file mode 100644 index 8045247..0000000 Binary files a/compression-docs/.gitbook/assets/Screenshot 2024-05-13 at 14.40.53.png and /dev/null differ diff --git a/compression-docs/.gitbook/assets/image (1).png b/compression-docs/.gitbook/assets/image (1).png deleted file mode 100644 index f5e7cba..0000000 Binary files a/compression-docs/.gitbook/assets/image (1).png and /dev/null differ diff --git a/compression-docs/.gitbook/assets/image (2).png b/compression-docs/.gitbook/assets/image (2).png deleted file mode 100644 index f5e7cba..0000000 Binary files a/compression-docs/.gitbook/assets/image (2).png and /dev/null differ diff --git a/compression-docs/.gitbook/assets/image (3).png b/compression-docs/.gitbook/assets/image (3).png deleted file mode 100644 index 5ba5abc..0000000 Binary files a/compression-docs/.gitbook/assets/image (3).png and /dev/null differ diff --git a/compression-docs/.gitbook/assets/image (4).png b/compression-docs/.gitbook/assets/image (4).png deleted file mode 100644 index 6cf0af6..0000000 Binary files a/compression-docs/.gitbook/assets/image (4).png and /dev/null differ diff --git a/compression-docs/.gitbook/assets/image (5).png b/compression-docs/.gitbook/assets/image (5).png deleted file mode 100644 index d9f386e..0000000 Binary files a/compression-docs/.gitbook/assets/image (5).png and /dev/null differ diff --git a/compression-docs/.gitbook/assets/image (6).png b/compression-docs/.gitbook/assets/image (6).png deleted file mode 100644 index 2cef43a..0000000 Binary files a/compression-docs/.gitbook/assets/image (6).png and /dev/null differ diff --git a/compression-docs/.gitbook/assets/image.png b/compression-docs/.gitbook/assets/image.png deleted file mode 100644 index d7c5bc6..0000000 Binary files a/compression-docs/.gitbook/assets/image.png and /dev/null differ diff --git a/compression-docs/.gitbook/assets/solanazero-banner Large 2.jpeg b/compression-docs/.gitbook/assets/solanazero-banner Large 2.jpeg deleted file mode 100644 index 8d539fa..0000000 Binary files a/compression-docs/.gitbook/assets/solanazero-banner Large 2.jpeg and /dev/null differ diff --git a/compression-docs/.gitbook/assets/solanazero-banner Large.jpeg b/compression-docs/.gitbook/assets/solanazero-banner Large.jpeg deleted file mode 100644 index 0df338b..0000000 Binary files a/compression-docs/.gitbook/assets/solanazero-banner Large.jpeg and /dev/null differ diff --git a/compression-docs/.gitbook/assets/solanazero-banner.jpg b/compression-docs/.gitbook/assets/solanazero-banner.jpg deleted file mode 100644 index 9c67ea0..0000000 Binary files a/compression-docs/.gitbook/assets/solanazero-banner.jpg and /dev/null differ diff --git a/compression-docs/.gitbook/assets/test (1) (1).json b/compression-docs/.gitbook/assets/test (1) (1).json deleted file mode 100644 index af2c903..0000000 --- a/compression-docs/.gitbook/assets/test (1) (1).json +++ /dev/null @@ -1,137 +0,0 @@ -openapi: 3.0.3 -info: - title: photon-indexer - description: Solana indexer for general compression - license: - name: Apache-2.0 - version: 0.4.0 -servers: -- url: http://127.0.0.1 -paths: - /: - summary: getCompressedAccountsByOwner - post: - requestBody: - content: - application/json: - schema: - type: object - required: - - jsonrpc - - id - - method - - params - properties: - id: - type: string - description: An ID to identify the request. - enum: - - string - jsonrpc: - type: string - description: The version of the JSON-RPC protocol. - enum: - - '2.0' - method: - type: string - description: The name of the DAS method to invoke. - enum: - - getCompressedAccountsByOwner - params: - type: array - items: - type: object - description: '' - maxItems: 2 - minItems: 2 - responses: - '200': - description: '' - content: - application/json: - schema: - type: object - required: - - context - - value - properties: - context: - $ref: '#/components/schemas/Context' - value: - $ref: '#/components/schemas/PaginatedAccountList' -components: - schemas: - Account: - type: object - required: - - hash - - discriminator - - data - - owner - - lamports - - slotUpdated - properties: - address: - allOf: - - $ref: '#/components/schemas/SerializablePubkey' - nullable: true - data: - type: string - discriminator: - type: integer - format: int64 - minimum: 0 - hash: - $ref: '#/components/schemas/Hash' - lamports: - type: integer - format: int64 - minimum: 0 - owner: - $ref: '#/components/schemas/SerializablePubkey' - seq: - type: integer - format: int64 - nullable: true - minimum: 0 - slotUpdated: - type: integer - format: int64 - minimum: 0 - tree: - allOf: - - $ref: '#/components/schemas/SerializablePubkey' - nullable: true - additionalProperties: false - Context: - type: object - required: - - slot - properties: - slot: - type: integer - format: int64 - minimum: 0 - additionalProperties: false - Hash: - type: string - format: byte - description: A 32-byte hash represented as a base58 string. - PaginatedAccountList: - type: object - required: - - items - properties: - cursor: - allOf: - - $ref: '#/components/schemas/Hash' - nullable: true - items: - type: array - items: - $ref: '#/components/schemas/Account' - additionalProperties: false - SerializablePubkey: - type: string - format: byte - description: A Solana public key represented as a base58 string. \ No newline at end of file diff --git a/compression-docs/.gitbook/assets/test (1).json b/compression-docs/.gitbook/assets/test (1).json deleted file mode 100644 index cd911c5..0000000 --- a/compression-docs/.gitbook/assets/test (1).json +++ /dev/null @@ -1,95 +0,0 @@ -openapi: 3.0.3 -info: - title: photon-indexer - description: Solana indexer for general compression - license: - name: Apache-2.0 - version: 0.4.0 -servers: -- url: http://127.0.0.1 -paths: - /: - summary: getCompressedAccountsByOwner - post: - requestBody: - content: - application/json: - schema: - type: object - required: - - jsonrpc - - id - - method - - params - properties: - id: - type: string - description: An ID to identify the request. - enum: - - string - jsonrpc: - type: string - description: The version of the JSON-RPC protocol. - enum: - - '2.0' - method: - type: string - description: The name of the DAS method to invoke. - enum: - - getCompressedAccountsByOwner - params: - type: array - items: - type: object - description: '' - maxItems: 2 - minItems: 2 - responses: - '200': - description: '' - content: - application/json: - schema: - type: object - required: - - context - - value - properties: - context: - $ref: '#/components/schemas/Context' - value: - $ref: '#/components/schemas/PaginatedAccountList' -components: - schemas: - Context: - type: object - required: - - slot - properties: - slot: - type: integer - format: int64 - minimum: 0 - additionalProperties: false - Hash: - type: string - format: byte - description: A 32-byte hash represented as a base58 string. - PaginatedAccountList: - type: object - required: - - items - properties: - cursor: - allOf: - - $ref: '#/components/schemas/Hash' - nullable: true - items: - type: array - items: - $ref: '#/components/schemas/Account' - additionalProperties: false - SerializablePubkey: - type: string - format: byte - description: A Solana public key represented as a base58 string \ No newline at end of file diff --git a/compression-docs/.gitbook/assets/test (10).json b/compression-docs/.gitbook/assets/test (10).json deleted file mode 100644 index 0478b83..0000000 --- a/compression-docs/.gitbook/assets/test (10).json +++ /dev/null @@ -1,60 +0,0 @@ ---- -openapi: "3.0.3" -info: - title: "photon-indexer" - description: "Solana indexer for general compression" - license: - name: "Apache-2.0" - version: "0.4.0" -paths: - : - summary: "getCompressedAccountsByOwner" - post: - requestBody: - content: - application/json: - schema: - type: "object" - required: - - "jsonrpc" - - "id" - - "method" - - "params" - properties: - id: - type: "string" - description: "An ID to identify the request." - enum: - - "string" - jsonrpc: - type: "string" - description: "The version of the JSON-RPC protocol." - enum: - - "2.0" - method: - type: "string" - description: "The name of the DAS method to invoke." - enum: - - "getCompressedAccountsByOwner" - params: - type: "array" - items: - type: "object" - description: "" - maxItems: "2" - minItems: "2" - responses: -components: - schemas: - CompressedAccountRequest: - type: "object" - properties: - address: - allOf: - - $ref: "#/components/schemas/SerializablePubkey" - nullable: "true" - hash: - allOf: - - $ref: "#/components/schemas/Hash" - nullable: "true" - additionalProperties: "false" \ No newline at end of file diff --git a/compression-docs/.gitbook/assets/test (2).json b/compression-docs/.gitbook/assets/test (2).json deleted file mode 100644 index 0478b83..0000000 --- a/compression-docs/.gitbook/assets/test (2).json +++ /dev/null @@ -1,60 +0,0 @@ ---- -openapi: "3.0.3" -info: - title: "photon-indexer" - description: "Solana indexer for general compression" - license: - name: "Apache-2.0" - version: "0.4.0" -paths: - : - summary: "getCompressedAccountsByOwner" - post: - requestBody: - content: - application/json: - schema: - type: "object" - required: - - "jsonrpc" - - "id" - - "method" - - "params" - properties: - id: - type: "string" - description: "An ID to identify the request." - enum: - - "string" - jsonrpc: - type: "string" - description: "The version of the JSON-RPC protocol." - enum: - - "2.0" - method: - type: "string" - description: "The name of the DAS method to invoke." - enum: - - "getCompressedAccountsByOwner" - params: - type: "array" - items: - type: "object" - description: "" - maxItems: "2" - minItems: "2" - responses: -components: - schemas: - CompressedAccountRequest: - type: "object" - properties: - address: - allOf: - - $ref: "#/components/schemas/SerializablePubkey" - nullable: "true" - hash: - allOf: - - $ref: "#/components/schemas/Hash" - nullable: "true" - additionalProperties: "false" \ No newline at end of file diff --git a/compression-docs/.gitbook/assets/test (3).json b/compression-docs/.gitbook/assets/test (3).json deleted file mode 100644 index 1e72af1..0000000 --- a/compression-docs/.gitbook/assets/test (3).json +++ /dev/null @@ -1,59 +0,0 @@ -openapi: 3.0.3 -info: - title: photon-indexer - description: Solana indexer for general compression - license: - name: Apache-2.0 - version: 0.4.0 -paths: - /: - summary: getCompressedAccountsByOwner - post: - requestBody: - content: - application/json: - schema: - type: object - required: - - jsonrpc - - id - - method - - params - properties: - id: - type: string - description: An ID to identify the request. - enum: - - string - jsonrpc: - type: string - description: The version of the JSON-RPC protocol. - enum: - - '2.0' - method: - type: string - description: The name of the DAS method to invoke. - enum: - - getCompressedAccountsByOwner - params: - type: array - items: - type: object - description: '' - maxItems: 2 - minItems: 2 - responses: {} -components: - schemas: - CompressedAccountRequest: - type: object - properties: - address: - allOf: - - $ref: '#/components/schemas/SerializablePubkey' - nullable: true - hash: - allOf: - - $ref: '#/components/schemas/Hash' - nullable: true - additionalProperties: false \ No newline at end of file diff --git a/compression-docs/.gitbook/assets/test (4).json b/compression-docs/.gitbook/assets/test (4).json deleted file mode 100644 index ec182f6..0000000 --- a/compression-docs/.gitbook/assets/test (4).json +++ /dev/null @@ -1,75 +0,0 @@ -openapi: 3.0.3 -info: - title: photon-indexer - description: Solana indexer for general compression - license: - name: Apache-2.0 - version: 0.4.0 -servers: -- url: http://127.0.0.1 -paths: - /: - summary: getCompressedAccountsByOwner - post: - requestBody: - content: - application/json: - schema: - type: object - required: - - jsonrpc - - id - - method - - params - properties: - id: - type: string - description: An ID to identify the request. - enum: - - string - jsonrpc: - type: string - description: The version of the JSON-RPC protocol. - enum: - - '2.0' - method: - type: string - description: The name of the DAS method to invoke. - enum: - - getCompressedAccountsByOwner - params: - type: array - items: - type: object - description: '' - maxItems: 2 - minItems: 2 - responses: - '200': - description: '' - content: - application/json: - schema: - type: object - required: - - context - - value - properties: - context: - $ref: '#/components/schemas/Context' - value: - $ref: '#/components/schemas/T' -components: - schemas: - CompressedAccountRequest: - type: object - properties: - address: - allOf: - - $ref: '#/components/schemas/SerializablePubkey' - nullable: true - hash: - allOf: - - $ref: '#/components/schemas/Hash' - nullable: true - additionalProperties: false \ No newline at end of file diff --git a/compression-docs/.gitbook/assets/test (5).json b/compression-docs/.gitbook/assets/test (5).json deleted file mode 100644 index ab851fe..0000000 --- a/compression-docs/.gitbook/assets/test (5).json +++ /dev/null @@ -1,60 +0,0 @@ -openapi: 3.0.3 -info: - title: photon-indexer - description: Solana indexer for general compression - license: - name: Apache-2.0 - version: 0.4.0 -servers: -- url: http://127.0.0.1 -paths: - /: - summary: getCompressedAccountsByOwner - post: - requestBody: - content: - application/json: - schema: - type: object - required: - - jsonrpc - - id - - method - - params - properties: - id: - type: string - description: An ID to identify the request. - enum: - - string - jsonrpc: - type: string - description: The version of the JSON-RPC protocol. - enum: - - '2.0' - method: - type: string - description: The name of the DAS method to invoke. - enum: - - getCompressedAccountsByOwner - params: - type: array - items: - type: object - description: '' - maxItems: 2 - minItems: 2 - responses: - '200': - description: '' - content: - application/json: - schema: - type: object - required: - - context - - value - properties: - context: - type: string - description: An ID to identify the request. diff --git a/compression-docs/.gitbook/assets/test (6).json b/compression-docs/.gitbook/assets/test (6).json deleted file mode 100644 index cd911c5..0000000 --- a/compression-docs/.gitbook/assets/test (6).json +++ /dev/null @@ -1,95 +0,0 @@ -openapi: 3.0.3 -info: - title: photon-indexer - description: Solana indexer for general compression - license: - name: Apache-2.0 - version: 0.4.0 -servers: -- url: http://127.0.0.1 -paths: - /: - summary: getCompressedAccountsByOwner - post: - requestBody: - content: - application/json: - schema: - type: object - required: - - jsonrpc - - id - - method - - params - properties: - id: - type: string - description: An ID to identify the request. - enum: - - string - jsonrpc: - type: string - description: The version of the JSON-RPC protocol. - enum: - - '2.0' - method: - type: string - description: The name of the DAS method to invoke. - enum: - - getCompressedAccountsByOwner - params: - type: array - items: - type: object - description: '' - maxItems: 2 - minItems: 2 - responses: - '200': - description: '' - content: - application/json: - schema: - type: object - required: - - context - - value - properties: - context: - $ref: '#/components/schemas/Context' - value: - $ref: '#/components/schemas/PaginatedAccountList' -components: - schemas: - Context: - type: object - required: - - slot - properties: - slot: - type: integer - format: int64 - minimum: 0 - additionalProperties: false - Hash: - type: string - format: byte - description: A 32-byte hash represented as a base58 string. - PaginatedAccountList: - type: object - required: - - items - properties: - cursor: - allOf: - - $ref: '#/components/schemas/Hash' - nullable: true - items: - type: array - items: - $ref: '#/components/schemas/Account' - additionalProperties: false - SerializablePubkey: - type: string - format: byte - description: A Solana public key represented as a base58 string \ No newline at end of file diff --git a/compression-docs/.gitbook/assets/test (7).json b/compression-docs/.gitbook/assets/test (7).json deleted file mode 100644 index 7174070..0000000 --- a/compression-docs/.gitbook/assets/test (7).json +++ /dev/null @@ -1,242 +0,0 @@ -openapi: 3.0.3 -info: - title: photon-indexer - description: Solana indexer for general compression - license: - name: Apache-2.0 - version: 0.4.0 -servers: -- url: http://127.0.0.1 -paths: - /: - summary: getMultipleCompressedAccountProofs - post: - requestBody: - content: - application/json: - schema: - type: object - required: - - jsonrpc - - id - - method - - params - properties: - id: - type: string - description: An ID to identify the request. - enum: - - string - jsonrpc: - type: string - description: The version of the JSON-RPC protocol. - enum: - - '2.0' - method: - type: string - description: The name of the DAS method to invoke. - enum: - - getMultipleCompressedAccountProofs - params: - type: array - items: - $ref: '#/components/schemas/Hash' - required: true - responses: - '200': - description: '' - content: - application/json: - schema: - type: object - required: - - context - - value - properties: - context: - $ref: '#/components/schemas/Context' - value: - type: array - items: - $ref: '#/components/schemas/MerkleProofWithContext' -components: - schemas: - Account: - type: object - required: - - hash - - discriminator - - data - - owner - - lamports - - slotUpdated - properties: - address: - allOf: - - $ref: '#/components/schemas/SerializablePubkey' - nullable: true - data: - type: string - discriminator: - type: integer - format: int64 - minimum: 0 - hash: - $ref: '#/components/schemas/Hash' - lamports: - type: integer - format: int64 - minimum: 0 - owner: - $ref: '#/components/schemas/SerializablePubkey' - seq: - type: integer - format: int64 - nullable: true - minimum: 0 - slotUpdated: - type: integer - format: int64 - minimum: 0 - tree: - allOf: - - $ref: '#/components/schemas/SerializablePubkey' - nullable: true - additionalProperties: false - Context: - type: object - required: - - slot - properties: - slot: - type: integer - format: int64 - minimum: 0 - additionalProperties: false - Hash: - type: string - format: byte - description: A 32-byte hash represented as a base58 string. - Limit: - type: integer - format: int64 - minimum: 0 - MerkleProofWithContext: - type: object - required: - - proof - - leafIndex - - hash - - merkleTree - properties: - hash: - $ref: '#/components/schemas/Hash' - leafIndex: - type: integer - format: int32 - minimum: 0 - merkleTree: - $ref: '#/components/schemas/SerializablePubkey' - proof: - type: array - items: - $ref: '#/components/schemas/Hash' - additionalProperties: false - PaginatedAccountList: - type: object - required: - - items - properties: - cursor: - allOf: - - $ref: '#/components/schemas/Hash' - nullable: true - items: - type: array - items: - $ref: '#/components/schemas/Account' - additionalProperties: false - SerializablePubkey: - type: string - format: byte - description: A Solana public key represented as a base58 string. - TokenAcccount: - type: object - required: - - hash - - owner - - mint - - amount - - isNative - - frozen - - data - - discriminator - - lamports - properties: - address: - allOf: - - $ref: '#/components/schemas/SerializablePubkey' - nullable: true - amount: - type: integer - format: int64 - minimum: 0 - closeAuthority: - allOf: - - $ref: '#/components/schemas/SerializablePubkey' - nullable: true - data: - type: string - format: binary - delegate: - allOf: - - $ref: '#/components/schemas/SerializablePubkey' - nullable: true - discriminator: - type: integer - format: int64 - minimum: 0 - frozen: - type: boolean - hash: - $ref: '#/components/schemas/Hash' - isNative: - type: boolean - lamports: - type: integer - format: int64 - minimum: 0 - mint: - $ref: '#/components/schemas/SerializablePubkey' - owner: - $ref: '#/components/schemas/SerializablePubkey' - seq: - type: integer - format: int64 - nullable: true - minimum: 0 - tree: - allOf: - - $ref: '#/components/schemas/SerializablePubkey' - nullable: true - additionalProperties: false - TokenAccountBalance: - type: object - required: - - amount - properties: - amount: - type: string - additionalProperties: false - TokenAccountList: - type: object - required: - - items - properties: - cursor: - type: string - nullable: true - items: - type: array - items: - $ref: '#/components/schemas/TokenAcccount' diff --git a/compression-docs/.gitbook/assets/test (8).json b/compression-docs/.gitbook/assets/test (8).json deleted file mode 100644 index 12f40af..0000000 --- a/compression-docs/.gitbook/assets/test (8).json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "openapi": "3.0.3", - "info": { - "title": "photon-indexer", - "description": "Solana indexer for general compression", - "license": { - "name": "Apache-2.0" - }, - "version": "0.4.0" - }, - "paths": { - "": { - "summary": "getCompressedAccountsByOwner", - "post": { - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "jsonrpc", - "id", - "method", - "params" - ], - "properties": { - "id": { - "type": "string", - "description": "An ID to identify the request.", - "enum": [ - "string" - ] - }, - "jsonrpc": { - "type": "string", - "description": "The version of the JSON-RPC protocol.", - "enum": [ - "2.0" - ] - }, - "method": { - "type": "string", - "description": "The name of the DAS method to invoke.", - "enum": [ - "getCompressedAccountsByOwner" - ] - }, - "params": { - "type": "array", - "items": { - "type": "object" - }, - "description": "", - "maxItems": 2, - "minItems": 2 - } - } - } - } - } - }, - "responses": {} - } - } - }, - "components": { - "schemas": { - "CompressedAccountRequest": { - "type": "object", - "properties": { - "address": { - "allOf": [ - { - "$ref": "#/components/schemas/SerializablePubkey" - } - ], - "nullable": true - }, - "hash": { - "allOf": [ - { - "$ref": "#/components/schemas/Hash" - } - ], - "nullable": true - } - }, - "additionalProperties": false - } - } - } -} \ No newline at end of file diff --git a/compression-docs/.gitbook/assets/test (9).json b/compression-docs/.gitbook/assets/test (9).json deleted file mode 100644 index 579b0df..0000000 --- a/compression-docs/.gitbook/assets/test (9).json +++ /dev/null @@ -1,539 +0,0 @@ -openapi: 3.0.0 -info: - title: Helius API - version: 1.0.0 -servers: - - url: https://mainnet.helius-rpc.com -paths: - /?api-key=: - post: - tags: - - RPC - summary: getAsset - operationId: rpc - parameters: - - name: api-key - in: query - description: The API key. - required: true - schema: - type: string - example: 'string' - requestBody: - content: - application/json: - schema: - type: object - properties: - jsonrpc: - type: string - enum: ['2.0'] - description: The version of the JSON-RPC protocol. - id: - type: string - description: An ID to identify the request. - method: - type: string - enum: ['getAsset'] - description: The name of the DAS method to invoke. - params: - type: object - properties: - id: - type: string - description: The ID of the asset to retrieve. - example: 'string' - options: - type: object - description: The display options for the response. - properties: - showUnverifiedCollections: - type: boolean - description: Displays grouping information for unverified collections instead of skipping them. - showCollectionMetadata: - type: boolean - description: Displays metadata for the collection. - showFungible: - type: boolean - description: Displays fungible tokens held by the owner. - default: false - showInscription: - type: boolean - description: Displays inscription details of assets inscribed on-chain. - default: false - required: - - jsonrpc - - id - - method - - params - responses: - 200: - description: Successful response - content: - application/json: - schema: - type: object - properties: - interface: - type: string - description: The interface of the asset. - enum: - [ - 'V1_NFT', - 'V1_PRINT', - 'LEGACY_NFT', - 'V2_NFT', - 'FungibleAsset', - 'FungibleToken', - 'Custom', - 'Identity', - 'Executable', - 'ProgrammableNFT', - ] - example: 'V1_NFT' - id: - type: string - description: The ID of the asset. - example: 'string' - content: - type: object - description: The content of the asset. - properties: - $schema: - type: string - json_uri: - type: string - files: - type: array - items: - type: object - items: - type: object - metadata: - type: object - properties: - attributes: - type: array - items: - type: object - description: - type: string - name: - type: string - symbol: - type: string - links: - type: object - description: Links related to the asset. - properties: - external_url: - type: string - description: External URL of the asset. - authorities: - type: object - properties: - address: - type: string - scopes: - type: array - items: - type: string - description: Scopes of the authority. - compression: - type: object - properties: - eligible: - type: boolean - compressed: - type: boolean - data_hash: - type: string - creator_hash: - type: string - asset_hash: - type: string - tree: - type: string - seq: - type: integer - leaf_id: - type: integer - grouping: - type: object - properties: - group_key: - type: string - group_value: - type: string - royalty: - type: object - properties: - royalty_model: - type: string - target: - type: string - nullable: true - percent: - type: number - basis_points: - type: integer - primary_sale_happened: - type: boolean - locked: - type: boolean - creators: - type: object - properties: - address: - type: string - share: - type: integer - verified: - type: boolean - ownership: - type: object - properties: - frozen: - type: boolean - delegated: - type: boolean - delegate: - type: string - nullable: true - ownership_model: - type: string - owner: - type: string - supply: - type: string - nullable: true - mutable: - type: boolean - burnt: - type: boolean - mint_extensions: - type: object - description: The mint extensions details for Token2022. - properties: - confidential_transfer_mint: - type: object - description: Confidential transfer mint details. - properties: - authority: - type: string - description: Authority responsible for the confidential transfer. - auto_approve_new_accounts: - type: boolean - description: Auto-approval status of new accounts. - auditor_elgamal_pubkey: - type: string - description: ElGamal public key of the auditor. - confidential_transfer_fee_config: - type: object - description: Configuration details for confidential transfer fees. - properties: - authority: - type: string - description: Authority responsible for the fee configuration. - withdraw_withheld_authority_elgamal_pubkey: - type: string - description: ElGamal public key for authority to withdraw withheld amounts. - harvest_to_mint_enabled: - type: boolean - description: Status indicating if harvesting to mint is enabled. - withheld_amount: - type: string - description: Amount withheld during confidential transfers. - transfer_fee_config: - type: object - description: Transfer fee configuration details. - properties: - transfer_fee_config_authority: - type: string - description: Authority responsible for transfer fee configuration. - withdraw_withheld_authority: - type: string - description: Authority to withdraw withheld amounts. - withheld_amount: - type: integer - description: Amount withheld in transfers. - older_transfer_fee: - type: object - description: Details of the older transfer fee structure. - properties: - epoch: - type: string - description: Authority responsible for transfer fee configuration. - maximum_fee: - type: string - description: The old maximum fee for the transfer. - transfer_fee_basis_points: - type: string - description: The old transfer fee basis points. - newer_transfer_fee: - type: object - description: Details of the newer transfer fee structure. - properties: - epoch: - type: string - description: Authority responsible for transfer fee - metadata_pointer: - type: object - description: Metadata pointer details. - properties: - authority: - type: string - description: Authority responsible for transfer fee configuration. - metadata_address: - type: string - description: Authority to withdraw withheld amounts. - mint_close_authority: - type: object - description: Mint close authority details. - properties: - close_authority: - type: string - description: Authority responsible for closing mint. - permanent_delegate: - type: object - description: Permanent delegate details. - properties: - delegate: - type: string - description: Delegate public key. - transfer_hook: - type: object - description: Transfer hook details. - properties: - authority: - type: string - description: Authority responsible for the transfer hook. - program_id: - type: string - description: Program ID related to the transfer hook. - interest_bearing_config: - type: object - description: Interest bearing configuration details. - properties: - rate_authority: - type: string - description: Authority responsible for setting the interest rate. - initialization_timestamp: - type: integer - description: Timestamp of interest rate initialization. - pre_update_average_rate: - type: integer - description: Average rate before the latest update. - last_update_timestamp: - type: integer - description: Timestamp of the last interest rate update. - current_rate: - type: integer - description: Current interest rate. - default_account_state: - type: string - description: The default state of the account. - properties: - state: - type: string - description: The state of the account. - confidential_transfer_account: - type: object - description: Details of the confidential transfer account. - properties: - approved: - type: boolean - description: Indicates whether the account is approved. - elgamal_pubkey: - type: string - description: ElGamal public key associated with the account. - pending_balance_lo: - type: string - description: Lower part of the encrypted pending balance. - pending_balance_hi: - type: string - description: Higher part of the encrypted pending balance. - available_balance: - type: string - description: Encrypted available balance of the account. - decryptable_available_balance: - type: string - description: Decryptable available balance for the account. - allow_confidential_credits: - type: boolean - description: Indicates if the account allows confidential credits. - allow_non_confidential_credits: - type: boolean - description: Indicates if the account allows non-confidential credits. - pending_balance_credit_counter: - type: integer - description: Counter for the number of pending balance credits. - maximum_pending_balance_credit_counter: - type: integer - description: Maximum allowed counter for pending balance credits. - expected_pending_balance_credit_counter: - type: integer - description: Expected counter value for pending balance credits. - actual_pending_balance_credit_counter: - type: integer - description: Actual counter value for pending balance credits. - metadata: - type: object - description: Metadata details. - properties: - update_authority: - type: string - description: Optional non-zero public key of the update authority. - mint: - type: string - description: Public key of the mint. - name: - type: string - description: Name associated with the metadata. - symbol: - type: string - description: Symbol associated with the metadata. - uri: - type: string - description: URI pointing to the metadata resources. - additional_metadata: - type: array - description: A list of additional metadata pairs. - items: - type: object - properties: - key: - type: string - description: Key of the metadata pair. - value: - type: string - description: Value of the metadata pair. - supply: - type: object - description: Supply details of master or edition NFT. - nullable: true - properties: - print_max_supply: - type: integer - description: The maximum printable NFTs. - print_current_supply: - type: integer - description: The current printed NFTs. - edition_nonce: - type: integer - description: The nonce of the edition. - edition_number: - type: integer - description: The number of the edition. - nullable: true - master_edition_mint: - type: string - description: The master edition mint. - nullable: true - token_info: - type: object - description: Details about the specific token. - properties: - symbol: - type: string - description: The symbol of the token. - supply: - type: integer - description: The total supply of the token. - decimals: - type: integer - description: The number of decimals the token uses. - token_program: - type: string - description: The tokens program ID. - price_info: - type: object - description: Information about the token's price. - properties: - price_per_token: - type: number - description: The price per individual token. - currency: - type: string - description: The currency in which the token's price is denoted. - inscription: - type: object - properties: - order: - type: integer - description: The order of the inscription. - size: - type: integer - description: The size of the inscription. - contentType: - type: string - description: The content type of the inscription. - encoding: - type: string - description: The encoding of the inscription. - validationHash: - type: string - description: The validation hash of the inscription. - inscriptionDataAccount: - type: string - description: The inscription data account. - authority: - type: string - description: The authority of the inscription. - spl20: - type: object - 400: - description: Invalid request. - content: - application/json: - schema: - type: object - properties: - error: - type: string - - 401: - description: Unauthorized request. - content: - application/json: - schema: - type: object - properties: - error: - type: string - 403: - description: Request was forbidden. - content: - application/json: - schema: - type: object - properties: - error: - type: string - 404: - description: The specified resource was not found. - content: - application/json: - schema: - type: object - properties: - error: - type: string - 429: - description: Exceeded rate limit.. - content: - application/json: - schema: - type: object - properties: - error: - type: string - 500: - description: The server encountered an unexpected condition that prevented it from fulfilling the request. - content: - application/json: - schema: - type: object - properties: - error: - type: string diff --git a/compression-docs/.gitbook/assets/test.json b/compression-docs/.gitbook/assets/test.json deleted file mode 100644 index 2c77b58..0000000 --- a/compression-docs/.gitbook/assets/test.json +++ /dev/null @@ -1,238 +0,0 @@ -openapi: 3.0.3 -info: - title: photon-indexer - description: Solana indexer for general compression - license: - name: Apache-2.0 - version: 0.4.0 -servers: -- url: http://127.0.0.1 -paths: - /: - summary: getCompressedAccount - post: - requestBody: - content: - application/json: - schema: - type: object - required: - - jsonrpc - - id - - method - - params - properties: - id: - type: string - description: An ID to identify the request. - enum: - - string - jsonrpc: - type: string - description: The version of the JSON-RPC protocol. - enum: - - '2.0' - method: - type: string - description: The name of the DAS method to invoke. - enum: - - getCompressedAccount - params: - $ref: '#/components/schemas/Hash' - required: true - responses: - '200': - description: '' - content: - application/json: - schema: - type: object - required: - - context - - value - properties: - context: - $ref: '#/components/schemas/Context' - value: - $ref: '#/components/schemas/Account' -components: - schemas: - Account: - type: object - required: - - hash - - discriminator - - data - - owner - - lamports - - slotUpdated - properties: - address: - allOf: - - $ref: '#/components/schemas/SerializablePubkey' - nullable: true - data: - type: string - discriminator: - type: integer - format: int64 - minimum: 0 - hash: - $ref: '#/components/schemas/Hash' - lamports: - type: integer - format: int64 - minimum: 0 - owner: - $ref: '#/components/schemas/SerializablePubkey' - seq: - type: integer - format: int64 - nullable: true - minimum: 0 - slotUpdated: - type: integer - format: int64 - minimum: 0 - tree: - allOf: - - $ref: '#/components/schemas/SerializablePubkey' - nullable: true - additionalProperties: false - Context: - type: object - required: - - slot - properties: - slot: - type: integer - format: int64 - minimum: 0 - additionalProperties: false - Hash: - type: string - format: byte - description: A 32-byte hash represented as a base58 string. - Limit: - type: integer - format: int64 - minimum: 0 - MerkleProofWithContext: - type: object - required: - - proof - - leafIndex - - hash - - merkleTree - properties: - hash: - $ref: '#/components/schemas/Hash' - leafIndex: - type: integer - format: int32 - minimum: 0 - merkleTree: - $ref: '#/components/schemas/SerializablePubkey' - proof: - type: array - items: - $ref: '#/components/schemas/Hash' - additionalProperties: false - PaginatedAccountList: - type: object - required: - - items - properties: - cursor: - allOf: - - $ref: '#/components/schemas/Hash' - nullable: true - items: - type: array - items: - $ref: '#/components/schemas/Account' - additionalProperties: false - SerializablePubkey: - type: string - format: byte - description: A Solana public key represented as a base58 string. - TokenAcccount: - type: object - required: - - hash - - owner - - mint - - amount - - isNative - - frozen - - data - - discriminator - - lamports - properties: - address: - allOf: - - $ref: '#/components/schemas/SerializablePubkey' - nullable: true - amount: - type: integer - format: int64 - minimum: 0 - closeAuthority: - allOf: - - $ref: '#/components/schemas/SerializablePubkey' - nullable: true - data: - type: string - format: binary - delegate: - allOf: - - $ref: '#/components/schemas/SerializablePubkey' - nullable: true - discriminator: - type: integer - format: int64 - minimum: 0 - frozen: - type: boolean - hash: - $ref: '#/components/schemas/Hash' - isNative: - type: boolean - lamports: - type: integer - format: int64 - minimum: 0 - mint: - $ref: '#/components/schemas/SerializablePubkey' - owner: - $ref: '#/components/schemas/SerializablePubkey' - seq: - type: integer - format: int64 - nullable: true - minimum: 0 - tree: - allOf: - - $ref: '#/components/schemas/SerializablePubkey' - nullable: true - additionalProperties: false - TokenAccountBalance: - type: object - required: - - amount - properties: - amount: - type: string - additionalProperties: false - TokenAccountList: - type: object - required: - - items - properties: - cursor: - type: string - nullable: true - items: - type: array - items: - $ref: '#/components/schemas/TokenAcccount' \ No newline at end of file diff --git a/compression-docs/.gitbook/assets/zkc24-ezgif.com-video-to-gif-converter.gif b/compression-docs/.gitbook/assets/zkc24-ezgif.com-video-to-gif-converter.gif deleted file mode 100644 index 0816c5d..0000000 Binary files a/compression-docs/.gitbook/assets/zkc24-ezgif.com-video-to-gif-converter.gif and /dev/null differ diff --git a/compression-docs/.gitbook/assets/zkcompression_1000x_banner.png b/compression-docs/.gitbook/assets/zkcompression_1000x_banner.png deleted file mode 100644 index 30e2dab..0000000 Binary files a/compression-docs/.gitbook/assets/zkcompression_1000x_banner.png and /dev/null differ diff --git a/compression-docs/README.md b/compression-docs/README.md deleted file mode 100644 index 2191b68..0000000 --- a/compression-docs/README.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -layout: - width: default - title: - visible: true - description: - visible: false - tableOfContents: - visible: true - outline: - visible: true - pagination: - visible: true ---- - -# Overview - -
- -## Welcome to ZK Compression - -ZK Compression is a new account primitive that lets developers store tokens and PDAs on Solana at a fraction of the cost, without sacrificing L1 performance or security. - -## State Cost Reduction - -
Creation CostRegular AccountCompressed Account
100-byte PDA Account~ 0.0016 SOL~ 0.00001 SOL (160x cheaper)
100 Token Accounts~ 0.2 SOL~ 0.00004 SOL (5000x cheaper)
- -## Core Features - -
Minimal state costSecurely stores state on cheaper ledger space instead of the more expensive account space, allowing apps to scale to millions of users.
L1 security & performanceExecution and data availability on Solana, preserving the performance and security guarantees of the L1
ComposableApps can mix and match between compressed and regular on-chain state, allowing atomic interaction with multiple programs, accounts, and compressed accounts.
- -## ZK and Compression in a Nutshell - -_**Compression**_**:** Only the [state roots](learn/core-concepts/state-trees.md) (small fingerprints of all [compressed accounts](learn/core-concepts/compressed-account-model.md)) are stored in on-chain accounts. The underlying data is stored on the cheaper Solana ledger. - -_**ZK**_**:** The protocol uses small zero-knowledge proofs ([validity proofs](learn/core-concepts/validity-proofs.md)) to ensure the integrity of the compressed state. This is all done under the hood. You can fetch validity proofs from [RPC providers](get-started/intro-to-development.md#rpc-connection) that support ZK Compression. - -## How to Use This Documentation - -This documentation introduces the ZK Compression primitive and guides you to relevant codebases and examples. - -{% hint style="info" %} -ZK Compression and its RPC implementation is built by [Light](https://twitter.com/LightProtocol) and [Helius](https://twitter.com/heliuslabs). -{% endhint %} diff --git a/compression-docs/SUMMARY.md b/compression-docs/SUMMARY.md deleted file mode 100644 index a53e3b9..0000000 --- a/compression-docs/SUMMARY.md +++ /dev/null @@ -1,65 +0,0 @@ -# Table of contents - -## Get Started - -* [Overview](README.md) -* [Intro to Development](get-started/intro-to-development.md) - -## Developers - -* [TypeScript Client](developers/typescript-client.md) -* [JSON RPC Methods](developers/json-rpc-methods/README.md) - * [getCompressedAccount](developers/json-rpc-methods/getcompressedaccount.md) - * [getCompressedBalance](developers/json-rpc-methods/getcompressedbalance.md) - * [getCompressedTokenAccountBalance](developers/json-rpc-methods/getcompressedtokenaccountbalance.md) - * [getCompressedBalanceByOwner](developers/json-rpc-methods/getcompressedbalancebyowner.md) - * [getCompressedMintTokenHolders](developers/json-rpc-methods/getcompressedminttokenholders.md) - * [getCompressedTokenBalancesByOwnerV2](developers/json-rpc-methods/getcompressedtokenbalancesbyownerv2.md) - * [getCompressedAccountsByOwner](developers/json-rpc-methods/getcompressedaccountsbyowner.md) - * [getMultipleCompressedAccounts](developers/json-rpc-methods/getmultiplecompressedaccounts.md) - * [getCompressedTokenAccountsByOwner](developers/json-rpc-methods/getcompressedtokenaccountsbyowner.md) - * [getCompressedTokenAccountsByDelegate](developers/json-rpc-methods/getcompressedtokenaccountsbydelegate.md) - * [getTransactionWithCompressionInfo](developers/json-rpc-methods/gettransactionwithcompressioninfo.md) - * [getCompressedAccountProof](developers/json-rpc-methods/getcompressedaccountproof.md) - * [getMultipleCompressedAccountProofs](developers/json-rpc-methods/getmultiplecompressedaccountproofs.md) - * [getMultipleNewAddressProofs](developers/json-rpc-methods/getmultiplenewaddressproofs.md) - * [getValidityProof](developers/json-rpc-methods/getvalidityproof.md) - * [getCompressionSignaturesForAccount](developers/json-rpc-methods/getcompressionsignaturesforaccount.md) - * [getCompressionSignaturesForAddress](developers/json-rpc-methods/getcompressionsignaturesforaddress.md) - * [getCompressionSignaturesForOwner](developers/json-rpc-methods/getcompressionsignaturesforowner.md) - * [getCompressionSignaturesForTokenOwner](developers/json-rpc-methods/getcompressionsignaturesfortokenowner.md) - * [getLatestCompressionSignatures](developers/json-rpc-methods/getlatestcompressionsignatures.md) - * [getLatestNonVotingSignatures](developers/json-rpc-methods/getlatestnonvotingsignatures.md) - * [getIndexerSlot](developers/json-rpc-methods/getindexerslot.md) - * [getIndexerHealth](developers/json-rpc-methods/getindexerhealth.md) -* [Addresses and URLs](developers/addresses-and-urls.md) -* [Creating Airdrops with Compressed Tokens](developers/creating-airdrops-with-compressed-tokens.md) -* [Using Token-2022](developers/using-token-2022.md) -* [Add Compressed Token Support to Your Wallet](developers/add-compressed-token-support-to-your-wallet.md) -* [Create programs with the program-template](developers/create-programs-with-the-program-template.md) - -## Learn - -* [In a Nutshell](learn/in-a-nutshell.md) -* [Core Concepts](learn/core-concepts/README.md) - * [Compressed Account Model](learn/core-concepts/compressed-account-model.md) - * [State Trees](learn/core-concepts/state-trees.md) - * [Validity Proofs](learn/core-concepts/validity-proofs.md) - * [Lifecycle of a Transaction](learn/core-concepts/lifecycle-of-a-transaction.md) - * [Limitations](learn/core-concepts/limitations.md) - -## Node Operators - -* [Run a Node](node-operators/run-a-node.md) - -## resources - -* [Changelog](resources/changelog/README.md) - * [JS - 0.21.0](resources/changelog/js-0.21.0.md) - * [Protocol - 1.0.0](resources/changelog/protocol-1.0.0.md) - * [0.6.0](resources/changelog/0.6.0.md) - * [0.5.0](resources/changelog/0.5.0.md) - * [0.4.0](resources/changelog/0.4.0.md) - * [0.3.0](resources/changelog/0.3.0.md) -* [Security](resources/security.md) -* [Privacy Policy](resources/privacy-policy.md) diff --git a/compression-docs/developers/add-compressed-token-support-to-your-wallet.md b/compression-docs/developers/add-compressed-token-support-to-your-wallet.md deleted file mode 100644 index 0decf2a..0000000 --- a/compression-docs/developers/add-compressed-token-support-to-your-wallet.md +++ /dev/null @@ -1,410 +0,0 @@ -# Add Compressed Token Support to Your Wallet - -The following page describes how to add **compressed token** support to your wallet application. - -{% hint style="info" %} -_Key benefits of compressed tokens:_ - -* Up to **5000x** cheaper than uncompressed accounts -* Compatible with existing programs via atomic compression and decompression between SPL <> Compressed tokens -{% endhint %} - -## Integration Steps - -### 1. Install the SDK - -
Package ManagerCommand
npm
npm install --save \
-    @lightprotocol/stateless.js \
-    @lightprotocol/compressed-token \
-    @solana/web3.js
-
Yarn
yarn add \
-    @lightprotocol/stateless.js \
-    @lightprotocol/compressed-token \
-    @solana/web3.js
-
- -### 2. **Create an RPC Connection** - -```tsx -import { - Rpc, - createRpc, -} from "@lightprotocol/stateless.js"; - -const RPC_ENDPOINT = "https://devnet.helius-rpc.com?api-key="; -const connection: Rpc = createRpc(RPC_ENDPOINT) -``` - -
- -Using Localnet - -```bash -# Install the development CLI -npm install @lightprotocol/zk-compression-cli -``` - -```bash -# Start a local test validator -light test-validator -``` - -```tsx -import { - Rpc, - createRpc, -} from "@lightprotocol/stateless.js"; - -const connection: Rpc = createRpc(); - -async function main() { - let slot = await connection.getSlot(); - console.log(slot); - - let health = await connection.getIndexerHealth(slot); - console.log(health); - // "Ok" -} - -main(); -``` - -
- -### 3. Display Compressed Token Balances - -```typescript -import { Rpc, createRpc } from '@lightprotocol/stateless.js'; -import { PublicKey } from '@solana/web3.js'; - -const RPC_ENDPOINT = 'https://devnet.helius-rpc.com?api-key='; -const connection: Rpc = createRpc(RPC_ENDPOINT); -const publicKey = new PublicKey('CLEuMG7pzJX9xAuKCFzBP154uiG1GaNo4Fq7x6KAcAfG'); - -(async () => { - // Returns balance for owner per mint - // Can optionally apply filter: {mint, limit, cursor} - const balances = - await connection.getCompressedTokenBalancesByOwnerV2(publicKey); - console.log(balances); -})(); -``` - -### 4. Get Compression Signature History By Owner - -```typescript -import { Rpc, createRpc } from '@lightprotocol/stateless.js'; -import { PublicKey } from '@solana/web3.js'; - -const RPC_ENDPOINT = 'https://devnet.helius-rpc.com?api-key='; -const connection: Rpc = createRpc(RPC_ENDPOINT); -const publicKey = new PublicKey('CLEuMG7pzJX9xAuKCFzBP154uiG1GaNo4Fq7x6KAcAfG'); - -(async () => { - // 1. Fetch signatures for the user - // - // Returns confirmed signatures for compression transactions involving the - // specified account owner - const signatures = - await connection.getCompressionSignaturesForOwner(publicKey); - console.log(signatures); - - // 2. Fetch transactions with compression info - // - // Returns pre- and post-compressed token balances grouped by owner - const parsedTransaction = - await connection.getTransactionWithCompressionInfo(signatures[0].signature) - console.log(parsedTransaction) -})(); -``` - -**Full JSON RPC API:** - -{% content-ref url="json-rpc-methods/" %} -[json-rpc-methods](json-rpc-methods/) -{% endcontent-ref %} - -### 5. Send Compressed Tokens - -
- -Setup Test Mint - -```typescript -import { Keypair } from "@solana/web3.js"; -import { Rpc, confirmTx, createRpc } from '@lightprotocol/stateless.js'; -import { createMint, mintTo } from '@lightprotocol/compressed-token'; - -// Set these values... -const RPC_ENDPOINT = ''; -const connection: Rpc = createRpc(RPC_ENDPOINT); -const PAYER = Keypair.generate(); -const PUBLIC_KEY = PAYER.publicKey; -const MINT_KEYPAIR = Keypair.generate(); -const RECIPIENT_PUBLIC_KEY = Keypair.generate().publicKey.toBase58(); - -/// Airdrop tokens to PAYER beforehand. -(async() => { - /// Create and register compressed-token mint - const { mint, transactionSignature } = await createMint( - connection, - PAYER, - PAYER.publicKey, - 9, - PAYER, - ); - console.log(`create-mint success! txId: ${transactionSignature}`); - - /// Mint compressed tokens - const mintToTxId = await mintTo( - connection, - PAYER, - mint, - PAYER.publicKey, - PAYER, - 1e9, - ); - - console.log(`mint-to success! txId: ${mintToTxId}`); -})(); -``` - -
- -```typescript -import { - Rpc, - createRpc, - bn, - dedupeSigner, - sendAndConfirmTx, - buildAndSignTx, -} from "@lightprotocol/stateless.js"; -import { - CompressedTokenProgram, - selectMinCompressedTokenAccountsForTransfer, -} from "@lightprotocol/compressed-token"; -import { ComputeBudgetProgram, Keypair } from "@solana/web3.js"; - -// 0. Set these values -const RPC_ENDPOINT = "https://mainnet.helius-rpc.com?api-key="; -const mint = ; -const payer = ; -const owner = payer; - -const recipient = Keypair.generate(); -const amount = bn(1e8); - -const connection: Rpc = createRpc(RPC_ENDPOINT); - -(async () => { - // 1. Fetch latest token account state - const compressedTokenAccounts = - await connection.getCompressedTokenAccountsByOwner(owner.publicKey, { - mint, - }); - - // 2. Select accounts to transfer from based on the transfer amount - const [inputAccounts] = selectMinCompressedTokenAccountsForTransfer( - compressedTokenAccounts.items, - amount - ); - - // 3. Fetch recent validity proof - const proof = await connection.getValidityProof( - inputAccounts.map((account) => account.compressedAccount.hash) - ); - - // 4. Create transfer instruction - const ix = await CompressedTokenProgram.transfer({ - payer: payer.publicKey, - inputCompressedTokenAccounts: inputAccounts, - toAddress: recipient.publicKey, - amount, - recentInputStateRootIndices: proof.rootIndices, - recentValidityProof: proof.compressedProof, - }); - - // 8. Sign, send, and confirm... - const { blockhash } = await connection.getLatestBlockhash(); - const additionalSigners = dedupeSigner(payer, [owner]); - const signedTx = buildAndSignTx( - [ComputeBudgetProgram.setComputeUnitLimit({ units: 300_000 }), ix], - payer, - blockhash, - additionalSigners - ); - return await sendAndConfirmTx(connection, signedTx); -})(); - -``` - -### Advanced Integration - -
- -Decompress SPL Tokens - -
import {
-  bn,
-  buildAndSignTx,
-  sendAndConfirmTx,
-  dedupeSigner,
-  Rpc,
-  createRpc,
-} from "@lightprotocol/stateless.js";
-import { ComputeBudgetProgram } from "@solana/web3.js";
-import {
-  CompressedTokenProgram,
-  getTokenPoolInfos,
-  selectMinCompressedTokenAccountsForTransfer,
-  selectTokenPoolInfosForDecompression,
-} from "@lightprotocol/compressed-token";
-
-// 0. Set these values.
-const connection: Rpc = createRpc("https://mainnet.helius-rpc.com?api-key=<api_key>";);
-const payer = PAYER_KEYPAIR;
-const owner = PAYER_KEYPAIR;
-const mint = MINT_ADDRESS;
-const amount = 1e5;
-
-(async () => {
-  // 1. Fetch compressed token accounts
-  const compressedTokenAccounts =
-    await connection.getCompressedTokenAccountsByOwner(owner.publicKey, {
-      mint,
-    });
-
-  // 2. Select
-  const [inputAccounts] = selectMinCompressedTokenAccountsForTransfer(
-    compressedTokenAccounts.items,
-    bn(amount)
-  );
-
-  // 3. Fetch validity proof
-  const proof = await connection.getValidityProof(
-    inputAccounts.map((account) => account.compressedAccount.hash)
-  );
-
-  // 4. Fetch & Select tokenPoolInfos
-  const tokenPoolInfos = await getTokenPoolInfos(connection, mint);
-  const selectedTokenPoolInfos = selectTokenPoolInfosForDecompression(
-    tokenPoolInfos,
-    amount
-  );
-
-  // 5. Build instruction
-  const ix = await CompressedTokenProgram.decompress({
-    payer: payer.publicKey,
-    inputCompressedTokenAccounts: inputAccounts,
-    toAddress: owner.publicKey,
-    amount,
-    tokenPoolInfos: selectedTokenPoolInfos,
-    recentInputStateRootIndices: proof.rootIndices,
-    recentValidityProof: proof.compressedProof,
-  });
-  
-  
-  // 6. Sign, send, and confirm.
-  // Example with keypair:
-  const { blockhash } = await connection.getLatestBlockhash();
-  const additionalSigners = dedupeSigner(payer, [owner]);
-  const signedTx = buildAndSignTx(
-    [ComputeBudgetProgram.setComputeUnitLimit({ units: 300_000 }), ix],
-    payer,
-    blockhash,
-    additionalSigners
-  );
-
-  return await sendAndConfirmTx(connection, signedTx);
-})();
-
- -
- -
- -Compress SPL Tokens - -```typescript -import { - buildAndSignTx, - sendAndConfirmTx, - Rpc, - createRpc, - selectStateTreeInfo, -} from "@lightprotocol/stateless.js"; -import { ComputeBudgetProgram } from "@solana/web3.js"; -import { - CompressedTokenProgram, - getTokenPoolInfos, - selectTokenPoolInfo, -} from "@lightprotocol/compressed-token"; -import { getOrCreateAssociatedTokenAccount } from "@solana/spl-token"; - -// 0. Set these values. -const connection: Rpc = createRpc( - "https://mainnet.helius-rpc.com?api-key=" -); - const payer = ; - const mint = ; -const amount = 1e5; - -(async () => { - // 1. Get user ATA - const sourceTokenAccount = await getOrCreateAssociatedTokenAccount( - connection, - payer, - mint, - payer.publicKey - ); - - // 2. Fetch & Select treeInfos - const treeInfos = await connection.getStateTreeInfos(); - const treeInfo = selectStateTreeInfo(treeInfos); - - // 3. Fetch & Select tokenPoolInfo - const tokenPoolInfos = await getTokenPoolInfos(connection, mint); - const tokenPoolInfo = selectTokenPoolInfo(tokenPoolInfos); - - // 4. Build compress instruction - const compressInstruction = await CompressedTokenProgram.compress({ - payer: payer.publicKey, - owner: payer.publicKey, - source: sourceTokenAccount.address, - toAddress: payer.publicKey, // to self. - amount, - mint, - outputStateTreeInfo: treeInfo, - tokenPoolInfo, - }); - - // 5. Sign and send tx - // Example with Keypair: - const { blockhash } = await connection.getLatestBlockhash(); - const tx = buildAndSignTx( - [ - ComputeBudgetProgram.setComputeUnitLimit({ units: 300_000 }), - compressInstruction, - ], - payer, - blockhash, - [payer] - ); - await sendAndConfirmTx(connection, tx); -})(); -``` - -
- - - -## Best Practices - -* **Clear UI Indicators —** Provide clear visual distinctions between compressed and uncompressed SPL tokens -* **Transaction History** — Provide detailed transaction histories for compressed tokens -* **Decompression and Compression** — Provide a clear path for users to convert between compressed and uncompressed tokens when needed - -## Support - -For additional support or questions, please refer to our [documentation](https://www.zkcompression.com) or contact [Swen](https://t.me/swen_light) or [Mert](https://t.me/mert_helius) on Telegram or via [email](mailto:friends@lightprotocol.com). diff --git a/compression-docs/developers/addresses-and-urls.md b/compression-docs/developers/addresses-and-urls.md deleted file mode 100644 index 284e248..0000000 --- a/compression-docs/developers/addresses-and-urls.md +++ /dev/null @@ -1,23 +0,0 @@ -# Addresses and URLs - -### Mainnet URLs - -
Network Address (RPC)https://mainnet.helius-rpc.com?api-key=<api_key>
Photon RPC APIhttps://mainnet.helius-rpc.com?api-key=<api_key>
- -### Devnet URLs - -
Network Address (RPC)https://devnet.helius-rpc.com?api-key=<api_key>
Photon RPC APIhttps://devnet.helius-rpc.com?api-key=<api_key>
- -### Program IDs & Accounts - -
Light System ProgramSySTEM1eSU2p4BGQfQpimFEWWSC1XDFeun3Nqzz3rT7
Compressed Token ProgramcTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m
Account Compression Programcompr6CUsB5m2jS4Y3831ztGSTnDpnKJTKS95d64XVq
Public State Tree #1smt1NamzXdq4AMqS2fS2F1i5KTYPZRhoHgWx38d8WsT
Public Nullifier Queue #1nfq1NvQDJ2GEgnS8zt9prAe8rjjpAW1zFkrvZoBR148
Public Address Tree #1amt1Ayt45jfbdw5YSo7iz6WZxUmnZsQTYXy82hVwyC2
Public Address Queue #1aq1S9z4reTSQAdgWHGD2zDaS39sjGrAxbR31vxJ2F4F
Token Escrow Owner PDAGXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy
- -### Lookup Tables - -{% hint style="info" %} -[Lookup tables](https://solana.com/docs/advanced/lookup-tables) reduce your transaction size. We provide pre-initialized lookup tables that cover the Light's program IDs and accounts: -{% endhint %} - -
Lookup Table #1 (Mainnet)9NYFyEqPkyXUhkerbGHXUXkvb4qpzeEdHuGpgbgpH1NJ
Lookup Table #1 (Devnet)qAJZMgnQJ8G6vA3WRcjD9Jan1wtKkaCFWLWskxJrR5V
- -We provide a helper function [here](typescript-client.md#creating-lookup-tables) if you need to extend a custom lookup table. diff --git a/compression-docs/developers/create-programs-with-the-program-template.md b/compression-docs/developers/create-programs-with-the-program-template.md deleted file mode 100644 index f7310b3..0000000 --- a/compression-docs/developers/create-programs-with-the-program-template.md +++ /dev/null @@ -1,116 +0,0 @@ -# Create programs with the program-template - -We've created a **program template** that you can use to bootstrap your program. - -{% hint style="info" %} -_Note the program-template as well as the light-sdk and proc macros are experimental convenience helpers, and their APIs are subject to change._ -{% endhint %} - -### 1. Install the CLI - -
Package ManagerCommand
npm
npm install -g @lightprotocol/zk-compression-cli
-
Yarn
yarn global add @lightprotocol/zk-compression-cli
-
- -### 2. **Initialize your program** - -{% hint style="info" %} -Requires version **v0.15.1** or higher. -{% endhint %} - -```bash -light init testprogram -``` - -This initializes an anchor program with a basic counter program template using compressed accounts. - -Now, run: - -``` -anchor build -``` - -``` -cargo test-sbf -``` - -### Common Errors - -
- - 'assert.h' file not found - during compilation.
- -```shellscript -Fix: -In your terminal, run: -1. export CC=$(xcrun -find clang) -2. export SDKROOT=$(xcrun --show-sdk-path) -3. cargo clean -4. anchor build - - -Example log: -The following warnings were emitted during compilation: - -warning: blake3@1.5.1: In file included from c/blake3_neon.c:1: -warning: blake3@1.5.1: c/blake3_impl.h:4:10: fatal error: 'assert.h' file not found -warning: blake3@1.5.1: 4 | #include -warning: blake3@1.5.1: | ^~~~~~~~~~ -warning: blake3@1.5.1: 1 error generated. - -error: failed to run custom build command for `blake3 v1.5.1` - -Caused by: - process didn't exit successfully: `/Users/you/testprogram/target/release/build/blake3-ac41d29c2eabe052/build-script-build` (exit status: 1) - --- stdout - cargo:rerun-if-env-changed=CARGO_FEATURE_PURE - cargo:rerun-if-env-changed=CARGO_FEATURE_NO_NEON - cargo:rerun-if-env-changed=CARGO_FEATURE_NEON - cargo:rerun-if-env-changed=CARGO_FEATURE_NEON - cargo:rerun-if-env-changed=CARGO_FEATURE_NO_NEON - cargo:rerun-if-env-changed=CARGO_FEATURE_PURE - cargo:rustc-cfg=blake3_neon - OUT_DIR = Some(/Users/you/testprogram/target/release/build/blake3-735a4c71d985df30/out) - TARGET = Some(aarch64-apple-darwin) - OPT_LEVEL = Some(3) - HOST = Some(aarch64-apple-darwin) - cargo:rerun-if-env-changed=CC_aarch64-apple-darwin - CC_aarch64-apple-darwin = None - cargo:rerun-if-env-changed=CC_aarch64_apple_darwin - CC_aarch64_apple_darwin = None - cargo:rerun-if-env-changed=HOST_CC - HOST_CC = None - cargo:rerun-if-env-changed=CC - CC = Some(/Users/you/.local/share/solana/install/releases/1.18.22/solana-release/bin/sdk/sbf/dependencies/platform-tools/llvm/bin/clang) - RUSTC_WRAPPER = None - cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT - cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS - CRATE_CC_NO_DEFAULTS = None - DEBUG = Some(false) - cargo:rerun-if-env-changed=MACOSX_DEPLOYMENT_TARGET - MACOSX_DEPLOYMENT_TARGET = None - cargo:rerun-if-env-changed=CFLAGS_aarch64-apple-darwin - CFLAGS_aarch64-apple-darwin = None - cargo:rerun-if-env-changed=CFLAGS_aarch64_apple_darwin - CFLAGS_aarch64_apple_darwin = None - cargo:rerun-if-env-changed=HOST_CFLAGS - HOST_CFLAGS = None - cargo:rerun-if-env-changed=CFLAGS - CFLAGS = None - cargo:warning=In file included from c/blake3_neon.c:1: - cargo:warning=c/blake3_impl.h:4:10: fatal error: 'assert.h' file not found - cargo:warning= 4 | #include - cargo:warning= | ^~~~~~~~~~ - cargo:warning=1 error generated. - - --- stderr - - - error occurred: Command env -u IPHONEOS_DEPLOYMENT_TARGET "/Users/you/.local/share/solana/install/releases/1.18.22/solana-release/bin/sdk/sbf/dependencies/platform-tools/llvm/bin/clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=arm64-apple-darwin" "-mmacosx-version-min=14.4" "-Wall" "-Wextra" "-std=c11" "-o" "/Users/you/testprogram/target/release/build/blake3-735a4c71d985df30/out/db3b6bfb95261072-blake3_neon.o" "-c" "c/blake3_neon.c" with args clang did not execute successfully (status code exit status: 1). -``` - -
- -## Support - -For additional support or questions, please refer to our [documentation](https://www.zkcompression.com) or contact [Swen](https://t.me/swen\_light) or [Mert](https://t.me/mert\_helius) on Telegram or via [email](mailto:friends@lightprotocol.com) diff --git a/compression-docs/developers/creating-airdrops-with-compressed-tokens.md b/compression-docs/developers/creating-airdrops-with-compressed-tokens.md deleted file mode 100644 index bd375d1..0000000 --- a/compression-docs/developers/creating-airdrops-with-compressed-tokens.md +++ /dev/null @@ -1,845 +0,0 @@ -# Creating Airdrops with Compressed Tokens - -**ZK Compression is the most efficient way to distribute your SPL tokens.** - -**By the end of this guide, you'll have built a fully functioning, programmatic airdrop.** - -{% hint style="info" %} -_Key benefits of compressed tokens:_ - -* Up to 5000x cheaper than regular tokens -* Supported by leading Solana wallets, including Phantom and Backpack -* Compatible with existing programs via atomic compression and decompression between SPL <> Compressed tokens -{% endhint %} - -## Airdropping SPL Tokens - -
- -No-code Solution - -[Airship](https://airship.helius.dev/) by Helius Labs is an excellent no-code airdrop tool. Airship uses compressed tokens under the hood.\ -\ -For programmatic airdrops with more control, keep reading. :point\_down: - -
- -The high-level overview is this: - -1. Mint and send the to-be-airdropped SPL tokens to a wallet you control. -2. Create batches of instructions based on a list of recipients and amounts. -3. Build transactions from these instruction batches, then sign, send, and confirm them. - -{% hint style="info" %} -The code snippets work! You can copy + paste them into your IDE. -{% endhint %} - -### 1. Install the SDK - -{% tabs %} -{% tab title="npm" %} -```bash -npm install --save \ - @lightprotocol/stateless.js \ - @lightprotocol/compressed-token \ - @solana/web3.js \ - @solana/spl-token \ - bs58 \ - dotenv -``` -{% endtab %} - -{% tab title="yarn" %} -```bash -yarn add \ - @lightprotocol/stateless.js \ - @lightprotocol/compressed-token \ - @solana/web3.js \ - @solana/spl-token \ - bs58 \ - dotenv -``` -{% endtab %} - -{% tab title="pnpm" %} -```bash -pnpm add \ - @lightprotocol/stateless.js \ - @lightprotocol/compressed-token \ - @solana/web3.js \ - @solana/spl-token \ - bs58 \ - dotenv -``` -{% endtab %} -{% endtabs %} - -### 2. Mint SPL tokens to yourself - -{% tabs %} -{% tab title="Default" %} -```typescript -import { Keypair } from '@solana/web3.js'; -import { createRpc } from '@lightprotocol/stateless.js'; -import { - createMint, - getOrCreateAssociatedTokenAccount, - mintTo, -} from "@solana/spl-token"; -import { createTokenPool } from '@lightprotocol/compressed-token'; -import bs58 from "bs58"; -import dotenv from "dotenv"; -dotenv.config(); - - -// Set these values in your .env file -const RPC_ENDPOINT = process.env.RPC_ENDPOINT!; -const PAYER = Keypair.fromSecretKey( - bs58.decode(process.env.PAYER_KEYPAIR!) -); -// Create Rpc endpoint -const connection = createRpc(RPC_ENDPOINT); - - -(async() => { - - /// Create an SPL mint - const mint = await createMint( - connection, - PAYER, - PAYER.publicKey, - null, - 9 - ); - console.log(`create-mint success! address: ${mint}`); - - /// Register mint for compression - const poolTxId = await createTokenPool(connection, PAYER, mint); - console.log(`createTokenPool success: ${poolTxId}`); - - - /// Create an associated SPL token account for the sender (PAYER) - const ata = await getOrCreateAssociatedTokenAccount( - connection, - PAYER, - mint, - PAYER.publicKey - ); - console.log(`ATA: ${ata.address.toBase58()}`); - - - /// Mint SPL tokens to the sender - const mintToTxId = await mintTo( - connection, - PAYER, - mint, - ata.address, - PAYER.publicKey, - 1e9 * 1e9 // 1b * decimals - ); - console.log(`mint-to success! txId: ${mintToTxId}`); -})(); -``` -{% endtab %} - -{% tab title="With `createMint` helper" %} -If you create a new mint, you can use the `createMint` helper from `@lightprotocol/compressed-token`. It creates the mint **and** registers it for compression. - -```typescript -import { Keypair } from '@solana/web3.js'; -import { createRpc } from '@lightprotocol/stateless.js'; -import { createMint } from '@lightprotocol/compressed-token'; -import { - getOrCreateAssociatedTokenAccount, - mintTo, -} from "@solana/spl-token"; -import bs58 from "bs58"; -import dotenv from "dotenv"; -dotenv.config(); - -// Set these values in your .env file -const RPC_ENDPOINT = process.env.RPC_ENDPOINT!; -const PAYER = Keypair.fromSecretKey( - bs58.decode(process.env.PAYER_KEYPAIR!) -); -// Create Rpc endpoint -const connection = createRpc(RPC_ENDPOINT); - - -(async() => { - - /// Create an SPL mint + register it for compression. - const { mint, transactionSignature } = await createMint( - connection, - PAYER, - PAYER.publicKey, - 9, - ); - console.log(`create-mint success! txId: ${transactionSignature}`); - - - /// Create an associated SPL token account for the sender (PAYER) - const ata = await getOrCreateAssociatedTokenAccount( - connection, - PAYER, - mint, - PAYER.publicKey - ); - console.log(`ATA: ${ata.address.toBase58()}`); - - - - /// Mint SPL tokens to the sender - const mintToTxId = await mintTo( - connection, - PAYER, - mint, - ata.address, - PAYER.publicKey, - 1e9 * 1e9 // 1b * decimals - ); - console.log(`mint-to success! txId: ${mintToTxId}`); -})(); -``` -{% endtab %} -{% endtabs %} - -You now have a regular SPL token account owned by `PAYER` that holds all minted tokens. - -### 3. Distribute the tokens - -Next, you want to distribute the SPL tokens from your distributor to all recipients. - -{% hint style="info" %} -Ensure you have the latest `@lightprotocol/stateless.js` and `@lightprotocol/compressed-token` versions `≥ 0.21.0`! -{% endhint %} - -#### A. Simple version - -
- -Simple airdrop script - -```typescript -import { Keypair, PublicKey, ComputeBudgetProgram } from "@solana/web3.js"; -import { - CompressedTokenProgram, - getTokenPoolInfos, - selectTokenPoolInfo, -} from "@lightprotocol/compressed-token"; -import { - bn, - buildAndSignTx, - calculateComputeUnitPrice, - createRpc, - dedupeSigner, - Rpc, - selectStateTreeInfo, - sendAndConfirmTx, -} from "@lightprotocol/stateless.js"; -import { getOrCreateAssociatedTokenAccount } from "@solana/spl-token"; -import dotenv from "dotenv"; -import bs58 from "bs58"; -dotenv.config(); - -// Set these values in your .env file -const RPC_ENDPOINT = process.env.RPC_ENDPOINT; -const MINT_ADDRESS = new PublicKey(process.env.MINT_ADDRESS!); -const PAYER_KEYPAIR = Keypair.fromSecretKey( - bs58.decode(process.env.PAYER_KEYPAIR!) -); - -(async () => { - const connection: Rpc = createRpc(RPC_ENDPOINT); - const mintAddress = MINT_ADDRESS; - const payer = PAYER_KEYPAIR; - const owner = payer; - - /// Select a new tree for each transaction. - const activeStateTrees = await connection.getStateTreeInfos(); - const treeInfo = selectStateTreeInfo(activeStateTrees); - - /// Select a tokenpool info - const infos = await getTokenPoolInfos(connection, mintAddress); - const info = selectTokenPoolInfo(infos); - - const sourceTokenAccount = await getOrCreateAssociatedTokenAccount( - connection, - payer, - mintAddress, - payer.publicKey - ); - - // Airdrop to example recipient - // 1 recipient = 120_000 CU - // 5 recipients = 170_000 CU - const airDropAddresses = ["GMPWaPPrCeZPse5kwSR3WUrqYAPrVZBSVwymqh7auNW7"].map( - (address) => new PublicKey(address) - ); - - const amount = bn(111); - - const instructions = []; - instructions.push( - ComputeBudgetProgram.setComputeUnitLimit({ units: 120_000 }), - ComputeBudgetProgram.setComputeUnitPrice({ - // Replace this with a dynamic priority_fee based on network conditions. - microLamports: calculateComputeUnitPrice(20_000, 120_000), - }) - ); - - const compressInstruction = await CompressedTokenProgram.compress({ - payer: payer.publicKey, - owner: owner.publicKey, - source: sourceTokenAccount.address, - toAddress: airDropAddresses, - amount: airDropAddresses.map(() => amount), - mint: mintAddress, - tokenPoolInfo: info, - outputStateTreeInfo: treeInfo, - }); - instructions.push(compressInstruction); - - const additionalSigners = dedupeSigner(payer, [owner]); - const { blockhash } = await connection.getLatestBlockhash(); - - const tx = buildAndSignTx(instructions, payer, blockhash, additionalSigners); - - const txId = await sendAndConfirmTx(connection, tx); - console.log(`txId: ${txId}`); -})(); - -``` - -
- -#### B. Optimized For large-scale airdrops - -First, create a helper that takes recipients and amounts and returns batches of instructions: - -
- -1. create-instructions.ts - -```typescript -// create-instructions.ts -import { - CompressedTokenProgram, - TokenPoolInfo, -} from "@lightprotocol/compressed-token"; -import { - bn, - selectStateTreeInfo, - StateTreeInfo, -} from "@lightprotocol/stateless.js"; -import { - ComputeBudgetProgram, - TransactionInstruction, - PublicKey, -} from "@solana/web3.js"; - -interface CreateAirdropInstructionsParams { - amount: number | bigint; - recipients: PublicKey[]; - payer: PublicKey; - sourceTokenAccount: PublicKey; - mint: PublicKey; - stateTreeInfos: StateTreeInfo[]; - tokenPoolInfos: TokenPoolInfo[]; - maxRecipientsPerInstruction?: number; - maxInstructionsPerTransaction?: number; - computeUnitLimit?: number; - computeUnitPrice?: number | undefined; -} - -export type InstructionBatch = TransactionInstruction[]; - -export async function createAirdropInstructions({ - amount, - recipients, - payer, - sourceTokenAccount, - mint, - stateTreeInfos, - tokenPoolInfos, - maxRecipientsPerInstruction = 5, - maxInstructionsPerTransaction = 3, - computeUnitLimit = 500_000, - computeUnitPrice = undefined, -}: CreateAirdropInstructionsParams): Promise { - const instructionBatches: InstructionBatch[] = []; - const amountBn = bn(amount.toString()); - - // Process recipients in chunks - for ( - let i = 0; - i < recipients.length; - i += maxRecipientsPerInstruction * maxInstructionsPerTransaction - ) { - const instructions: TransactionInstruction[] = []; - - instructions.push( - ComputeBudgetProgram.setComputeUnitLimit({ units: computeUnitLimit }) - ); - if (computeUnitPrice) { - instructions.push( - ComputeBudgetProgram.setComputeUnitPrice({ - microLamports: computeUnitPrice, - }) - ); - } - - const treeInfo = selectStateTreeInfo(stateTreeInfos); - const tokenPoolInfo = selectTokenPoolInfo(tokenPoolInfos); - - for (let j = 0; j < maxInstructionsPerTransaction; j++) { - const startIdx = i + j * maxRecipientsPerInstruction; - const recipientBatch = recipients.slice( - startIdx, - startIdx + maxRecipientsPerInstruction - ); - - if (recipientBatch.length === 0) break; - - const compressIx = await CompressedTokenProgram.compress({ - payer, - owner: payer, - source: sourceTokenAccount, - toAddress: recipientBatch, - amount: recipientBatch.map(() => amountBn), - mint, - tokenPoolInfo, - outputStateTreeInfo: treeInfo, - }); - - instructions.push(compressIx); - } - - if ( - (computeUnitPrice && instructions.length > 2) || - (!computeUnitPrice && instructions.length > 1) - ) { - instructionBatches.push(instructions); - } - } - - return instructionBatches; -} -``` - - - -
- -Now, you can create the logic that signs and sends transactions in batches. For this, first add a helper method that refreshes Solana blockhashes in the background: - -
- -2. update-blockhash.ts - -```typescript -// update-blockhash.ts -import { Rpc } from "@lightprotocol/stateless.js"; - -export let currentBlockhash: string; - -export async function updateBlockhash( - connection: Rpc, - signal: AbortSignal -): Promise { - try { - const { blockhash } = await connection.getLatestBlockhash(); - currentBlockhash = blockhash; - console.log(`Initial blockhash: ${currentBlockhash}`); - } catch (error) { - console.error("Failed to fetch initial blockhash:", error); - return; - } - - // Update blockhash in the background - (function updateInBackground() { - if (signal.aborted) return; - const timeoutId = setTimeout(async () => { - if (signal.aborted) return; - try { - const { blockhash } = await connection.getLatestBlockhash(); - currentBlockhash = blockhash; - console.log(`Updated blockhash: ${currentBlockhash}`); - } catch (error) { - console.error("Failed to update blockhash:", error); - } - updateInBackground(); - }, 30_000); - - signal.addEventListener("abort", () => clearTimeout(timeoutId)); - })(); -} -``` - - - -
- -Then, add the helper that signs and sends the transactions using recent blockhashes. - -
- -3. sign-and-send.ts - -```typescript -// sign-and-send.ts -import { Rpc, sendAndConfirmTx } from "@lightprotocol/stateless.js"; -import { - Keypair, - PublicKey, - TransactionMessage, - VersionedTransaction, -} from "@solana/web3.js"; -import { InstructionBatch } from "./create-instructions"; -import { currentBlockhash, updateBlockhash } from "./update-blockhash"; -import bs58 from "bs58"; - -export enum BatchResultType { - Success = "success", - Error = "error", -} - -export type BatchResult = - | { type: BatchResultType.Success; index: number; signature: string } - | { type: BatchResultType.Error; index: number; error: string }; - -export async function* signAndSendAirdropBatches( - batches: InstructionBatch[], - payer: Keypair, - connection: Rpc, - maxRetries = 3 -): AsyncGenerator { - const abortController = new AbortController(); - const { signal } = abortController; - - await updateBlockhash(connection, signal); - - const statusMap = new Array(batches.length).fill(0); // Initialize all as pending (0) - - // Use zk-compression LUT for your network - // https://www.zkcompression.com/developers/protocol-addresses-and-urls#lookup-tables - const lookupTableAddress = new PublicKey( - "9NYFyEqPkyXUhkerbGHXUXkvb4qpzeEdHuGpgbgpH1NJ" - ); - - // Get the lookup table account - const lookupTableAccount = ( - await connection.getAddressLookupTable(lookupTableAddress) - ).value!; - - while (statusMap.includes(0)) { - // Continue until all are confirmed or errored - const pendingBatches = statusMap.filter((status) => status === 0).length; - console.log(`Sending ${pendingBatches} transactions`); - - const sends = statusMap.map(async (status, index) => { - if (status !== 0) return; // Skip non-pending batches - - let retries = 0; - while (retries < maxRetries && statusMap[index] === 0) { - if (!currentBlockhash) { - console.warn("Waiting for blockhash to be set..."); - await new Promise((resolve) => setTimeout(resolve, 1000)); - continue; - } - - try { - const tx = new VersionedTransaction( - new TransactionMessage({ - payerKey: payer.publicKey, - recentBlockhash: currentBlockhash, - instructions: batches[index], - }).compileToV0Message([lookupTableAccount]) - ); - tx.sign([payer]); - - const sig = bs58.encode(tx.signatures[0]); - console.log(`Batch ${index} signature: ${sig}`); - - const confirmedSig = await sendAndConfirmTx(connection, tx, { - skipPreflight: true, - commitment: "confirmed", - }); - - if (confirmedSig) { - statusMap[index] = 1; // Mark as confirmed - return { - type: BatchResultType.Success, - index, - signature: confirmedSig, - }; - } - } catch (e) { - retries++; - console.warn(`Retrying batch ${index}, attempt ${retries + 1}`); - if (retries >= maxRetries) { - statusMap[index] = `err: ${(e as Error).message}`; // Mark as error - return { - type: BatchResultType.Error, - index, - error: (e as Error).message, - }; - } - } - } - }); - - const results = await Promise.all(sends); - for (const result of results) { - if (result) yield result as BatchResult; - } - } - - // Stop the blockhash update loop - abortController.abort(); -} -``` - - - -
- -Finally, put it all together in your main file: - -
- -airdrop.ts (entrypoint file) - -```typescript -// airdrop.ts -import { Keypair, LAMPORTS_PER_SOL, PublicKey } from "@solana/web3.js"; -import { - calculateComputeUnitPrice, - createRpc, - Rpc, -} from "@lightprotocol/stateless.js"; -import { createMint, getTokenPoolInfos } from "@lightprotocol/compressed-token"; -import { getOrCreateAssociatedTokenAccount, mintTo } from "@solana/spl-token"; -import { createAirdropInstructions } from "./create-instructions"; -import { BatchResultType, signAndSendAirdropBatches } from "./sign-and-send"; -import dotenv from "dotenv"; -import bs58 from "bs58"; -dotenv.config(); - -const RPC_ENDPOINT = `https://mainnet.helius-rpc.com?api-key=${process.env.HELIUS_API_KEY}`; -const connection: Rpc = createRpc(RPC_ENDPOINT); -const PAYER = Keypair.fromSecretKey(bs58.decode(process.env.PAYER_KEYPAIR!)); - -// These are 20 example Solana Pubkeys -const recipients = [ - "GMPWaPPrCeZPse5kwSR3WUrqYAPrVZBSVwymqh7auNW7", - "GySGrTgPtPfMtYoYTmwUdUDFwVJbFMfip7QZdhgXp8dy", - "Bk1r2vcgX2uTzwV3AUyfRbSfGKktoQrQufBSrHzere74", - "8BvkadZ6ycFNmQF7S1MHRvEVNb1wvDBFdjkAUnxjK9Ug", - "EmxcvFKXsWLzUho8AhV9LCKeKRFHg5gAs4sKNJwhe5PF", - "6mqdHkSpcvNexmECjp5XLt9V9KnSQre9TvbMLGr6sEPM", - "3k4MViTWXBjFvoUZiJcNGPvzrqnTa41gcrbWCMMnV6ys", - "2k6BfYRUZQHquPtpkyJpUx3DzM7W3K6H95igtJk8ztpd", - "89jPyNNLCcqWn1RZThSS4jSqU5VCJkR5mAaSaVzuuqH4", - "3MzSRLf9jSt6d1MFFMMtPfUcDY6XziRxTB8C5mfvgxXG", - "9A1H6f3N8mpAPSdfqvYRD4cM1NwDZoMe3yF5DwibL2R2", - "PtUAhLvUsVcoesDacw198SsnMoFNVskR5pT3QvsBSQw", - "6C6W6WpgFK8TzTTMNCPMz2t9RaMs4XnkfB6jotrWWzYJ", - "8sLy9Jy8WSh6boq9xgDeBaTznn1wb1uFpyXphG3oNjL5", - "GTsQu2XCgkUczigdBFTWKrdDgNKLs885jKguyhkqdPgV", - "85UK4bjC71Jwpyn8mPSaW3oYyEAiHPbESByq9s5wLcke", - "9aEJT4CYHEUWwwSQwueZc9EUjhWSLD6AAbpVmmKDeP7H", - "CY8QjRio1zd9bYWMKiVRrDbwVenf3JzsGf5km5zLgY9n", - "CeHbdxgYifYhpB6sXGonKzmaejqEfq2ym5utTmB6XMVv", - "4z1qss12DjUzGUkK1fFesqrUwrEVJJvzPMNkwqYnbAR5", -].map((address) => new PublicKey(address)); - -(async () => { - /// Create an SPL mint + register it for compression. - const { mint, transactionSignature } = await createMint( - connection, - PAYER, - PAYER.publicKey, - 9 - ); - console.log( - `create-mint success! txId: ${transactionSignature}, mint: ${mint.toBase58()}` - ); - - /// Create an associated SPL token account for the sender (PAYER) - const ata = await getOrCreateAssociatedTokenAccount( - connection, - PAYER, - mint, - PAYER.publicKey - ); - console.log(`ATA: ${ata.address.toBase58()}`); - - /// Mint SPL tokens to the sender - const mintToTxId = await mintTo( - connection, - PAYER, - mint, - ata.address, - PAYER.publicKey, - 10e9 * LAMPORTS_PER_SOL // 10B tokens * decimals - ); - console.log(`mint-to success! txId: ${mintToTxId}`); - - const stateTreeInfos = await connection.getStateTreeInfos(); - - const tokenPoolInfos = await getTokenPoolInfos(connection, mint); - - const instructionBatches = await createAirdropInstructions({ - amount: 1e6, - recipients, - payer: PAYER.publicKey, - sourceTokenAccount: ata.address, - mint, - stateTreeInfos, - tokenPoolInfos, - computeUnitPrice: calculateComputeUnitPrice(10_000, 500_000), - }); - - for await (const result of signAndSendAirdropBatches( - instructionBatches, - PAYER, - connection - )) { - if (result.type === BatchResultType.Success) { - console.log(`Batch ${result.index} confirmed: ${result.signature}`); - } else if (result.type === BatchResultType.Error) { - console.log(`Batch ${result.index} failed: ${result.error}`); - // Use result.index to access the specific batch in instructionBatches - const failedBatch = instructionBatches[result.index]; - console.log(`Failed batch instructions:`, failedBatch); - // Additional logic to handle failed instructions - } - } - - console.log("Airdrop process complete."); -})(); - -``` - - - -
- -Ensure that you have all the necessary `.env` variables set up. You can now run your code and execute the airdrop! - -## Advanced: Decompress / Claim - -{% hint style="info" %} -Compressed tokens are supported in major Solana wallets like Phantom and Backpack. Still, you can let users decompress to SPL via your Frontend (FE) to customize claims. Here's how:point\_down: -{% endhint %} - -
- -Decompress SPL Tokens - -```typescript -import { - bn, - buildAndSignTx, - sendAndConfirmTx, - dedupeSigner, - Rpc, - createRpc, -} from "@lightprotocol/stateless.js"; -import { ComputeBudgetProgram, Keypair, PublicKey } from "@solana/web3.js"; -import { - CompressedTokenProgram, - getTokenPoolInfos, - selectMinCompressedTokenAccountsForTransfer, - selectTokenPoolInfosForDecompression, -} from "@lightprotocol/compressed-token"; -import { getOrCreateAssociatedTokenAccount } from "@solana/spl-token"; -import bs58 from "bs58"; -import dotenv from "dotenv"; -dotenv.config(); - -// Set these values in your .env file -const RPC_ENDPOINT = process.env.RPC_ENDPOINT; -const mint = new PublicKey(process.env.MINT_ADDRESS!); -const payer = Keypair.fromSecretKey(bs58.decode(process.env.PAYER_KEYPAIR!)); - -const owner = payer; -const amount = 1e5; -const connection: Rpc = createRpc(RPC_ENDPOINT); - -(async () => { - // 1. Create an associated token account for the user if it doesn't exist - const ata = await getOrCreateAssociatedTokenAccount( - connection, - payer, - mint, - payer.publicKey - ); - - // 2. Fetch compressed token accounts - const compressedTokenAccounts = - await connection.getCompressedTokenAccountsByOwner(owner.publicKey, { - mint, - }); - - // 3. Select - const [inputAccounts] = selectMinCompressedTokenAccountsForTransfer( - compressedTokenAccounts.items, - bn(amount) - ); - - // 4. Fetch validity proof - const proof = await connection.getValidityProof( - inputAccounts.map((account) => account.compressedAccount.hash) - ); - - // 5. Fetch token pool infos - const tokenPoolInfos = await getTokenPoolInfos(connection, mint); - - // 6. Select - const selectedTokenPoolInfos = selectTokenPoolInfosForDecompression( - tokenPoolInfos, - amount - ); - - // 7. Build instruction - const ix = await CompressedTokenProgram.decompress({ - payer: payer.publicKey, - inputCompressedTokenAccounts: inputAccounts, - toAddress: ata.address, - amount, - tokenPoolInfos: selectedTokenPoolInfos, - recentInputStateRootIndices: proof.rootIndices, - recentValidityProof: proof.compressedProof, - }); - - // 8. Sign, send, and confirm - const { blockhash } = await connection.getLatestBlockhash(); - const additionalSigners = dedupeSigner(payer, [owner]); - const signedTx = buildAndSignTx( - [ComputeBudgetProgram.setComputeUnitLimit({ units: 300_000 }), ix], - payer, - blockhash, - additionalSigners - ); - return await sendAndConfirmTx(connection, signedTx); -})(); - -``` - -
- -## Advanced Tips - -* Set priority fees dynamically for decompression. Learn more [here](https://docs.helius.dev/guides/sending-transactions-on-solana#summary). - -## Native Swap via Jup-API - -* If you have a custom FE, you can let users swap compressed tokens using the Jup-API. A reference implementation is available [here](https://github.com/Lightprotocol/example-jupiter-swap-node). - -*** - -## Support - -For additional support or questions, please refer to our [documentation](https://www.zkcompression.com), or contact [Swen](https://t.me/swen_light) or [Mert](https://t.me/mert_helius) on Telegram or via [email](mailto:friends@lightprotocol.com). diff --git a/compression-docs/developers/json-rpc-methods/README.md b/compression-docs/developers/json-rpc-methods/README.md deleted file mode 100644 index af09cd3..0000000 --- a/compression-docs/developers/json-rpc-methods/README.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -description: >- - Helius Labs maintains the canonical RPC API and indexer implementation. The - following pages outline all ZK Compression methods extending Solana's default - JSON RPC API. ---- - -# JSON RPC Methods - diff --git a/compression-docs/developers/json-rpc-methods/getcompressedaccount.md b/compression-docs/developers/json-rpc-methods/getcompressedaccount.md deleted file mode 100644 index 7c240d1..0000000 --- a/compression-docs/developers/json-rpc-methods/getcompressedaccount.md +++ /dev/null @@ -1,7 +0,0 @@ -# getCompressedAccount - -Returns the compressed account with the given address or hash - -{% swagger src="https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getCompressedAccount.yaml" path="/" method="post" %} -[https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getCompressedAccount.yaml](https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getCompressedAccount.yaml) -{% endswagger %} diff --git a/compression-docs/developers/json-rpc-methods/getcompressedaccountproof.md b/compression-docs/developers/json-rpc-methods/getcompressedaccountproof.md deleted file mode 100644 index 1a4b9bb..0000000 --- a/compression-docs/developers/json-rpc-methods/getcompressedaccountproof.md +++ /dev/null @@ -1,7 +0,0 @@ -# getCompressedAccountProof - -Returns a proof the compression program uses to verify that the account is valid - -{% swagger src="https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getCompressedAccountProof.yaml" path="/" method="post" %} -[https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getCompressedAccountProof.yaml](https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getCompressedAccountProof.yaml) -{% endswagger %} diff --git a/compression-docs/developers/json-rpc-methods/getcompressedaccountsbyowner.md b/compression-docs/developers/json-rpc-methods/getcompressedaccountsbyowner.md deleted file mode 100644 index 83b7f80..0000000 --- a/compression-docs/developers/json-rpc-methods/getcompressedaccountsbyowner.md +++ /dev/null @@ -1,7 +0,0 @@ -# getCompressedAccountsByOwner - -Returns the owner's compressed accounts. This is a paginated endpoint - -{% swagger src="https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getCompressedAccountsByOwner.yaml" path="/" method="post" %} -[https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getCompressedAccountsByOwner.yaml](https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getCompressedAccountsByOwner.yaml) -{% endswagger %} diff --git a/compression-docs/developers/json-rpc-methods/getcompressedbalance.md b/compression-docs/developers/json-rpc-methods/getcompressedbalance.md deleted file mode 100644 index 6a11569..0000000 --- a/compression-docs/developers/json-rpc-methods/getcompressedbalance.md +++ /dev/null @@ -1,7 +0,0 @@ -# getCompressedBalance - -Returns the balance for the compressed account with the given address or hash - -{% swagger src="https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getCompressedAccountBalance.yaml" path="/" method="post" %} -[https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getCompressedAccountBalance.yaml](https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getCompressedAccountBalance.yaml) -{% endswagger %} diff --git a/compression-docs/developers/json-rpc-methods/getcompressedbalancebyowner.md b/compression-docs/developers/json-rpc-methods/getcompressedbalancebyowner.md deleted file mode 100644 index 852f36b..0000000 --- a/compression-docs/developers/json-rpc-methods/getcompressedbalancebyowner.md +++ /dev/null @@ -1,7 +0,0 @@ -# getCompressedBalanceByOwner - -Returns the total balance of the owner's compressed accounts - -{% swagger src="https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getCompressedBalanceByOwner.yaml" path="/" method="post" %} -[https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getCompressedBalanceByOwner.yaml](https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getCompressedBalanceByOwner.yaml) -{% endswagger %} diff --git a/compression-docs/developers/json-rpc-methods/getcompressedminttokenholders.md b/compression-docs/developers/json-rpc-methods/getcompressedminttokenholders.md deleted file mode 100644 index 2bf5828..0000000 --- a/compression-docs/developers/json-rpc-methods/getcompressedminttokenholders.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -description: >- - Returns the owner balances for a given mint in descending order. This is a - paginated endpoint ---- - -# getCompressedMintTokenHolders - -{% swagger src="https://raw.githubusercontent.com/helius-labs/photon/refs/heads/main/src/openapi/specs/getCompressedMintTokenHolders.yaml" path="/" method="post" %} -[https://raw.githubusercontent.com/helius-labs/photon/refs/heads/main/src/openapi/specs/getCompressedMintTokenHolders.yaml](https://raw.githubusercontent.com/helius-labs/photon/refs/heads/main/src/openapi/specs/getCompressedMintTokenHolders.yaml) -{% endswagger %} - diff --git a/compression-docs/developers/json-rpc-methods/getcompressedtokenaccountbalance.md b/compression-docs/developers/json-rpc-methods/getcompressedtokenaccountbalance.md deleted file mode 100644 index 6d4fcdc..0000000 --- a/compression-docs/developers/json-rpc-methods/getcompressedtokenaccountbalance.md +++ /dev/null @@ -1,7 +0,0 @@ -# getCompressedTokenAccountBalance - -Returns the balance for a given token account - -{% swagger src="https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getCompressedTokenAccountBalance.yaml" path="/" method="post" %} -[https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getCompressedTokenAccountBalance.yaml](https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getCompressedTokenAccountBalance.yaml) -{% endswagger %} diff --git a/compression-docs/developers/json-rpc-methods/getcompressedtokenaccountsbydelegate.md b/compression-docs/developers/json-rpc-methods/getcompressedtokenaccountsbydelegate.md deleted file mode 100644 index fadbea1..0000000 --- a/compression-docs/developers/json-rpc-methods/getcompressedtokenaccountsbydelegate.md +++ /dev/null @@ -1,7 +0,0 @@ -# getCompressedTokenAccountsByDelegate - -Returns the compressed token accounts that are partially or fully delegated to the given delegate. This is a paginated endpoint - -{% swagger src="https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getCompressedTokenAccountsByDelegate.yaml" path="/" method="post" %} -[https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getCompressedTokenAccountsByDelegate.yaml](https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getCompressedTokenAccountsByDelegate.yaml) -{% endswagger %} diff --git a/compression-docs/developers/json-rpc-methods/getcompressedtokenaccountsbyowner.md b/compression-docs/developers/json-rpc-methods/getcompressedtokenaccountsbyowner.md deleted file mode 100644 index 6d807f1..0000000 --- a/compression-docs/developers/json-rpc-methods/getcompressedtokenaccountsbyowner.md +++ /dev/null @@ -1,7 +0,0 @@ -# getCompressedTokenAccountsByOwner - -Returns the compressed token accounts owned by a certain account - -{% swagger src="https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getCompressedTokenAccountsByOwner.yaml" path="/" method="post" %} -[https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getCompressedTokenAccountsByOwner.yaml](https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getCompressedTokenAccountsByOwner.yaml) -{% endswagger %} diff --git a/compression-docs/developers/json-rpc-methods/getcompressedtokenbalancesbyownerv2.md b/compression-docs/developers/json-rpc-methods/getcompressedtokenbalancesbyownerv2.md deleted file mode 100644 index daca8a7..0000000 --- a/compression-docs/developers/json-rpc-methods/getcompressedtokenbalancesbyownerv2.md +++ /dev/null @@ -1,8 +0,0 @@ -# getCompressedTokenBalancesByOwnerV2 - -Returns the token balances for a given owner. This is a paginated endpoint. The V2 version solves a minor naming issue. - -{% swagger src="https://raw.githubusercontent.com/helius-labs/photon/refs/heads/main/src/openapi/specs/getCompressedTokenBalancesByOwnerV2.yaml" path="/" method="post" %} -[https://raw.githubusercontent.com/helius-labs/photon/refs/heads/main/src/openapi/specs/getCompressedTokenBalancesByOwnerV2.yaml](https://raw.githubusercontent.com/helius-labs/photon/refs/heads/main/src/openapi/specs/getCompressedTokenBalancesByOwnerV2.yaml) -{% endswagger %} - diff --git a/compression-docs/developers/json-rpc-methods/getcompressionsignaturesforaccount.md b/compression-docs/developers/json-rpc-methods/getcompressionsignaturesforaccount.md deleted file mode 100644 index 005f6a8..0000000 --- a/compression-docs/developers/json-rpc-methods/getcompressionsignaturesforaccount.md +++ /dev/null @@ -1,7 +0,0 @@ -# getCompressionSignaturesForAccount - -Return the signatures of the transactions that closed or opened a compressed account with the given hash. This is a paginated endpoint - -{% swagger src="https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getCompressionSignaturesForAccount.yaml" path="/" method="post" %} -[https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getCompressionSignaturesForAccount.yaml](https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getCompressionSignaturesForAccount.yaml) -{% endswagger %} diff --git a/compression-docs/developers/json-rpc-methods/getcompressionsignaturesforaddress.md b/compression-docs/developers/json-rpc-methods/getcompressionsignaturesforaddress.md deleted file mode 100644 index a287058..0000000 --- a/compression-docs/developers/json-rpc-methods/getcompressionsignaturesforaddress.md +++ /dev/null @@ -1,7 +0,0 @@ -# getCompressionSignaturesForAddress - -Return the signatures of the transactions that closed or opened a compressed account with the given address. This is a paginated endpoint - -{% swagger src="https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getCompressionSignaturesForAddress.yaml" path="/" method="post" %} -[https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getCompressionSignaturesForAddress.yaml](https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getCompressionSignaturesForAddress.yaml) -{% endswagger %} diff --git a/compression-docs/developers/json-rpc-methods/getcompressionsignaturesforowner.md b/compression-docs/developers/json-rpc-methods/getcompressionsignaturesforowner.md deleted file mode 100644 index f8d839f..0000000 --- a/compression-docs/developers/json-rpc-methods/getcompressionsignaturesforowner.md +++ /dev/null @@ -1,7 +0,0 @@ -# getCompressionSignaturesForOwner - -Returns the signatures of the transactions that have modified an owner's compressed accounts. This is a paginated endpoint - -{% swagger src="https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getCompressionSignaturesForOwner.yaml" path="/" method="post" %} -[https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getCompressionSignaturesForOwner.yaml](https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getCompressionSignaturesForOwner.yaml) -{% endswagger %} diff --git a/compression-docs/developers/json-rpc-methods/getcompressionsignaturesfortokenowner.md b/compression-docs/developers/json-rpc-methods/getcompressionsignaturesfortokenowner.md deleted file mode 100644 index 501f824..0000000 --- a/compression-docs/developers/json-rpc-methods/getcompressionsignaturesfortokenowner.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -description: >- - Returns the signatures of the transactions that have modified an owner's - compressed token accounts. This is a paginated endpoint -coverY: 0 ---- - -# getCompressionSignaturesForTokenOwner - -{% swagger src="https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getCompressionSignaturesForTokenOwner.yaml" path="/" method="post" %} -[https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getCompressionSignaturesForTokenOwner.yaml](https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getCompressionSignaturesForTokenOwner.yaml) -{% endswagger %} diff --git a/compression-docs/developers/json-rpc-methods/getindexerhealth.md b/compression-docs/developers/json-rpc-methods/getindexerhealth.md deleted file mode 100644 index 88f9cdf..0000000 --- a/compression-docs/developers/json-rpc-methods/getindexerhealth.md +++ /dev/null @@ -1,7 +0,0 @@ -# getIndexerHealth - -Returns an error if the indexer is stale by more than a configurable number of blocks. Otherwise, it returns `ok` - -{% swagger src="https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getIndexerHealth.yaml" path="/" method="post" %} -[https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getIndexerHealth.yaml](https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getIndexerHealth.yaml) -{% endswagger %} diff --git a/compression-docs/developers/json-rpc-methods/getindexerslot.md b/compression-docs/developers/json-rpc-methods/getindexerslot.md deleted file mode 100644 index c4bab94..0000000 --- a/compression-docs/developers/json-rpc-methods/getindexerslot.md +++ /dev/null @@ -1,7 +0,0 @@ -# getIndexerSlot - -Returns the slot of the last block indexed by the indexer - -{% swagger src="https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getIndexerSlot.yaml" path="/" method="post" %} -[https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getIndexerSlot.yaml](https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getIndexerSlot.yaml) -{% endswagger %} diff --git a/compression-docs/developers/json-rpc-methods/getlatestcompressionsignatures.md b/compression-docs/developers/json-rpc-methods/getlatestcompressionsignatures.md deleted file mode 100644 index a638cf2..0000000 --- a/compression-docs/developers/json-rpc-methods/getlatestcompressionsignatures.md +++ /dev/null @@ -1,7 +0,0 @@ -# getLatestCompressionSignatures - -Returns the signatures of the latest transactions that used the compression program. This is a paginated endpoint - -{% swagger src="https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getLatestCompressionSignatures.yaml" path="/" method="post" %} -[https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getLatestCompressionSignatures.yaml](https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getLatestCompressionSignatures.yaml) -{% endswagger %} diff --git a/compression-docs/developers/json-rpc-methods/getlatestnonvotingsignatures.md b/compression-docs/developers/json-rpc-methods/getlatestnonvotingsignatures.md deleted file mode 100644 index 64dc102..0000000 --- a/compression-docs/developers/json-rpc-methods/getlatestnonvotingsignatures.md +++ /dev/null @@ -1,7 +0,0 @@ -# getLatestNonVotingSignatures - -Returns the signatures of the latest transactions that are not voting transactions - -{% swagger src="https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getLatestNonVotingSignatures.yaml" path="/" method="post" %} -[https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getLatestNonVotingSignatures.yaml](https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getLatestNonVotingSignatures.yaml) -{% endswagger %} diff --git a/compression-docs/developers/json-rpc-methods/getmultiplecompressedaccountproofs.md b/compression-docs/developers/json-rpc-methods/getmultiplecompressedaccountproofs.md deleted file mode 100644 index f295209..0000000 --- a/compression-docs/developers/json-rpc-methods/getmultiplecompressedaccountproofs.md +++ /dev/null @@ -1,7 +0,0 @@ -# getMultipleCompressedAccountProofs - -Returns multiple proofs used by the compression program to verify the accounts' validity - -{% swagger src="https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getMultipleCompressedAccountProofs.yaml" path="/" method="post" %} -[https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getMultipleCompressedAccountProofs.yaml](https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getMultipleCompressedAccountProofs.yaml) -{% endswagger %} diff --git a/compression-docs/developers/json-rpc-methods/getmultiplecompressedaccounts.md b/compression-docs/developers/json-rpc-methods/getmultiplecompressedaccounts.md deleted file mode 100644 index 1d6795b..0000000 --- a/compression-docs/developers/json-rpc-methods/getmultiplecompressedaccounts.md +++ /dev/null @@ -1,7 +0,0 @@ -# getMultipleCompressedAccounts - -Returns multiple compressed accounts with the given addresses or hashes - -{% swagger src="https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getMultipleCompressedAccounts.yaml" path="/" method="post" %} -[https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getMultipleCompressedAccounts.yaml](https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getMultipleCompressedAccounts.yaml) -{% endswagger %} diff --git a/compression-docs/developers/json-rpc-methods/getmultiplenewaddressproofs.md b/compression-docs/developers/json-rpc-methods/getmultiplenewaddressproofs.md deleted file mode 100644 index 73eb965..0000000 --- a/compression-docs/developers/json-rpc-methods/getmultiplenewaddressproofs.md +++ /dev/null @@ -1,9 +0,0 @@ -# getMultipleNewAddressProofs - -Returns proofs that the new addresses are not taken already and can be created - - - -{% swagger src="https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getMultipleNewAddressProofs.yaml" path="/" method="post" %} -[https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getMultipleNewAddressProofs.yaml](https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getMultipleNewAddressProofs.yaml) -{% endswagger %} diff --git a/compression-docs/developers/json-rpc-methods/gettransactionwithcompressioninfo.md b/compression-docs/developers/json-rpc-methods/gettransactionwithcompressioninfo.md deleted file mode 100644 index 86642c1..0000000 --- a/compression-docs/developers/json-rpc-methods/gettransactionwithcompressioninfo.md +++ /dev/null @@ -1,7 +0,0 @@ -# getTransactionWithCompressionInfo - -Returns the transaction data for the transaction with the given signature along with parsed compression info - -{% swagger src="https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getTransactionWithCompressionInfo.yaml" path="/" method="post" %} -[https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getTransactionWithCompressionInfo.yaml](https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getTransactionWithCompressionInfo.yaml) -{% endswagger %} diff --git a/compression-docs/developers/json-rpc-methods/getvalidityproof.md b/compression-docs/developers/json-rpc-methods/getvalidityproof.md deleted file mode 100644 index 5af6f43..0000000 --- a/compression-docs/developers/json-rpc-methods/getvalidityproof.md +++ /dev/null @@ -1,17 +0,0 @@ -# getValidityProof - -Returns a single ZK Proof used by the compression program to verify that the given accounts are valid and that the new addresses can be created - -{% hint style="info" %} -* Proof limits per request are: - * `hashes`: 1, 2, 3, 4, or 8 - * `newAddressesWithTrees` : 1, 2 -* The `newAddresses` param field is supported but deprecated. Please use `newAddressesWithTrees`instead.\ - -{% endhint %} - - - -{% openapi src="https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getValidityProof.yaml" path="/" method="post" %} -[https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getValidityProof.yaml](https://raw.githubusercontent.com/helius-labs/photon/main/src/openapi/specs/getValidityProof.yaml) -{% endopenapi %} diff --git a/compression-docs/developers/typescript-client.md b/compression-docs/developers/typescript-client.md deleted file mode 100644 index d638be7..0000000 --- a/compression-docs/developers/typescript-client.md +++ /dev/null @@ -1,187 +0,0 @@ -# TypeScript Client - -## Stateless.js API Reference Guide - -The [@lightprotocol/stateless.js library](https://www.npmjs.com/package/@lightprotocol/stateless.js) lets you build Javascript clients that interact with the ZK Compression primitive via the [ZK Compression JSON RPC API](json-rpc-methods/). - -## Installation - -
Package ManagerCommand
NPM
npm install --save \
-    @lightprotocol/stateless.js \
-    @lightprotocol/compressed-token \
-    @solana/web3.js \
-    @lightprotocol/zk-compression-cli
-
Yarn
yarn add \
-    @lightprotocol/stateless.js \
-    @solana/web3.js \
-    @lightprotocol/zk-compression-cli
-
- -## Basics - -### Rpc - -[Source Documentation](https://github.com/Lightprotocol/light-protocol/blob/main/js/stateless.js/src/rpc.ts) - -The `Rpc` connection is used to interact with the [ZK Compression JSON RPC](json-rpc-methods/). It's a thin wrapper extending [Solana's web3.js `Connection` class](https://solana-labs.github.io/solana-web3.js/classes/Connection.html) with compression-related endpoints, such as `getCompressedAccount`, `getCompressedTokenBalancesByOwner`, and more. - -**Example Usage with Devnet** - -```typescript -const stateless = require("@lightprotocol/stateless.js"); - - -/// Helius exposes Solana and compression RPC endpoints through a single URL -const RPC_ENDPOINT = "https://devnet.helius-rpc.com?api-key="; -const COMPRESSION_RPC_ENDPOINT = RPC_ENDPOINT; -const PROVER_ENDPOINT = RPC_ENDPOINT -const connection: Rpc = createRpc(RPC_ENDPOINT, COMPRESSION_RPC_ENDPOINT, PROVER_ENDPOINT) - -async function main() { - let slot = await connection.getSlot(); - console.log(slot); - - let health = await connection.getIndexerHealth(slot); - console.log(health); - // "Ok" -} - -main(); -``` - -Visit the [JSON RPC Methods](json-rpc-methods/) section for the full list of compression endpoints supported in `Rpc` . - -## Quickstart - -### Starting the `test-validator` for Local Development - -```sh -light test-validator -``` - -The command above will start a single-node Solana cluster, an RPC node, and a prover node at ports 8899, 8784, and 3001. - -### Creating and Sending Transactions - -#### Creating, Minting, and Transferring a Compressed Token - -{% hint style="info" %} -This example uses the **compressed token program**, which is built using ZK Compression and offers an SPL-compatible token layout. -{% endhint %} - -```typescript -import { - LightSystemProgram, - Rpc, - confirmTx, - createRpc, -} from "@lightprotocol/stateless.js"; -import { createMint, mintTo, transfer } from "@lightprotocol/compressed-token"; -import { Keypair } from "@solana/web3.js"; - -const payer = Keypair.generate(); -const tokenRecipient = Keypair.generate(); - -/// Localnet -const connection: Rpc = createRpc(); - -const main = async () => { - /// Airdrop lamports to pay fees - await confirmTx( - connection, - await connection.requestAirdrop(payer.publicKey, 10e9) - ); - - await confirmTx( - connection, - await connection.requestAirdrop(tokenRecipient.publicKey, 1e6) - ); - - /// Create a compressed token mint - const { mint, transactionSignature } = await createMint( - connection, - payer, - payer.publicKey, - 9 // Number of decimals - ); - - console.log(`create-mint success! txId: ${transactionSignature}`); - - /// Mint compressed tokens to the payer's account - const mintToTxId = await mintTo( - connection, - payer, - mint, - payer.publicKey, // Destination - payer, - 1e9 // Amount - ); - - console.log(`Minted 1e9 tokens to ${payer.publicKey} was a success!`); - console.log(`txId: ${mintToTxId}`); - - /// Transfer compressed tokens - const transferTxId = await transfer( - connection, - payer, - mint, - 7e8, // Amount - payer, // Owner - tokenRecipient.publicKey // To address - ); - - console.log(`Transfer of 7e8 ${mint} to ${tokenRecipient.publicKey} was a success!`); - console.log(`txId: ${transferTxId}`); -}; - -main(); -``` - -### Creating Lookup Tables - -{% hint style="info" %} -For public networks, we provide [shared lookup tables](addresses-and-urls.md#lookup-tables) for Light's common program IDs and accounts -{% endhint %} - -```typescript -import { Rpc, confirmTx, createRpc } from "@lightprotocol/stateless.js"; -import { createTokenProgramLookupTable } from "@lightprotocol/compressed-token"; -import { Keypair, PublicKey} from "@solana/web3.js"; -import { RPC_ENDPOINT } from "./constants"; -const payer = Keypair.generate(); -const authority = payer; -const additionalTokenMints : PublicKey[] = []; -const additionalAccounts : PublicKey[] = []; - -// Localnet -const connection: Rpc = createRpc(); - -const main = async () => { - /// airdrop lamports to pay gas and rent - await confirmTx( - connection, - await connection.requestAirdrop(payer.publicKey, 1e7) - ); - - /// Create LUT - const { address } = await createTokenProgramLookupTable( - connection, - payer, - authority, - additionalTokenMints, - additionalAccounts - ); - - console.log("Created lookup table:", address.toBase58()); -}; - -main(); -``` - -### Examples - -To get started building with examples, check out these GitHub repositories: - -* [Web Example Client](https://github.com/Lightprotocol/example-web-client) -* [Node Example Client](https://github.com/Lightprotocol/example-nodejs-client) -* [Token Escrow Program Example](https://github.com/Lightprotocol/light-protocol/tree/light-v0.3.0/examples/token-escrow) diff --git a/compression-docs/developers/using-token-2022.md b/compression-docs/developers/using-token-2022.md deleted file mode 100644 index 46ee8e7..0000000 --- a/compression-docs/developers/using-token-2022.md +++ /dev/null @@ -1,189 +0,0 @@ -# Using Token-2022 - -You can compress token-2022 accounts of mints with the following mint-extensions: - -* MetadataPointer -* TokenMetadata -* InterestBearingConfig -* GroupPointer -* GroupMemberPointer -* TokenGroup -* TokenGroupMember - -All other extensions are not yet supported. - -{% hint style="info" %} -If you require support for other mint-extensions, [let us know](https://t.me/swen_light)! -{% endhint %} - -## Minting, compressing, and transferring tokens with Token-2022 Metadata - -{% hint style="info" %} -You need the following SDK versions: - -* `@lightprotocol/stateless.js` ≥ 0.21.0 -* `@lightprotocol/compressed-token` ≥ 0.21.0 -* `@solana/web3.js` ≥ 1.95.3 -{% endhint %} - -```typescript -import { confirmTx, createRpc } from "@lightprotocol/stateless.js"; -import { - compress, - createTokenPool, - transfer, -} from "@lightprotocol/compressed-token"; -import { - getOrCreateAssociatedTokenAccount, - mintTo as mintToSpl, - TOKEN_2022_PROGRAM_ID, - createInitializeMetadataPointerInstruction, - createInitializeMintInstruction, - ExtensionType, - getMintLen, - LENGTH_SIZE, - TYPE_SIZE, -} from "@solana/spl-token"; -import { - Keypair, - sendAndConfirmTransaction, - SystemProgram, - Transaction, -} from "@solana/web3.js"; -import { - createInitializeInstruction, - pack, - TokenMetadata, -} from "@solana/spl-token-metadata"; -import dotenv from "dotenv"; -import bs58 from "bs58"; -dotenv.config(); - -// set these values in your .env file -const payer = Keypair.fromSecretKey(bs58.decode(process.env.PAYER_KEYPAIR!)); -const RPC_ENDPOINT = process.env.RPC_ENDPOINT!; -const connection = createRpc(RPC_ENDPOINT); - -(async () => { - const mint = Keypair.generate(); - const decimals = 9; - - const metadata: TokenMetadata = { - mint: mint.publicKey, - name: "name", - symbol: "symbol", - uri: "uri", - additionalMetadata: [["key", "value"]], - }; - - const mintLen = getMintLen([ExtensionType.MetadataPointer]); - - const metadataLen = TYPE_SIZE + LENGTH_SIZE + pack(metadata).length; - - // airdrop to pay gas - await confirmTx( - connection, - await connection.requestAirdrop(payer.publicKey, 1e7) - ); - - const mintLamports = await connection.getMinimumBalanceForRentExemption( - mintLen + metadataLen - ); - const mintTransaction = new Transaction().add( - SystemProgram.createAccount({ - fromPubkey: payer.publicKey, - newAccountPubkey: mint.publicKey, - space: mintLen, - lamports: mintLamports, - programId: TOKEN_2022_PROGRAM_ID, - }), - createInitializeMetadataPointerInstruction( - mint.publicKey, - payer.publicKey, - mint.publicKey, - TOKEN_2022_PROGRAM_ID - ), - createInitializeMintInstruction( - mint.publicKey, - decimals, - payer.publicKey, - null, - TOKEN_2022_PROGRAM_ID - ), - createInitializeInstruction({ - programId: TOKEN_2022_PROGRAM_ID, - mint: mint.publicKey, - metadata: mint.publicKey, - name: metadata.name, - symbol: metadata.symbol, - uri: metadata.uri, - mintAuthority: payer.publicKey, - updateAuthority: payer.publicKey, - }) - ); - const txId = await sendAndConfirmTransaction(connection, mintTransaction, [ - payer, - mint, - ]); - - console.log(`txId: ${txId}`); - - // register the mint with the Compressed-Token program - const txId2 = await createTokenPool( - connection, - payer, - mint.publicKey, - undefined, - TOKEN_2022_PROGRAM_ID - ); - console.log(`register-mint success! txId: ${txId2}`); - - const ata = await getOrCreateAssociatedTokenAccount( - connection, - payer, - mint.publicKey, - payer.publicKey, - undefined, - undefined, - undefined, - TOKEN_2022_PROGRAM_ID - ); - - console.log(`ATA: ${ata.address}`); - // Mint SPL - const mintTxId = await mintToSpl( - connection, - payer, - mint.publicKey, - ata.address, - payer.publicKey, - 1e5, - undefined, - undefined, - TOKEN_2022_PROGRAM_ID - ); - console.log(`mint-spl success! txId: ${mintTxId}`); - - const compressedTokenTxId = await compress( - connection, - payer, - mint.publicKey, - 1e5, - payer, - ata.address, - payer.publicKey - ); - console.log(`compressed-token success! txId: ${compressedTokenTxId}`); - - const transferCompressedTxId = await transfer( - connection, - payer, - mint.publicKey, - 1e5, - payer, - payer.publicKey // self-transfer - ); - console.log(`transfer-compressed success! txId: ${transferCompressedTxId}`); -})(); - -``` diff --git a/compression-docs/get-started/intro-to-development.md b/compression-docs/get-started/intro-to-development.md deleted file mode 100644 index 4d983cc..0000000 --- a/compression-docs/get-started/intro-to-development.md +++ /dev/null @@ -1,236 +0,0 @@ ---- -description: >- - Welcome! This guide has everything you need to know to start developing with - ZK Compression on Solana. ---- - -# Intro to Development - -{% hint style="info" %} -For the sake of brevity, this guide assumes you are familiar with the basics of Solana. If you aren't, we recommend reading the following: - -* [Solana documentation](https://solana.com/docs/intro/dev) -* [The Solana Programming Model: An Introduction to Developing on Solana](https://www.helius.dev/blog/the-solana-programming-model-an-introduction-to-developing-on-solana) -{% endhint %} - -## What You'll Need to Get Started - -Development with ZK Compression on Solana consists of two main parts: - -* [Client development](intro-to-development.md#client-side-development) -* [On-chain program development](intro-to-development.md#on-chain-program-development) - -The [ZK Compression RPC API](../developers/json-rpc-methods/) is the glue between clients and on-chain programs. It extends Solana's [JSON RPC API](https://solana.com/docs/rpc) with additional endpoints for interacting with ZK compressed accounts. You can view the complete list of supported endpoints [here](../developers/json-rpc-methods/). - -### A Quick Intro to Client-side Development - -The following TypeScript and Rust SDKs are used to interact with ZK Compression: - -
LanguageSDKDescription
TypeScript@lightprotocol/stateless.jsSDK to interact with compression programs via the ZK Compression RPC API
TypeScript@lightprotocol/compressed-tokenSDK to interact with the compressed token program
Rustlight-sdkRust client
- -#### RPC Connection - -You need an RPC connection to interact with the network. You can either work with an RPC infrastructure provider that supports ZK Compression or run your own RPC Node. - -{% hint style="info" %} -[Helius Labs](https://github.com/helius-labs) supports ZK Compression and maintains its canonical RPC and [Photon indexer implementation](https://github.com/helius-labs/photon). - -Our local dev tooling supports Photon out of the box via the `light test-validator` command. To learn how to run a standalone Photon RPC node, visit the [Run a Node](../node-operators/run-a-node.md#photon-indexer-node) section. -{% endhint %} - -### Quickstart - -{% hint style="info" %} -The code samples work! You can copy & paste them into your IDE and run! -{% endhint %} - -#### Installation (Node.js, Web) - -{% tabs %} -{% tab title="npm" %} -```bash -npm install -g @lightprotocol/zk-compression-cli && \ -npm install --save \ - @lightprotocol/stateless.js \ - @lightprotocol/compressed-token \ - @solana/web3.js -``` -{% endtab %} - -{% tab title="yarn" %} -```bash -yarn global add @lightprotocol/zk-compression-cli && \ -yarn add \ - @lightprotocol/stateless.js \ - @lightprotocol/compressed-token \ - @solana/web3.js -``` -{% endtab %} - -{% tab title="pnpm" %} -```bash -pnpm add -g @lightprotocol/zk-compression-cli && \ -pnpm add \ - @lightprotocol/stateless.js \ - @lightprotocol/compressed-token \ - @solana/web3.js -``` -{% endtab %} -{% endtabs %} - -#### Creating an RPC Connection - -
import {
-  Rpc,
-  createRpc,
-} from "@lightprotocol/stateless.js";
-
-// Helius exposes Solana and Photon RPC endpoints through a single URL
-const RPC_ENDPOINT = "https://devnet.helius-rpc.com?api-key=<api_key>";
-const PHOTON_ENDPOINT = RPC_ENDPOINT;
-const PROVER_ENDPOINT = RPC_ENDPOINT;
-const connection: Rpc = createRpc(RPC_ENDPOINT, PHOTON_ENDPOINT, PROVER_ENDPOINT)
-
-console.log("connection", connection);
-
- -#### Using Localnet - -```sh -# Start a local test validator -light test-validator -``` - -```typescript -const stateless = require("@lightprotocol/stateless.js"); - -const connection = stateless.createRpc(); - -async function main() { - let slot = await connection.getSlot(); - console.log(slot); - - let health = await connection.getIndexerHealth(slot); - console.log(health); - // "Ok" -} - -main(); -``` - -#### Minting and Transferring Compressed Tokens - -{% hint style="info" %} -This example uses the **compressed token program**, which is built using ZK Compression and offers an SPL-compatible token layout. -{% endhint %} - -```typescript -import { - LightSystemProgram, - Rpc, - confirmTx, - createRpc, -} from "@lightprotocol/stateless.js"; -import { createMint, mintTo, transfer } from "@lightprotocol/compressed-token"; -import { Keypair } from "@solana/web3.js"; - -const payer = Keypair.generate(); -const tokenRecipient = Keypair.generate(); - -/// Helius exposes Solana and compression RPC endpoints through a single URL -const RPC_ENDPOINT = "https://devnet.helius-rpc.com?api-key="; -const COMPRESSION_ENDPOINT = RPC_ENDPOINT; -const PROVER_ENDPOINT = RPC_ENDPOINT; -const connection: Rpc = createRpc(RPC_ENDPOINT, COMPRESSION_ENDPOINT, PROVER_ENDPOINT) - -const main = async () => { - /// Airdrop lamports to pay fees - await confirmTx( - connection, - await connection.requestAirdrop(payer.publicKey, 10e9) - ); - - await confirmTx( - connection, - await connection.requestAirdrop(tokenRecipient.publicKey, 1e6) - ); - - /// Create compressed token mint - const { mint, transactionSignature } = await createMint( - connection, - payer, - payer.publicKey, - 9 // Number of decimals - ); - - console.log(`create-mint success! txId: ${transactionSignature}`); - - /// Mint compressed tokens to the payer's account - const mintToTxId = await mintTo( - connection, - payer, - mint, - payer.publicKey, // Destination - payer, - 1e9 // Amount - ); - - console.log(`Minted 1e9 tokens to ${payer.publicKey} was a success!`); - console.log(`txId: ${mintToTxId}`); - - /// Transfer compressed tokens from payer to tokenRecipient's pubkey - const transferTxId = await transfer( - connection, - payer, - mint, - 7e8, // Amount - payer, // Owner - tokenRecipient.publicKey // To address - ); - - console.log(`Transfer of 7e8 ${mint} to ${tokenRecipient.publicKey} was a success!`); - console.log(`txId: ${transferTxId}`); -}; - -main(); -``` - -### On-chain Program Development - -{% hint style="info" %} -The ZK Compression primitive is the core of [the Light protocol](https://github.com/Lightprotocol). To leverage ZK Compression, your custom program invokes the _Light system program_ via Cross-Program Invocation (CPI). -{% endhint %} - -You can write custom programs using ZK compression in Anchor or native Rust. - -First, ensure your development environment has installed Rust, the Solana CLI, and Anchor. If you haven't installed them, refer to this [setup guide](https://solana.com/developers/guides/getstarted/setup-local-development). - -We provide tooling for testing your on-chain program on a local Solana cluster. The `light test-validator` command, available with the [ZK Compression CLI](https://github.com/Lightprotocol/light-protocol/blob/main/cli/README.md), automatically initializes a local Solana cluster with the compression programs, all necessary system accounts, and syscalls activated. By default, it also starts a local Photon RPC instance and Prover node. - -
ProgramDescription
light-system-program

The system program. It enforces the compressed account layout with ownership and sum checks and verifies the validity of your input state

It is also invoked to create/write to compressed accounts and PDAs

light-compressed-tokenA compressed token implementation built on top of ZK Compression. It enforces a SPL-compatible token layout and allows for arbitrary compression/decompression between this and the SPL standard
account-compressionImplements state and address trees. It is used by the Light System program
- -## Build by Example - -While you get started building with ZK Compression, use these GitHub resources available to help accelerate your journey: - -* [Web Example Client](https://github.com/Lightprotocol/example-web-client) -* [Node Example Client](https://github.com/Lightprotocol/example-nodejs-client) -* [Token Escrow Anchor Program](https://github.com/Lightprotocol/light-protocol/tree/light-v0.3.0/examples/token-escrow) - -## Developer Environments - -ZK Compression is available on Localnet using `light test-validator`, Devnet, and Mainnet-Beta. - -## Getting Support - -For the best support, head to the: - -* [Solana StackExchange](https://solana.stackexchange.com/) for Solana-specific questions -* [Light Developer Discord](https://discord.gg/CYvjBgzRFP) for program and client-related questions -* [Helius Developer Discord](https://discord.gg/Uzzf6a7zKr) for RPC-related questions - -Remember to include as much detail as possible in your question, and please use text (not screenshots) to show error messages so other people with the same problem can find your question! - -## Next Steps - -You're now ready to start building with ZK Compression! Head to the [Client Quickstart](../developers/typescript-client.md) section, or [build ](intro-to-development.md#build-by-example)[a program](intro-to-development.md#build-by-example)! diff --git a/compression-docs/learn/core-concepts/README.md b/compression-docs/learn/core-concepts/README.md deleted file mode 100644 index aaebb87..0000000 --- a/compression-docs/learn/core-concepts/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# Core Concepts - -ZK Compression is a new primitive on Solana that drastically reduces on-chain state costs while maintaining security, composability, and performance. ZK Compression allows developers to efficiently scale their applications to millions of users with the help of zero-knowledge proofs. - -In the following sections, we'll dive into the core concepts that make ZK Compression possible: - -* **Compressed Account Model**: Understand how compressed accounts differ from regular Solana accounts (not much!) and how they enhance efficiency. -* **State Trees**: Learn about the Merkle tree structure used to store compressed accounts and how it minimizes on-chain storage. -* **Validity Proofs**: Explore how the protocol uses zero-knowledge proofs to verify data validity while keeping proof sizes small. -* **Lifecycle of a Transaction**: Follow the journey of a ZK-compressed transaction from creation to execution. -* **Limitations and Considerations**: Discover the trade-offs and scenarios where ZK Compression may or may not be the best solution. diff --git a/compression-docs/learn/core-concepts/compressed-account-model.md b/compression-docs/learn/core-concepts/compressed-account-model.md deleted file mode 100644 index 4597ba0..0000000 --- a/compression-docs/learn/core-concepts/compressed-account-model.md +++ /dev/null @@ -1,48 +0,0 @@ -# Compressed Account Model - -{% hint style="info" %} -This guide assumes that you're familiar with [Solana's account model](https://solana.com/docs/core/accounts). -{% endhint %} - -## Regular versus Compressed Accounts - -ZK compressed state is stored in compressed accounts. Compressed accounts are similar to regular Solana accounts but with four main differences: - -* Each compressed account can be identified by its hash -* Each write to a compressed account changes its hash -* An `address` can optionally be set as a permanent unique ID of the compressed account -* All compressed accounts are stored in [sparse state trees](state-trees.md). Only the tree's state root (i.e., a small fingerprint of all compressed accounts) is stored in the on-chain account space - -These differences allow the protocol to store states as calldata in the less expensive Solana ledger space instead of costly on-chain account space - -To understand the similarities and differences between Solana's regular account model and compressed accounts, let's first look at compressed accounts with Program-Derived Addresses (PDAs) - -> If you don't know what PDAs are, read [this explainer](https://solana.com/docs/core/pda) first - -## Compressed PDA Accounts - -Like regular accounts, each compressed PDA account can be identified by its unique persistent address, represented as 32 bytes in the format of a `PublicKey`. Like PDAs, compressed account addresses don't belong to a private key; rather, they're derived from the program that owns them - -

Compressed PDA Accounts

- -The compressed PDA account layout is similar to Solana's regular PDA account layout — it has the **Data**, **Lamports**, **Owner**, and **Address** fields. The **Data** field stores the program state. Notice the enshrined **AccountData** structure: **Discriminator**, **Data**, **DataHash**: - -

Compressed PDA Account with AccountData

- -The [Anchor](https://www.anchor-lang.com/) framework reserves the first 8 bytes of a regular account's data field for the discriminator. This helps programs distinguish between different program-owned accounts. The default compressed account layout is opinionated in this regard and enforces a discriminator in the Data field. You can ignore the **DataHash** field for now; we cover its importance for ZK Compression later. - -### Address & Hash - -The `address` field is optional for compressed accounts because ensuring that the address of a new account is unique incurs additional computational overhead, and not all use cases need the uniqueness property of addresses - -Instead, each compressed account can be identified by its hash, regardless of whether it has an address - -{% hint style="info" %} -* Use the address field wherever the state must be unique (such as for NFTs or certain PDAs) -* You don't need the address for any fungible state (e.g., fungible tokens) -{% endhint %} - -By definition, whenever the data of a compressed account changes, its hash changes. This impacts how developers interact with fungible state: - -* Check out the [examples](../../get-started/intro-to-development.md#build-by-example) section to see what using hashes instead of addresses looks like in practice -* Visit the [State Trees](state-trees.md) section to understand why using the account's hash as its ID makes sense for the compression protocol diff --git a/compression-docs/learn/core-concepts/lifecycle-of-a-transaction.md b/compression-docs/learn/core-concepts/lifecycle-of-a-transaction.md deleted file mode 100644 index 52cff70..0000000 --- a/compression-docs/learn/core-concepts/lifecycle-of-a-transaction.md +++ /dev/null @@ -1,35 +0,0 @@ -# Lifecycle of a Transaction - -ZK Compression transactions are fully compatible with Solana's Transaction and Versioned Transaction formats. There are three key nuances in building transactions with compressed accounts as compared to regular accounts: - -* Instructions must specify the list of all compressed accounts being read or written to. To read or write to a compressed account, the instruction must send the current account state on-chain and prove its validity -* Each unique state tree that gets read or written to (via any compressed account) needs to be specified as per Solana's regular on-chain [account access lists](https://solana.com/docs/core/transactions#array-of-account-addresses) -* To read any compressed account state on-chain, the client must send a validity proof alongside the instruction data to the chain. Depending on your program logic, the validity proof can prove A) the validity of all specified read accounts and B) the non-existence of a specified PDA within the compressed address space, e.g., for creating a new compressed PDA account - -We can express a transaction more generally as: - -`(state, validityProof) -> state transition -> state'` - -Here's what this looks like when updating a single compressed PDA account: - -

Simplified: Read and Write compressed accounts

- -In this example, we assume that the client previously created said compressed account and thereafter fetched its compressed account info from an [RPC node](../../node-operators/run-a-node.md#photon-indexer-node) - -The custom Solana program executing the state transition _Data_ -> _Data'_ should require its client to pack the instructions efficiently. In the above scenario, the total data that's sent to the chain is: `address (same)`, `owner program (same)`, `data`, `data'-data`, `validity proof` - -The compressed account after its update looks like this: - -

Full representation of a compressed account with PDA

- -## On-chain Protocol Execution - -To write compressed state, a custom caller program must invoke the Light System Program via CPI. The system program then does the following: - -1. Runs relevant checks ([sum check](https://github.com/Lightprotocol/light-protocol/blob/v.1.0.0/programs/system/src/invoke/verify_state_proof.rs#L204-L210), etc.) -2. [Verifies the validity proof](https://github.com/Lightprotocol/light-protocol/blob/v.1.0.0/programs/system/src/invoke/processor.rs#L209-L214) -3. [Nullifies](https://github.com/Lightprotocol/light-protocol/blob/v.1.0.0/programs/system/src/invoke/processor.rs#L209-L214) the "old" leaf of the compressed account that is being written to -4. [Appends](https://github.com/Lightprotocol/light-protocol/blob/v.1.0.0/programs/system/src/invoke/processor.rs#L245-L254) the new compressed account hash to the state tree and advances the tree's state root -5. [Emits](https://github.com/Lightprotocol/light-protocol/blob/v.1.0.0/programs/system/src/invoke/processor.rs#L272-L279) the new compressed account state onto the Solana ledger - -An[ RPC node](../../node-operators/run-a-node.md#photon-indexer-node) then parses the transaction and compressed state and provides the read state to clients via the [ZK Compression RPC API](../../developers/json-rpc-methods/) diff --git a/compression-docs/learn/core-concepts/limitations.md b/compression-docs/learn/core-concepts/limitations.md deleted file mode 100644 index 83a943f..0000000 --- a/compression-docs/learn/core-concepts/limitations.md +++ /dev/null @@ -1,62 +0,0 @@ -# Limitations - -Before using ZK Compression to scale your application state, consider the following limitations of compressed accounts: - -* [Larger Transaction Size](limitations.md#larger-transaction-size) -* [High Compute Unit Usage](limitations.md#high-compute-unit-usage) -* [Per-Transaction State Cost](limitations.md#per-transaction-state-cost) - -## General Recommendation - -{% hint style="info" %} -Consider which accounts in your application benefit from ZK Compression and which don't. You can use both types for different parts of your application! -{% endhint %} - -It may be preferred for an account _not_ to be permanently compressed if: - -* The account gets updated very frequently within a single block (e.g., shared liquidity pools in a DeFi protocol). -* You expect the lifetime number of writes to the same account to be very large (>>1000x). -* The account stores large amounts of data, and you need to access a large part of it (>1kb) inside one on-chain transaction. - -## **Larger Transaction Size** - -Solana's transaction size limit is 1232 Bytes. Transactions exceeding this limit will fail. ZK Compression increases your transaction size in two ways: - -* 128 bytes must be reserved for the validity proof, which is a constant size per transaction, assuming the transaction reads from at least one compressed account. -* You must send the account data you want to read/write on-chain. - -## **High Compute Unit Usage** - -{% hint style="info" %} -System CU usage: - -* \~100,000 CU for validity proof verification, which is a constant size per transaction, assuming the transaction reads from at least one compressed account -* \~100,000 CU system use (state tree [Poseidon](https://eprint.iacr.org/2019/458.pdf) hashing et al.) -* \~6,000 CU per compressed account read/write - -**Example**: a typical compressed token transfer uses around 292,000 CU. -{% endhint %} - -Higher CU usage can: - -* **Lead to usage limits:** The total CU limit per transaction is 1,400,000 CU, and the per-block write lock limit per State tree is 12,000,000 CU. -* **Require your users to increase their** [**priority fee**](https://solana.com/developers/guides/advanced/how-to-use-priority-fees) **during congestion:** Whenever Solana's global per-block CU limit (48,000,000 CU) is reached, validator clients may prioritize transactions with higher per-CU priority fees. - -## State Cost Per Transaction - -Each write operation incurs a small additional network cost. If you expect a single compressed account to amass a large amount of state updates, the lifetime cost of the compressed account may be higher than its uncompressed equivalent, which currently has a fixed per-byte rent cost at creation. - -{% hint style="info" %} -Whenever a [transaction](lifecycle-of-a-transaction.md) writes to a compressed account, it nullifies the previous compressed account state and appends the new compressed account as a leaf to the state tree. Both of these actions incur costs that add to Solana's base fee. -{% endhint %} - -
TypeLamportsNotes
Solana base fee5000 per signatureCompensates validators for processing transactions
Write new compressed account state ~300 per leaf (default)Depends on tree depth:
\left( 2^{\text{tree\_depth}} \times \text{tree\_account\_rent\_cost} \times \text{rollover\_threshold} \right)
~300 for the default depth of 26
Nullify old compressed account state5000 per transactionReimburses the cost of running a Forester transaction. The current default Forester node implementation can be found here
Create addresses5000 per transactionSame as nullify
- -## Next Steps - -Now you're familiar with the core concepts of ZK Compression, you're ready to take the next step! Dive into [building a program](https://www.zkcompression.com/introduction/intro-to-development#on-chain-program-development) or [application](https://www.zkcompression.com/introduction/intro-to-development#client-side-development) with ZK Compression, or learn how to [set up and run your own node](../../node-operators/run-a-node.md).\ -\ -For those interested in learning more about the fundamentals of ZK and its applications on Solana, we recommend reading the following: - -* [Zero-Knowledge Proofs: An Introduction to the Fundamentals](https://www.helius.dev/blog/zero-knowledge-proofs-an-introduction-to-the-fundamentals) -* [Zero-Knowledge Proofs: Its Applications on Solana](https://www.helius.dev/blog/zero-knowledge-proofs-its-applications-on-solana) diff --git a/compression-docs/learn/core-concepts/state-trees.md b/compression-docs/learn/core-concepts/state-trees.md deleted file mode 100644 index 6b2f11a..0000000 --- a/compression-docs/learn/core-concepts/state-trees.md +++ /dev/null @@ -1,18 +0,0 @@ -# State Trees - -The protocol stores compressed state in multiple state trees - -{% hint style="info" %} -A state tree is a binary [Merkle tree](https://brilliant.org/wiki/merkle-tree/) that organizes data into a tree structure where each parent node is the hash of its two children nodes. This leads to a single unique root hash that allows for efficient cryptographic verification of the integrity of all the leaves in the tree. -{% endhint %} - -

A small binary Merkle tree (depth 2)

- -The hash of each [compressed account](compressed-account-model.md) is stored as a leaf in a state tree: - -

Each compressed account hash is a leaf in the state tree

- -Note that each compressed account hash includes the public key of the state tree's respective on-chain account (i.e., `state tree hash`) and the compressed account's position in the tree (i.e., `leafIndex`). This ensures that each account hash is globally unique. - -Each state tree has a single on-chain state tree account that stores only the tree's final root hash and other metadata. Storing the final tree root hash on-chain allows the protocol to efficiently verify the validity of any leaf (compressed account) in the tree. The raw state can thus be stored as calldata in the much cheaper Solana ledger space while preserving Solana's security guarantees. - diff --git a/compression-docs/learn/core-concepts/validity-proofs.md b/compression-docs/learn/core-concepts/validity-proofs.md deleted file mode 100644 index b737a3c..0000000 --- a/compression-docs/learn/core-concepts/validity-proofs.md +++ /dev/null @@ -1,7 +0,0 @@ -# Validity Proofs - -Validity proofs are succinct zero-knowledge proofs (ZKPs) that can prove the existence of compressed accounts as leaves within state trees while maintaining a constant 128-byte size. These proofs are generated off-chain and verified on-chain. ZK Compression uses [Groth16](https://docs.rs/groth16-solana/latest/groth16_solana/), a well-known [pairing-based](https://en.wikipedia.org/wiki/Pairing-based_cryptography) [zk-SNARK](https://www.helius.dev/blog/zero-knowledge-proofs-its-applications-on-solana#-zk-snarks-and-circuits), for its proof system. - -

A Merkle proof path (purple nodes) consists of all sibling node hashes required to calculate the final root node.

- -The protocol leverages ZKP generation and verification under the hood, so you don't have to learn about ZK directly to use ZK Compression. diff --git a/compression-docs/learn/in-a-nutshell.md b/compression-docs/learn/in-a-nutshell.md deleted file mode 100644 index 0ea56d3..0000000 --- a/compression-docs/learn/in-a-nutshell.md +++ /dev/null @@ -1,13 +0,0 @@ -# In a Nutshell - -## High-level System Overview - -1. **State is stored as call data in** [**Solana's ledger**](https://www.helius.dev/blog/all-you-need-to-know-about-compression-on-solana#state-vs-ledger)**,** resulting in very low rent cost -2. **Transactions specify the state they access** (read/write) and include it in the transaction payload -3. **State Validation:** - 1. Solana Programs [invoke](https://solana.com/docs/core/cpi) the [Light Protocol System Program](../developers/addresses-and-urls.md#program-ids-and-accounts-from-27th-aug-2024-onward) to update compressed state - 1. **The protocol** [**validates**](core-concepts/validity-proofs.md) **the state** (validity of existing state, sum checks, ownership checks) - 2. **The protocol enforces a schema:** Classic Accounts → Compressed Accounts. [Compressed accounts](core-concepts/compressed-account-model.md) have a layout similar to classic accounts -4. **State Updates:** At the end of an instruction, the new state is recorded as a log on the Solana ledger -5. [**Photon RPC Nodes**](https://www.zkcompression.com/node-operators/run-a-node#photon-rpc-node)**:** These nodes index the state changes, making the compressed account state available to clients via the [ZK Compression RPC API](https://www.zkcompression.com/developers/json-rpc-methods) -6. **Forester Nodes (Keeper Nodes)**: Interact with the [Account Compression Program](../developers/addresses-and-urls.md#program-ids-and-accounts-from-27th-aug-2024-onward) to empty queues and rollover state trees. diff --git a/compression-docs/node-operators/run-a-node.md b/compression-docs/node-operators/run-a-node.md deleted file mode 100644 index b296628..0000000 --- a/compression-docs/node-operators/run-a-node.md +++ /dev/null @@ -1,45 +0,0 @@ -# Run a Node - -## Running a Node for Local Development - -For local development, the [ZK Compression CLI](https://github.com/Lightprotocol/light-protocol/blob/main/cli/) `test-validator` command starts a single-node Solana cluster with all relevant nodes (Photon RPC and Prover), system programs, accounts, and runtime features: - -```sh -light test-validator -``` - -To connect to public networks (i.e., Devnet, Mainnet-Beta), you can either work with an RPC infrastructure provider that supports ZK Compression, such as [Helius Labs](https://helius.xyz/), or run your own nodes: - -{% hint style="info" %} -There are three different types of nodes: - -* [Photon RPC nodes](run-a-node.md#photon-rpc-node) -* [Prover nodes](run-a-node.md#prover-node) -* [Light forester nodes](run-a-node.md#forester-node) - -_Becoming an operator for any node type is permissionless_ -{% endhint %} - -## Photon RPC Node - -RPC nodes index the Light Protocol programs, enabling clients to read and build transactions interacting with compressed state. - -The canonical ZK Compression indexer is named Photon. It can be run locally and requires minimal setup, which must be pointed to an existing Solana RPC. See the Github [repo](https://github.com/helius-labs/photon) for more info: - -{% embed url="https://github.com/helius-labs/photon" %} - -## Prover Node - -Provers generate validity proofs for state inclusion on behalf of app developers - -**Prover nodes** can be operated either stand-alone or with an RPC node: in its default configuration, the Photon RPC node implementation by [Helius Labs](https://github.com/helius-labs/photon) bundles a Prover node. The [ZK Compression RPC API ](https://docs.lightprotocol.com/developers/json-rpc-methods)specification supports proof generation via the `getValidityProof` endpoint, making it easy to serve proofs using regular RPC methods via the same port. - -Please refer to the Github repo for more info: - -{% embed url="https://github.com/Lightprotocol/light-protocol/tree/main/light-prover" %} - -## Light Forester Node - -Developers may choose to have their program-owned state trees serviced by a network of Light Forester nodes. These nodes manage the creation, rollover, and updating of shared and program-owned state trees. - -{% embed url="https://github.com/Lightprotocol/light-protocol/tree/main/forester" %} diff --git a/compression-docs/resources/changelog/0.3.0.md b/compression-docs/resources/changelog/0.3.0.md deleted file mode 100644 index d06d308..0000000 --- a/compression-docs/resources/changelog/0.3.0.md +++ /dev/null @@ -1,31 +0,0 @@ -# 0.3.0 - -The first pre-release is here! - -{% hint style="info" %} -_Note: It’s an alpha release, so bugs & breaking changes can occur. If you have questions, bugs, or feedback, check out the_ [_Helius_](https://discord.gg/Uzzf6a7zKr) _and_ [_Light_](https://discord.gg/CYvjBgzRFP) _Developer Discord for help, or message us directly via_ [_Telegram_](https://t.me/swen\_light) -{% endhint %} - -**You can find a list of all crates here:** - -{% embed url="https://github.com/Lightprotocol/light-protocol/releases/tag/light-v0.3.0" %} - -## Tooling - -* [Local Development + Token CLI](https://github.com/Lightprotocol/light-protocol/tree/main/cli) -* [ZK Compression RPC](https://github.com/helius-labs/photon) - -## Active Feature Set - -* **Compressed accounts** (no upfront rent) -* **Compressed-token program**. Create + mint (tested for up to 25x token mint batch, \~5000x cheaper than SPL-token mints) -* **Compress/decompress** SOL and tokens -* Rust-SDK -* Ts-sdk - -## Upcoming Changes - -* Support unique PDA address in typescript client -* End-to-end program example with a typescript anchor client -* Public Testnet -* Program-owned state tree support diff --git a/compression-docs/resources/changelog/0.4.0.md b/compression-docs/resources/changelog/0.4.0.md deleted file mode 100644 index 60b3165..0000000 --- a/compression-docs/resources/changelog/0.4.0.md +++ /dev/null @@ -1,26 +0,0 @@ -# 0.4.0 - -## ZK Testnet is Here! - -{% hint style="info" %} -_Note: It’s an alpha release, so bugs & breaking changes can occur. If you have questions, bugs, or feedback, check out the_ [_Helius_](https://discord.gg/Uzzf6a7zKr) _and_ [_Light_](https://discord.gg/CYvjBgzRFP) _Developer Discord for help. Or message us directly via_ [_Telegram_](https://t.me/swen_light) -{% endhint %} - -Testnet details**, while currently deprecated,** are still visible in the [**Devnet Addresses section**](https://www.zkcompression.com/developers/devnet-addresses#zktestnet-urls-deprecated) - -**You can find a list of all crates here:** - -{% embed url="https://github.com/Lightprotocol/light-protocol/releases/tag/v0.4.0" %} - -### Tooling - -* [Local Development + Token CLI](https://github.com/Lightprotocol/light-protocol/tree/main/cli) -* [ZK Compression RPC](https://github.com/helius-labs/photon) - -### Active Feature Set - -* **Compressed accounts** (no upfront rent) -* **Compressed-token program**. Create + mint (tested for up to 25x token mint batch, \~5000x cheaper than SPL-token mints) -* **Compress/decompress** SOL and tokens -* **Ts-sdk**[\ - ](https://www.zkcompression.com/introduction/intro-to-development) diff --git a/compression-docs/resources/changelog/0.5.0.md b/compression-docs/resources/changelog/0.5.0.md deleted file mode 100644 index 8c8b8dd..0000000 --- a/compression-docs/resources/changelog/0.5.0.md +++ /dev/null @@ -1,32 +0,0 @@ -# 0.5.0 - -## Solana Devnet is here! - -{% hint style="info" %} -_Note: It’s an alpha release, so bugs and breaking changes can occur. If you find bugs, have questions, or have feedback, check out the Helius and Light Developer Discord for help. You can also message us directly via_ [_Telegram_](https://t.me/swen_light) -{% endhint %} - -This release includes various quality-of-life improvements, including for robustness and performance - -You can find a detailed list of all changes here: - -{% embed url="https://github.com/Lightprotocol/light-protocol/releases/tag/v.0.5.0" %} - -## Migrating from zkTestnet - -1. The same `programIds` and account addresses as zkTestnet are used. The full details are listed in the [Devnet Addresses](../../developers/addresses-and-urls.md) section -2. Airdrop yourself some Devnet SOL via the Solana CLI and deploy your program to the public Solana Devnet cluster -3. :tada: -4. If you have any issues migrating or deploying your program on Devnet, just [let us know](https://t.me/swen_light)! - -### Tooling - -* [Development + Token CLI](https://github.com/Lightprotocol/light-protocol/tree/main/cli) -* [ZK Compression RPC](https://github.com/helius-labs/photon) (this is supported out-of-the-box via the CLI) - -### Active Feature set - -* **Compressed accounts** (no upfront rent) -* **Compressed-token program**. Create + mint (tested for up to 25x token mint batch, \~5000x cheaper than SPL-token mints) -* **Compress/decompress** PDA accounts and tokens -* **Ts-sdk** diff --git a/compression-docs/resources/changelog/0.6.0.md b/compression-docs/resources/changelog/0.6.0.md deleted file mode 100644 index b8ab280..0000000 --- a/compression-docs/resources/changelog/0.6.0.md +++ /dev/null @@ -1,26 +0,0 @@ -# 0.6.0 - -## A new release for Localnet and Devnet is here! - -{% hint style="info" %} -_Note: This is a beta release. If you find bugs, have questions, or have feedback, check out the Helius and Light Developer Discord for help. You can also message us directly via_ [_Telegram_](https://t.me/swen_light)_._ -{% endhint %} - -This release includes various quality-of-life improvements, including for robustness and performance. - -### Breaking changes - -* **New program IDs**. The up-to-date list can be found [here](https://www.zkcompression.com/developers/devnet-addresses). -* **JS RPC client**: compressed account endpoints now get returned with a cursor that allows for proper pagination. therefore accounts must be accessed via `response.items.accounts` instead of `response.accounts`. - -You can find a detailed list of all changes here: - -{% embed url="https://github.com/Lightprotocol/light-protocol/releases/tag/v.0.6.0" %} - -### Upgrading from v0.5.0 - -* Redeploy your programs on devnet pointing to the [**new program IDs**](../../developers/addresses-and-urls.md#program-ids-and-accounts-from-27th-aug-2024-onward). You may also need to update your JS client's use of `getCompressedAccounts` according to the breaking changes highlighted above. - -### Examples - -* We added a new simple name service program reference implementation! It uses the latest releases [**here**](https://github.com/Lightprotocol/light-protocol/tree/main/examples/name-service). diff --git a/compression-docs/resources/changelog/README.md b/compression-docs/resources/changelog/README.md deleted file mode 100644 index 4dc68c6..0000000 --- a/compression-docs/resources/changelog/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# Changelog - diff --git a/compression-docs/resources/changelog/js-0.21.0.md b/compression-docs/resources/changelog/js-0.21.0.md deleted file mode 100644 index 0a165f4..0000000 --- a/compression-docs/resources/changelog/js-0.21.0.md +++ /dev/null @@ -1,76 +0,0 @@ -# JS - 0.21.0 - -## This is a JS release for `@lightprotocol/stateless.js` and `@lightprotocol/compressed-token.` - -v0.21.0 has several important breaking changes that improve protocol scalability. - -{% hint style="info" %} -If you need help migrating, we're happy to assist you. Please reach out to the team [here](https://t.me/swen_light). -{% endhint %} - -## How to Migrate from v0.20.x - -You can find working code snippets [here](https://www.zkcompression.com/developers/add-compressed-token-support-to-your-wallet#decompress-spl-tokens). - -## Compress - -
// old
-const activeStateTrees = await connection.getCachedActiveStateTreeInfo();
-const { tree } = pickRandomTreeAndQueue(activeStateTrees);
-
-const compressIx = await CompressedTokenProgram.compress({
-    outputStateTree: tree,
-});
-
-
-// New
-const treeInfos = await rpc.getStateTreeInfos();
-const treeInfo = selectStateTreeInfo(treeInfos);
-
-const infos = await getTokenPoolInfos(rpc, mint);
-const tokenPoolInfo = selectTokenPoolInfo(infos);
-
-const compressIx = await CompressedTokenProgram.compress({
-    outputStateTreeInfo: treeInfo,
-    tokenPoolInfo,
-});
-
- -## Decompress - -**Old (v0.20.x)** - -```typescript -// ... - -const stateTreeInfos = await rpc.getCachedActiveStateTreeInfo(); -const { tree } = pickRandomTreeAndQueue(stateTreeInfos) - -const ix = await CompressedTokenProgram.decompress({ - ...rest, - outputStateTree: tree, -}); -``` - -**New (v0.21.x)** - -```typescript -// ... - -const poolInfos = await getTokenPoolInfos(rpc, mint); -const selectedTokenPoolInfos = selectTokenPoolInfosForDecompression( - poolInfos, - amount, -); - -const ix = await CompressedTokenProgram.decompress({ - ...rest - tokenPoolInfos: selectedTokenPoolInfos, -}); -``` - - - -**You can find a detailed list of all changes here:** - -{% embed url="https://github.com/Lightprotocol/light-protocol/blob/b860d449b25d1943b4bc007717316913c9713be8/js/compressed-token/CHANGELOG.md" %} diff --git a/compression-docs/resources/changelog/protocol-1.0.0.md b/compression-docs/resources/changelog/protocol-1.0.0.md deleted file mode 100644 index 0a16be6..0000000 --- a/compression-docs/resources/changelog/protocol-1.0.0.md +++ /dev/null @@ -1,13 +0,0 @@ -# Protocol - 1.0.0 - -## The 1.0.0 Release for Mainnet-Beta is here! - -This is a program and program-dependencies release. You can expect a stable API for those and deploy custom programs using ZK Compression in production. - -{% hint style="info" %} -_Please note: Our SDK implementations (JS client SDKs and rust-SDK) continue to be v0 and are unaudited._ -{% endhint %} - -You can find a detailed list of all changes here: - -{% embed url="https://github.com/Lightprotocol/light-protocol/releases/tag/v.1.0.0" %} diff --git a/compression-docs/resources/privacy-policy.md b/compression-docs/resources/privacy-policy.md deleted file mode 100644 index 186d902..0000000 --- a/compression-docs/resources/privacy-policy.md +++ /dev/null @@ -1,204 +0,0 @@ ---- -description: 'Last updated: September 14, 2024' ---- - -# Privacy Policy - -1\. PURPOSE OF THIS DOCUMENT - -1.1. This privacy policy ("Privacy Policy") describes how Light Protocol Labs ("Light Protocol," "we," "us," or "our") collects, uses, and shares information about you. This Privacy Policy applies whenever you use [https://www.zkcompression.com](https://www.zkcompression.com) (the "Website" or “Service”), contact our support team, interact with us on social media, or engage with us in any other manner. - -1.2. We may update this Privacy Policy from time to time and therefore encourage you to review this Privacy Policy frequently. If any changes are made, we will update the revision date at the top of this policy, and in certain cases, we may provide additional notice (such as posting a notice on our Website or sending a notification). - -1.3. For any matters, relating to data protection you may contact in writing by e-mail [friends@lightprotocol.com](mailto:friends@lightprotocol.com). - - - -2\. CONTENTS - -COLLECTING OF INFORMATION\ -USE OF INFORMATION\ -RETENTION OF INFORMATION\ -YOUR RIGHTS\ -DISCLOSURE OF DATA\ -TRANSFERS OF INFORMATION\ -DATA SECURITY AND LIABILITY\ -MINORS PRIVACY\ -LINKS TO OTHER WEBSITES\ -YOUR CALIFORNIA PRIVACY RIGHTS\ -ADDITIONAL DISCLOSURES FOR INDIVIDUALS IN EUROPE\ -CONTACT - - - -3\. COLLECTING OF INFORMATION - -3.1. We collect personal information you provide directly to us. - -3.2. We collect data about how you access and interact with our Website including information about the device and network you use, such as your hardware model, operating system version, browser type, IP address, mobile network, and unique device identifiers. Additionally, we track your activity on the Website, such as access times, pages viewed, links clicked, and the page that directed you to our Website. - -3.3. When accessing the Website via a mobile device, we may also gather information like your device ID, mobile browser type, and operating system. Usage data is collected automatically and includes diagnostic details such as the time spent on each page and other related metrics. - -3.4. With your device’s permissions, we may collect precise location data. You can disable the collection of this information at any time by adjusting your device settings. - -3.5. We use cookies and similar tracking technologies to gather information about your usage of our Website. Cookies are small data files stored on your device that help us enhance your experience, track popular features, and monitor visits. You may instruct Your browser to refuse all Cookies or to indicate when a Cookie is being sent. If you refuse Cookies, you may not be able to use some parts of our Service. - - - -4\. USE OF INFORMATION - -4.1. We use the information collected to provide, maintain, and improve our products, services, and Website. Additionally, we use the data to personalize your experience, respond to customer inquiries, and provide technical notices, security alerts, and support messages. - -4.2. Our use of the information extends to: - -4.2.1. Monitoring and analyzing trends, usage, and activities related to our Website. - -4.2.2. Detecting, investigating, and preventing fraudulent, illegal, or malicious activity to protect the rights and property of our company and others. - -4.2.3. Debugging and identifying errors in our Website. - -4.2.4. Fulfilling legal and financial obligations. - -4.2.5. We may also use the information for additional purposes described to you at the time the data was collected or for purposes like data analysis, identifying trends, and improving our services. - - - -5\. RETENTION OF INFORMATION - -5.1. We will retain your information only as long as necessary for the purposes outlined in this Privacy Policy and ay retain Usage Data for security improvements or legal obligations. - -5.2. We expect to delete your information (at the latest) once there is no longer any legal or regulatory requirement or legitimate business purpose. - - - -6\. YOUR RIGHTS - -You have certain data protection rights, including the right to: - -6.1. request access to, update, or delete your personal data, and manage your information directly within the Service. - -6.2. to correct incomplete or inaccurate data and request the restriction of processing in certain situations. - -6.3. to obtain information on how and why your personal data is processed. - -6.4. request that we stop processing your personal data and withdraw consent to direct marketing at any time. - -6.5. the right to be notified of any data breach that may affect your rights and freedoms. - -6.6. request the deletion of your personal data in specific circumstances, such as when it's no longer necessary for the original purpose (right to be forgotten). - - - -7\. DISCLOSURE OF DATA - -7.1. We may disclose your Data: - -7.1.1. in connection with business transactions. - -7.1.2. to comply with legal obligations, if we believe that disclosure is in accordance with, or required by, any applicable law or legal process, including lawful requests by public authorities to meet national security or law enforcement requirements - -7.1.3. if we believe that your actions are inconsistent with our user agreements or policies, if we believe that you have violated the law, or if we believe it is necessary to protect the rights, property, and safety of Light Protocol, our users, the public, or others. - -7.1.4. to protect the rights, property, or safety of the Company, Service, or users. - - - -8\. TRANSFERS OF INFORMATION - -8.1. Your information, including Personal Data, is processed at the Company's operating offices and in any other places where the parties involved in the processing are located. It means that this information may be transferred to — and maintained on — computers located outside of Your state, province, country or other governmental jurisdiction where the data protection laws may differ than those from Your jurisdiction - -8.2. Your consent to this Privacy Policy followed by your submission of such information represents your agreement to that transfer - -8.3. The Company will take all steps reasonably necessary to ensure that your data is treated securely and in accordance with this Privacy Policy and no transfer of your Personal Data will take place to an organization or a country unless there are adequate controls in place including the security of your data and other personal information. - - - -9\. DATA SECURITY AND LIABILITY - -9.1. We implement robust technical and organizational measures to safeguard your personal data from unauthorized access, manipulation, loss, or exposure. These security protocols are regularly updated and enhanced in line with evolving technological standards. - -9.2. Please be aware that transmitting data over the internet (e.g., through email communications) is not always completely secure, and we cannot be held responsible for any data shared with us via these methods. While we strive to protect your information, absolute security cannot be guaranteed. - -9.3. This privacy policy does not extend to third-party websites or any external links provided on our platform. We disclaim any responsibility or liability for the content or data protection practices of third-party websites. - - - -10\. MINORS PRIVACY - -10.1. Our Service does not address anyone under 18, and we do not knowingly collect information from minors. - -10.2. If you are a parent and aware that your minors has provided Personal Data, please contact Us. - -10.3. If We become aware that We have collected Personal Data from anyone under the age of 18 without verification of parental consent, We take steps to remove that information from Our servers. - - - -11\. LINKS TO OTHER WEBSITES - -11.1. Our Service may contain links to third-party websites that are not operated by us. - -11.2. We advise you to review the Privacy Policy of every site you visit. We have no control over and no responsibility for the content, privacy policies or practices of any third party sites or services. - - - -12\. YOUR CALIFORNIA PRIVACY RIGHTS - -12.1. This section applies to you, if you are a California Resident. - -12.2. The California Consumer Privacy Act or "CCPA" (California Consumer Privacy Act of 2018) affords consumers residing in California additional rights with respect to their personal information. - -12.3. You have the right to inform you of (i) the categories of personal information we have collected about you over the past 12 months; (ii) the specific pieces of personal information we collect, use, and disclose about you; (iii) the categories of sources from which we collected your personal information; (iv) The categories of third parties to whom your personal information was disclosed; (v) the purposes for collecting your personal information; (vi) request deletion of your personal information, and (vii) not be discriminated against for exercising these rights. You may make these requests by contacting us at [friends@lightprotocol.com](mailto:friends@lightprotocol.com). Please note that these rights may be subject to limitations as outlined by applicable laws. In certain cases, we may need to deny your request in order to comply with our legal obligations or protect our rights. - -12.4. Light Protocol does not sell your personal information. - -12.5. We will not discriminate against you if you exercise your rights under the CCPA. - - - -13\. ADDITIONAL DISCLOSURES FOR INDIVIDUALS IN EUROPE - -13.1. If you are located in the European Economic Area ("EEA"), the United Kingdom, or Switzerland, you have certain rights and protections under the law regarding the processing of your personal data, and this section applies to you. - - - -13.2. Legal Basis for Processing - -13.2.1. When we process your personal data, we will do so in reliance on the following lawful bases: To perform our responsibilities under our contract with you (e.g., processing payments for and providing the products and services you requested). - -13.2.2. When we have a legitimate interest in processing your personal data to operate our business or protect our interests (e.g., to provide, maintain, and improve our products and services, conduct data analytics, and communicate with you). - -13.2.3. To comply with our legal obligations (e.g., to maintain a record of your consents and track those who have opted out of communications). - -13.2.4. When we have your consent to do so (e.g., when you opt in to receive communications from us). - -13.2.5. When consent is the legal basis for our processing your personal data, you may withdraw such consent at any time. - - - -13.3. DATA RETENTION - -We store other personal data for as long as necessary to carry out the purposes for which we originally collected it and for other legitimate business purposes, including to meet our legal, regulatory, or other compliance obligations. - - - -13.4. DATA SUBJECT REQUESTS - -Subject to certain limitations, you have the right to request access to the personal data we hold about you and to receive your data in a portable format, the right to ask that your personal data be corrected or erased, and the right to object to, or request that we restrict, certain processing. If you would like to exercise any of these rights, please contact us at [friends@lightprotocol.com](mailto:friends@lightprotocol.com). - - - -13.5. QUESTIONS OR COMPLAINTS - -Where we are not able to rectify a concern about our processing of personal data you have the right to lodge a complaint with the data protection authority of your place of residence. You can contact your Data Protection Authority using your respective link below: - -· EEA residents: [https://edpb.europa.eu/about-edpb/board/members\_en](https://edpb.europa.eu/about-edpb/board/members\_en) - -· UK residents: [https://ico.org.uk/global/contact-us/](https://ico.org.uk/global/contact-us/) - -· Switzerland residents: [https://www.edoeb.admin.ch/edoeb/en/home/the-fdpic/contact.html](https://www.edoeb.admin.ch/edoeb/en/home/the-fdpic/contact.html) - - - -14\. CONTACT - -If you have any questions about this Privacy Policy, You can contact us at email [friends@lightprotocol.com](mailto:friends@lightprotocol.com) referencing “Data Protection Enquiry". diff --git a/compression-docs/resources/security.md b/compression-docs/resources/security.md deleted file mode 100644 index 60f6d0d..0000000 --- a/compression-docs/resources/security.md +++ /dev/null @@ -1,26 +0,0 @@ -# Security - -### Bug Bounty - -Light Protocol is hosting a [bug bounty program](https://immunefi.com/bug-bounty/light-protocol/information/). - -### Security Audits - -The Light protocol on-chain programs were audited by independent security firms Neodyme, OtterSec, Accretion, and Zellic. - -* [Accretion audit report](https://github.com/Lightprotocol/light-protocol/blob/main/audits/accretion_v1_update_audit.pdf) (January '25) -* [Zellic audit report](https://github.com/Lightprotocol/light-protocol/blob/main/audits/zellic_v1_audit.pdf) (September '24) -* [Neodyme audit report](https://github.com/Lightprotocol/light-protocol/blob/main/audits/neodyme_v1_audit.pdf) (August '24) -* [OtterSec audit report](https://github.com/Lightprotocol/light-protocol/blob/main/audits/ottersec_v1_audit.pdf) (July '24) - -A complete list of 3rd party audits can be found [here](https://github.com/Lightprotocol/light-protocol/tree/main/audits). - -### Groth16 Circuit Security - -The ZK Compression circuit was formally verified by Reilabs. See the report [here](https://github.com/Lightprotocol/light-protocol/blob/main/audits/reilabs_circuits_formal_verification_report.pdf). - -Information about the Trusted Setup Ceremony for the groth16 circuits is [here](https://github.com/Lightprotocol/gnark-mt-setup/blob/main/README.md). - -{% hint style="info" %} -**For additional information on Light Protocol's security policy, read** [**here**](https://github.com/Lightprotocol/light-protocol/blob/main/SECURITY.md)**.** -{% endhint %} diff --git a/docs/.gitbook/assets/Group 100.png b/docs/.gitbook/assets/Group 100.png deleted file mode 100644 index 74d6cce..0000000 Binary files a/docs/.gitbook/assets/Group 100.png and /dev/null differ diff --git a/docs/.gitbook/assets/Group 101.png b/docs/.gitbook/assets/Group 101.png deleted file mode 100644 index 1a321a4..0000000 Binary files a/docs/.gitbook/assets/Group 101.png and /dev/null differ diff --git a/docs/.gitbook/assets/Group 102.png b/docs/.gitbook/assets/Group 102.png deleted file mode 100644 index 035c577..0000000 Binary files a/docs/.gitbook/assets/Group 102.png and /dev/null differ diff --git a/docs/.gitbook/assets/Group 103 (1).png b/docs/.gitbook/assets/Group 103 (1).png deleted file mode 100644 index 6c7422d..0000000 Binary files a/docs/.gitbook/assets/Group 103 (1).png and /dev/null differ diff --git a/docs/.gitbook/assets/Group 103.png b/docs/.gitbook/assets/Group 103.png deleted file mode 100644 index 6c7422d..0000000 Binary files a/docs/.gitbook/assets/Group 103.png and /dev/null differ diff --git a/docs/.gitbook/assets/Group 49 (2).png b/docs/.gitbook/assets/Group 49 (2).png deleted file mode 100644 index 7960daf..0000000 Binary files a/docs/.gitbook/assets/Group 49 (2).png and /dev/null differ diff --git a/docs/.gitbook/assets/Group 604.png b/docs/.gitbook/assets/Group 604.png deleted file mode 100644 index b62756d..0000000 Binary files a/docs/.gitbook/assets/Group 604.png and /dev/null differ diff --git a/docs/.gitbook/assets/Group 632697.png b/docs/.gitbook/assets/Group 632697.png deleted file mode 100644 index f744b74..0000000 Binary files a/docs/.gitbook/assets/Group 632697.png and /dev/null differ diff --git a/docs/.gitbook/assets/Group 632704.jpg b/docs/.gitbook/assets/Group 632704.jpg deleted file mode 100644 index 8786605..0000000 Binary files a/docs/.gitbook/assets/Group 632704.jpg and /dev/null differ diff --git a/docs/.gitbook/assets/Group 91.png b/docs/.gitbook/assets/Group 91.png deleted file mode 100644 index a8df7bb..0000000 Binary files a/docs/.gitbook/assets/Group 91.png and /dev/null differ diff --git a/docs/.gitbook/assets/Group 93.png b/docs/.gitbook/assets/Group 93.png deleted file mode 100644 index ab9879b..0000000 Binary files a/docs/.gitbook/assets/Group 93.png and /dev/null differ diff --git a/docs/.gitbook/assets/Group 96.png b/docs/.gitbook/assets/Group 96.png deleted file mode 100644 index 262190e..0000000 Binary files a/docs/.gitbook/assets/Group 96.png and /dev/null differ diff --git a/docs/.gitbook/assets/Group 99 (1).png b/docs/.gitbook/assets/Group 99 (1).png deleted file mode 100644 index 60bdc18..0000000 Binary files a/docs/.gitbook/assets/Group 99 (1).png and /dev/null differ diff --git a/docs/.gitbook/assets/Group 99.png b/docs/.gitbook/assets/Group 99.png deleted file mode 100644 index cc96bc4..0000000 Binary files a/docs/.gitbook/assets/Group 99.png and /dev/null differ diff --git a/docs/.gitbook/assets/Logo White on Blue.png b/docs/.gitbook/assets/Logo White on Blue.png deleted file mode 100644 index 6266fb1..0000000 Binary files a/docs/.gitbook/assets/Logo White on Blue.png and /dev/null differ diff --git a/docs/.gitbook/assets/Screenshot 2024-05-13 at 14.40.53.png b/docs/.gitbook/assets/Screenshot 2024-05-13 at 14.40.53.png deleted file mode 100644 index 8045247..0000000 Binary files a/docs/.gitbook/assets/Screenshot 2024-05-13 at 14.40.53.png and /dev/null differ diff --git a/docs/.gitbook/assets/image (1) (1) (1).png b/docs/.gitbook/assets/image (1) (1) (1).png deleted file mode 100644 index 11dfa5f..0000000 Binary files a/docs/.gitbook/assets/image (1) (1) (1).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (1) (1).png b/docs/.gitbook/assets/image (1) (1).png deleted file mode 100644 index e4c30f1..0000000 Binary files a/docs/.gitbook/assets/image (1) (1).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (1).png b/docs/.gitbook/assets/image (1).png deleted file mode 100644 index d7c5bc6..0000000 Binary files a/docs/.gitbook/assets/image (1).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (10).png b/docs/.gitbook/assets/image (10).png deleted file mode 100644 index d1ae1ed..0000000 Binary files a/docs/.gitbook/assets/image (10).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (11).png b/docs/.gitbook/assets/image (11).png deleted file mode 100644 index 2dc7c34..0000000 Binary files a/docs/.gitbook/assets/image (11).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (12).png b/docs/.gitbook/assets/image (12).png deleted file mode 100644 index ac15196..0000000 Binary files a/docs/.gitbook/assets/image (12).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (13).png b/docs/.gitbook/assets/image (13).png deleted file mode 100644 index 4edf535..0000000 Binary files a/docs/.gitbook/assets/image (13).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (14).png b/docs/.gitbook/assets/image (14).png deleted file mode 100644 index ddc68dd..0000000 Binary files a/docs/.gitbook/assets/image (14).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (15).png b/docs/.gitbook/assets/image (15).png deleted file mode 100644 index 605c189..0000000 Binary files a/docs/.gitbook/assets/image (15).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (16).png b/docs/.gitbook/assets/image (16).png deleted file mode 100644 index 8d139f5..0000000 Binary files a/docs/.gitbook/assets/image (16).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (17).png b/docs/.gitbook/assets/image (17).png deleted file mode 100644 index 1049820..0000000 Binary files a/docs/.gitbook/assets/image (17).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (18).png b/docs/.gitbook/assets/image (18).png deleted file mode 100644 index aab85ab..0000000 Binary files a/docs/.gitbook/assets/image (18).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (19).png b/docs/.gitbook/assets/image (19).png deleted file mode 100644 index b651a73..0000000 Binary files a/docs/.gitbook/assets/image (19).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (2) (1) (1).png b/docs/.gitbook/assets/image (2) (1) (1).png deleted file mode 100644 index dcffa1c..0000000 Binary files a/docs/.gitbook/assets/image (2) (1) (1).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (2) (1).png b/docs/.gitbook/assets/image (2) (1).png deleted file mode 100644 index e4c30f1..0000000 Binary files a/docs/.gitbook/assets/image (2) (1).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (2).png b/docs/.gitbook/assets/image (2).png deleted file mode 100644 index 6cf0af6..0000000 Binary files a/docs/.gitbook/assets/image (2).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (20).png b/docs/.gitbook/assets/image (20).png deleted file mode 100644 index f03ca82..0000000 Binary files a/docs/.gitbook/assets/image (20).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (21).png b/docs/.gitbook/assets/image (21).png deleted file mode 100644 index 727a4c9..0000000 Binary files a/docs/.gitbook/assets/image (21).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (22).png b/docs/.gitbook/assets/image (22).png deleted file mode 100644 index c8c0d86..0000000 Binary files a/docs/.gitbook/assets/image (22).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (23).png b/docs/.gitbook/assets/image (23).png deleted file mode 100644 index 3dead9a..0000000 Binary files a/docs/.gitbook/assets/image (23).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (24).png b/docs/.gitbook/assets/image (24).png deleted file mode 100644 index c34ff7f..0000000 Binary files a/docs/.gitbook/assets/image (24).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (25).png b/docs/.gitbook/assets/image (25).png deleted file mode 100644 index 9ab8366..0000000 Binary files a/docs/.gitbook/assets/image (25).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (26).png b/docs/.gitbook/assets/image (26).png deleted file mode 100644 index 8307cad..0000000 Binary files a/docs/.gitbook/assets/image (26).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (27).png b/docs/.gitbook/assets/image (27).png deleted file mode 100644 index 0c1d961..0000000 Binary files a/docs/.gitbook/assets/image (27).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (28).png b/docs/.gitbook/assets/image (28).png deleted file mode 100644 index 874b855..0000000 Binary files a/docs/.gitbook/assets/image (28).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (29).png b/docs/.gitbook/assets/image (29).png deleted file mode 100644 index ce98614..0000000 Binary files a/docs/.gitbook/assets/image (29).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (3) (1).png b/docs/.gitbook/assets/image (3) (1).png deleted file mode 100644 index ce0e647..0000000 Binary files a/docs/.gitbook/assets/image (3) (1).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (3).png b/docs/.gitbook/assets/image (3).png deleted file mode 100644 index d9f386e..0000000 Binary files a/docs/.gitbook/assets/image (3).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (30).png b/docs/.gitbook/assets/image (30).png deleted file mode 100644 index 9322be2..0000000 Binary files a/docs/.gitbook/assets/image (30).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (31).png b/docs/.gitbook/assets/image (31).png deleted file mode 100644 index 431ff0b..0000000 Binary files a/docs/.gitbook/assets/image (31).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (32).png b/docs/.gitbook/assets/image (32).png deleted file mode 100644 index 46bfadf..0000000 Binary files a/docs/.gitbook/assets/image (32).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (33).png b/docs/.gitbook/assets/image (33).png deleted file mode 100644 index 304c7e3..0000000 Binary files a/docs/.gitbook/assets/image (33).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (34).png b/docs/.gitbook/assets/image (34).png deleted file mode 100644 index 72d4523..0000000 Binary files a/docs/.gitbook/assets/image (34).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (35).png b/docs/.gitbook/assets/image (35).png deleted file mode 100644 index 7003b26..0000000 Binary files a/docs/.gitbook/assets/image (35).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (36).png b/docs/.gitbook/assets/image (36).png deleted file mode 100644 index 074d3cf..0000000 Binary files a/docs/.gitbook/assets/image (36).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (37).png b/docs/.gitbook/assets/image (37).png deleted file mode 100644 index ed5751f..0000000 Binary files a/docs/.gitbook/assets/image (37).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (38).png b/docs/.gitbook/assets/image (38).png deleted file mode 100644 index 3df73f2..0000000 Binary files a/docs/.gitbook/assets/image (38).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (39).png b/docs/.gitbook/assets/image (39).png deleted file mode 100644 index 5eba656..0000000 Binary files a/docs/.gitbook/assets/image (39).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (4) (1).png b/docs/.gitbook/assets/image (4) (1).png deleted file mode 100644 index c776f54..0000000 Binary files a/docs/.gitbook/assets/image (4) (1).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (4).png b/docs/.gitbook/assets/image (4).png deleted file mode 100644 index 2cef43a..0000000 Binary files a/docs/.gitbook/assets/image (4).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (40).png b/docs/.gitbook/assets/image (40).png deleted file mode 100644 index 6383adb..0000000 Binary files a/docs/.gitbook/assets/image (40).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (41).png b/docs/.gitbook/assets/image (41).png deleted file mode 100644 index d7c5bc6..0000000 Binary files a/docs/.gitbook/assets/image (41).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (42).png b/docs/.gitbook/assets/image (42).png deleted file mode 100644 index f5e7cba..0000000 Binary files a/docs/.gitbook/assets/image (42).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (5) (1).png b/docs/.gitbook/assets/image (5) (1).png deleted file mode 100644 index 605c189..0000000 Binary files a/docs/.gitbook/assets/image (5) (1).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (5).png b/docs/.gitbook/assets/image (5).png deleted file mode 100644 index 463216a..0000000 Binary files a/docs/.gitbook/assets/image (5).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (6).png b/docs/.gitbook/assets/image (6).png deleted file mode 100644 index 3659b25..0000000 Binary files a/docs/.gitbook/assets/image (6).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (7).png b/docs/.gitbook/assets/image (7).png deleted file mode 100644 index fc5b9b1..0000000 Binary files a/docs/.gitbook/assets/image (7).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (8).png b/docs/.gitbook/assets/image (8).png deleted file mode 100644 index 6318a01..0000000 Binary files a/docs/.gitbook/assets/image (8).png and /dev/null differ diff --git a/docs/.gitbook/assets/image (9).png b/docs/.gitbook/assets/image (9).png deleted file mode 100644 index 1c8b261..0000000 Binary files a/docs/.gitbook/assets/image (9).png and /dev/null differ diff --git a/docs/.gitbook/assets/image-2.png b/docs/.gitbook/assets/image-2.png deleted file mode 100644 index f5e7cba..0000000 Binary files a/docs/.gitbook/assets/image-2.png and /dev/null differ diff --git a/docs/.gitbook/assets/image.png b/docs/.gitbook/assets/image.png deleted file mode 100644 index 74dbc18..0000000 Binary files a/docs/.gitbook/assets/image.png and /dev/null differ diff --git a/docs/.gitbook/assets/light_architecture.png b/docs/.gitbook/assets/light_architecture.png deleted file mode 100644 index 490551f..0000000 Binary files a/docs/.gitbook/assets/light_architecture.png and /dev/null differ diff --git a/docs/README (1).md b/docs/README (1).md deleted file mode 100644 index 0a7762a..0000000 --- a/docs/README (1).md +++ /dev/null @@ -1,88 +0,0 @@ -# Terminology - -### Compressed Solana Program (CSP) - -A smart contract that interacts with ZK-compressed state via the LightLayer. This includes regular Anchor programs that execute fully on-chain and programs that run custom off-chain computation over compressed state. - - - -### Compressed State / Light State - -State that is orders of magnitude cheaper than regular "uncompressed" state while preserving the security, performance, and composability of the Solana L1. - -**Regular Solana state** lives in on-chain accounts. On-chain accounts are always loaded into the RAM of the Solana network and therefore incur a cost for the user. Users must pay for rent exemption at account creation by locking SOL based on the account size. This rent cost is prohibitive for applications and DePin networks where the incremental Lifetime Value of an individual user's on-chain state is lower than the cost of the state. - -With **compressed state**, only a much smaller root hash of the state (a unique fingerprint) is stored on-chain, while the underlying data is stored off-chain. - -Whenever a program or dApp interacts with compressed state, the Light smart contracts verify the integrity of the state against its root hash. - -By default, the underlying "raw" state gets permanently stored on the Solana ledger, thereby leveraging the security of the Solana blockchain for Data Availability (DA). - -To achieve this and to inherit Solana's parallelism, compressed state via the LightLayer is stored across _`n`_ **state trees** (concurrent Merkle trees). Each piece of data that is created or consumed in a transaction represents a single leaf of a state tree. All tree leaves get recursively hashed together so that only the tree's final 32-byte root hash needs to be stored on-chain. - -To verify the validity of many pieces of state (CompressedAccounts) inside a single Solana transaction, Light uses Zero-knowledge cryptography, enabling the client to compress all state proofs into one small validity proof with a constant size of 128 bytes. - - - -### Compressed Account - -Compressed accounts are the base primitive that developers interact with. They closely resemble the layout and utility of regular Solana accounts. Compressed accounts can be program-owned and can optionally have a permanent unique `address` (PDA). - -One difference to regular Solana accounts is that the `address` field is optional. By default, compressed accounts can be identified by their hash, with the hash inputs being the underlying account data plus the account's unique location (leafIndex) in its corresponding state tree. - -The optional unique `address` allows for verifiable uniqueness guarantees of compressed state, which can be useful for applications that require non-fungible state. - -Every transaction specifies which state trees it reads from (input) and writes to (output). - -When writing to a compressed account, the protocol consumes the current state and creates the new state. - -`input state (current) -> state transition -> output state (new)` - -A single transaction can read from _`n`_ (currently n≤8) compressed account inputs, and write to _`m`_ compressed account outputs, inheriting Solana's parallelism. - - - -### Merkle tree / State tree - -Merkle trees are the underlying data structure that allows for efficient verification of the integrity of the state. - -Light consists of a 'forest' of state trees. Each state tree has a corresponding on-chain account storing a sparse Merkle tree, the tree's metadata, and _`n`_ recent root hashes (a root hash is the final 32-byte hash resulting from hashing together all current leaves of the tree). One state tree can have many leaves, for example, a tree of height 32 has a total capacity of 2\*\*32 (\~4B) leaves. Each leaf represents the hash of the state of a compressed account as emitted in a previous transaction. - - - -### Forester node - -The protocol must invalidate the consumed state whenever a transaction consumes compressed account inputs. This is achieved by storing the consumed compressed account identifier hashes in an on-chain nullifier queue account. Each state tree has an associated nullifier queue. These queues have a specified length (default: n = 4800). When the queue is full, transactions involving input state from the respective state tree will fail. To ensure the liveness of the LightLayer, off-chain keepers (called Foresters) must periodically empty these queues. - -To do so, Foresters asynchronously update the respective leaves in the state tree with zero values and remove the leaves hashes from the nullifier queue. - -The nullification process is trustless and permissionless. - - - -### Photon node - -Photon is the canonical indexer implementation for the ZK Compression API, built and maintained by Helius Labs. You can access their open-source implementation here: [https://github.com/helius-labs/photon](https://github.com/helius-labs/photon). - - - -### Validity proof / ZKP - -At the system level, validity proofs mathematically prove the correctness of the input state that is read by a transaction. One of the most important properties of the proofs used within Light is their succinctness (read: short. 256 bytes / 128 bytes compressed). - - - -### Groth16 - -Groth16 is a Zero-Knowledge Proof (ZKP) system used within Light for efficient proof generation and verification. Groth16 proofs belong to the family of SNARKs. (**S**uccinct **N**on-interactive **Ar**guments of **K**nowledge). - - - - - - - - - - - diff --git a/docs/README.md b/docs/README.md deleted file mode 100644 index 98f4255..0000000 --- a/docs/README.md +++ /dev/null @@ -1,50 +0,0 @@ -# Overview - -
- -
- -
- -## What is Light Protocol? - -Light is a protocol built on Solana that introduces **ZK compression,** a primitive that enables secure scaling directly on the L1. - -## **Why build with Light?** - -**Hyperscale state:** Developers and users can opt to compress their on-chain state, reducing state costs **by orders of magnitude** while preserving the security, performance, and composability of the Solana L1. - -**A new design space for computation**: In addition to classic on-chain compute, compressed state via Light natively supports custom ZK compute, enabling developers to build previously impossible computation designs on Solana. - -{% hint style="info" %} -In depth documentation for developers is provided at [https://www.zkcompression.com](https://www.zkcompression.com). -{% endhint %} - -### State cost reduction - -| Creation Cost | Regular Account | Compressed Account | -| -------------------- | --------------- | ------------------------------ | -| 100-byte PDA Account | \~ 0.0016 SOL | \~ 0.00001 SOL (160x cheaper) | -| 100 Token Accounts | \~ 0.2 SOL | \~ 0.00004 SOL (5000x cheaper) | - -## Core Features - -| **Minimal state cost** | Securely stores state on cheaper ledger space instead of the more expensive account space, allowing apps to scale to millions of users. | -| ----------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| **L1 security & performance** | Execution and data availability on Solana, preserving the performance and security guarantees of the L1. | -| **Composable** | Solana programs can mix and match between compressed and regular on-chain state, allowing atomic interaction with multiple programs, accounts, and compressed accounts. | -| **Custom ZK compute** | Leverage Light's on-chain contracts and plumbing, and tap into global, unified ZK-friendly state. | - -## ZK and Compression in a Nutshell: - -_**Compression**_**:** Only the [state roots](learn/core-concepts/state-trees.md) (small fingerprints of all [compressed accounts](learn/core-concepts/compressed-account-model.md)) are stored in on-chain accounts. The underlying data is stored on the cheaper Solana ledger. - -_**ZK**_**:** The protocol uses small zero-knowledge proofs (validity proofs) to ensure the integrity of the compressed state. This is all done under the hood. You can fetch validity proofs from [RPC providers](https://www.zkcompression.com/introduction/intro-to-development#rpc-connection) that support ZK Compression. - -## How to use this documentation - -This documentation provides a high-level introduction to Light Protocol and is a directory of resources for building with it. The in-depth developer documentation can be found at [https://www.zkcompression.com](https://www.zkcompression.com). - -{% hint style="info" %} -Light Protocol is being built in the [open](https://github.com/Lightprotocol/light-protocol), and Mainnet-Beta is live! Stay up-to-date on X with the teams contributing to ZK compression and its RPC implementation: [Light](https://twitter.com/LightProtocol) and [Helius](https://twitter.com/heliuslabs). -{% endhint %} diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md deleted file mode 100644 index 446dba8..0000000 --- a/docs/SUMMARY.md +++ /dev/null @@ -1,37 +0,0 @@ -# Table of contents - -## Introduction - -* [Overview](README.md) -* [ZK Compression](introduction/zk-compression.md) -* [🗓️ Event: Solana Zero Hackathon](introduction/event-solana-zero-hackathon.md) - -## Learn - -* [Core concepts](learn/core-concepts/README.md) - * [Compressed Account Model](learn/core-concepts/compressed-account-model.md) - * [State Trees](learn/core-concepts/state-trees.md) - * [Validity Proofs](learn/core-concepts/validity-proofs.md) - * [Lifecycle of a Transaction](learn/core-concepts/lifecycle-of-a-transaction.md) - * [Limitations](learn/core-concepts/limitations.md) -* [In a Nutshell](learn/in-a-nutshell.md) - -## Developers - -* [Advanced: Computing over Light State with custom ZKPs](developers/advanced-computing-over-light-state-with-custom-zkps.md) -* [Devnet Addresses](developers/devnet-addresses.md) - -## Release Notes - -* [1.0.0 Mainnet-Beta](release-notes/1.0.0-mainnet-beta.md) -* [0.6.0](developers/release-notes/0.6.0.md) -* [0.5.0](developers/release-notes/0.5.0.md) -* [0.4.0](developers/release-notes/0.4.0.md) -* [0.3.0](developers/release-notes/0.3.0.md) - -## resources - -* [Security](resources/security.md) -* [Privacy Policy](resources/privacy-policy.md) -* [Terms of Use](resources/terms-of-use.md) -* [Terms of Use - Website](resources/terms-of-use-website.md) diff --git a/docs/developers/advanced-computing-over-light-state-with-custom-zkps.md b/docs/developers/advanced-computing-over-light-state-with-custom-zkps.md deleted file mode 100644 index a0d4f5b..0000000 --- a/docs/developers/advanced-computing-over-light-state-with-custom-zkps.md +++ /dev/null @@ -1,11 +0,0 @@ -# Advanced: Computing over Light State with custom ZKPs - -{% hint style="info" %} -This is an advanced section; if you don't need custom off-chain compute for your application, you can safely disregard this section. -{% endhint %} - -If you want to use custom off-chain compute with compressed accounts, you need to verify a custom ZKP in your on-chain program. - -All state that is compressed via Light Protocol natively enables efficient computation via ZKPs. - -If you can describe or translate your computation into a groth16 circuit, you can run that computation over all Solana L1 state that was compressed via Light. This prevents state fragmentation while enabling previously impossible types of applications and computation designs on Solana. diff --git a/docs/developers/devnet-addresses.md b/docs/developers/devnet-addresses.md deleted file mode 100644 index 35df83e..0000000 --- a/docs/developers/devnet-addresses.md +++ /dev/null @@ -1,31 +0,0 @@ -# Devnet Addresses - -### Devnet URLs - -
Network Address (RPC)https://devnet.helius-rpc.com?api-key=<api_key>
Photon RPC APIhttps://devnet.helius-rpc.com?api-key=<api_key>
- -### zkTestnet URLs (deprecated) - -{% hint style="info" %} -Note: zkTestnet has been deprecated in favor of our **Solana Devnet** deployment. Please use the public Solana Devnet Cluster for further development -{% endhint %} - -
Network address (RPC)https://zk-testnet.helius.dev:8899 (deprecated)
Photon RPC APIhttps://zk-testnet.helius.dev:8784 (deprecated)
Proverhttps://zk-testnet.helius.dev:3001 (deprecated)
- -### Program IDs and Accounts (from 27th Aug 2024 onward) - -
Light System ProgramSySTEM1eSU2p4BGQfQpimFEWWSC1XDFeun3Nqzz3rT7
Compressed Token ProgramcTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m
Account Compression Programcompr6CUsB5m2jS4Y3831ztGSTnDpnKJTKS95d64XVq
Shared Public State Treesmt1NamzXdq4AMqS2fS2F1i5KTYPZRhoHgWx38d8WsT
Shared Public Nullifier Queuenfq1NvQDJ2GEgnS8zt9prAe8rjjpAW1zFkrvZoBR148
Shared Public Address Treeamt1Ayt45jfbdw5YSo7iz6WZxUmnZsQTYXy82hVwyC2
Shared Public Address Queueaq1S9z4reTSQAdgWHGD2zDaS39sjGrAxbR31vxJ2F4F
- -### Program IDs and Accounts (deprecated as of 27th Aug 2024) - -
Light System ProgramH5sFv8VwWmjxHYS2GB4fTDsK7uTtnRT4WiixtHrET3bN
Compressed Token ProgramHXVfQ44ATEi9WBKLSCCwM54KokdkzqXci9xCQ7ST9SYN
Account Compression ProgramCbjvJc1SNx1aav8tU49dJGHu8EUdzQJSMtkjDmV8miqK
Shared Public State Tree5bdFnXU47QjzGpzHfXnxcEi5WXyxzEAZzd1vrE39bf1W
Shared Public Nullifier Queue44J4oDXpjPAbzHCSc24q7NEiPekss4sAbLd8ka4gd9CZ
Shared Public Address TreeC83cpRN6oaafjNgMQJvaYgAz592EP5wunKvbokeTKPLn
Shared Public Address QueueHNjtNrjt6irUPYEgxhx2Vcs42koK9fxzm3aFLHVaaRWz
- -### Lookup Tables - -{% hint style="info" %} -[Lookup tables](https://solana.com/docs/advanced/lookup-tables) can be used with compressed accounts to reduce your transaction size. We provide a pre-initialized lookup table on Devnet that covers the Light's program IDs and accounts: -{% endhint %} - -
Default Lookup Table #1qAJZMgnQJ8G6vA3WRcjD9Jan1wtKkaCFWLWskxJrR5V
- -You can also create your own lookup tables. We provide a helper function that initializes your table with Light's default program IDs and accounts. We also have [the following guide on creating lookup tables](https://www.zkcompression.com/developers/typescript-client#creating-lookup-tables) in the TypeScript Client section. diff --git a/docs/developers/release-notes/0.3.0.md b/docs/developers/release-notes/0.3.0.md deleted file mode 100644 index d06d308..0000000 --- a/docs/developers/release-notes/0.3.0.md +++ /dev/null @@ -1,31 +0,0 @@ -# 0.3.0 - -The first pre-release is here! - -{% hint style="info" %} -_Note: It’s an alpha release, so bugs & breaking changes can occur. If you have questions, bugs, or feedback, check out the_ [_Helius_](https://discord.gg/Uzzf6a7zKr) _and_ [_Light_](https://discord.gg/CYvjBgzRFP) _Developer Discord for help, or message us directly via_ [_Telegram_](https://t.me/swen\_light) -{% endhint %} - -**You can find a list of all crates here:** - -{% embed url="https://github.com/Lightprotocol/light-protocol/releases/tag/light-v0.3.0" %} - -## Tooling - -* [Local Development + Token CLI](https://github.com/Lightprotocol/light-protocol/tree/main/cli) -* [ZK Compression RPC](https://github.com/helius-labs/photon) - -## Active Feature Set - -* **Compressed accounts** (no upfront rent) -* **Compressed-token program**. Create + mint (tested for up to 25x token mint batch, \~5000x cheaper than SPL-token mints) -* **Compress/decompress** SOL and tokens -* Rust-SDK -* Ts-sdk - -## Upcoming Changes - -* Support unique PDA address in typescript client -* End-to-end program example with a typescript anchor client -* Public Testnet -* Program-owned state tree support diff --git a/docs/developers/release-notes/0.4.0.md b/docs/developers/release-notes/0.4.0.md deleted file mode 100644 index 02ff9c9..0000000 --- a/docs/developers/release-notes/0.4.0.md +++ /dev/null @@ -1,26 +0,0 @@ -# 0.4.0 - -## ZK Testnet is Here! - -{% hint style="info" %} -_Note: It’s an alpha release, so bugs & breaking changes can occur. If you have questions, bugs, or feedback, check out the_ [_Helius_](https://discord.gg/Uzzf6a7zKr) _and_ [_Light_](https://discord.gg/CYvjBgzRFP) _Developer Discord for help. Or message us directly via_ [_Telegram_](https://t.me/swen\_light) -{% endhint %} - -Testnet details**, while currently deprecated,** are still visible in the [**Devnet Addresses section**](https://www.zkcompression.com/developers/devnet-addresses#zktestnet-urls-deprecated) - -**You can find a list of all crates here:** - -{% embed url="https://github.com/Lightprotocol/light-protocol/releases/tag/v0.4.0" %} - -### Tooling - -* [Local Development + Token CLI](https://github.com/Lightprotocol/light-protocol/tree/main/cli) -* [ZK Compression RPC](https://github.com/helius-labs/photon) - -### Active Feature Set - -* **Compressed accounts** (no upfront rent) -* **Compressed-token program**. Create + mint (tested for up to 25x token mint batch, \~5000x cheaper than SPL-token mints) -* **Compress/decompress** SOL and tokens -* **Ts-sdk**[\ - ](https://www.zkcompression.com/introduction/intro-to-development) diff --git a/docs/developers/release-notes/0.5.0.md b/docs/developers/release-notes/0.5.0.md deleted file mode 100644 index be53015..0000000 --- a/docs/developers/release-notes/0.5.0.md +++ /dev/null @@ -1,33 +0,0 @@ -# 0.5.0 - -## Solana Devnet is here! - -{% hint style="info" %} -_Note: It’s an alpha release, so bugs and breaking changes can occur. If you find bugs, have questions, or have feedback, check out the Helius and Light Developer Discord for help. You can also message us directly via_ [_Telegram_](https://t.me/swen\_light) -{% endhint %} - -This release includes various quality-of-life improvements, including for robustness and performance. - -You can find a detailed list of all changes here: - -{% embed url="https://github.com/Lightprotocol/light-protocol/releases/tag/v.0.5.0" %} - -## Migrating from zkTestnet - -1. The same `programIds` and account addresses as zkTestnet are used. The full details are listed in the [Devnet Addresses](../devnet-addresses.md) section -2. Airdrop yourself some Devnet SOL via the Solana CLI and deploy your program to the public Solana Devnet cluster -3. :tada: -4. If you have any issues migrating or deploying your program on Devnet, just [let us know](https://t.me/swen\_light)! - -### Tooling - -* [Development + Token CLI](https://github.com/Lightprotocol/light-protocol/tree/main/cli) -* [ZK Compression RPC](https://github.com/helius-labs/photon) (this is supported out-of-the-box via the CLI) - -### Active Feature set - -* **Compressed accounts** (no upfront rent) -* **Compressed-token program**. Create + mint (tested for up to 25x token mint batch, \~5000x cheaper than SPL-token mints) -* **Compress/decompress** PDA accounts and tokens -* **Ts-sdk** - diff --git a/docs/developers/release-notes/0.6.0.md b/docs/developers/release-notes/0.6.0.md deleted file mode 100644 index 5dc5ce1..0000000 --- a/docs/developers/release-notes/0.6.0.md +++ /dev/null @@ -1,26 +0,0 @@ -# 0.6.0 - -## A new release for Localnet and Devnet is here! - -{% hint style="info" %} -_Note: This is a beta release. If you find bugs, have questions, or have feedback, check out the Helius and Light Developer Discord for help. You can also message us directly via_ [_Telegram_](https://t.me/swen\_light)_._ -{% endhint %} - -This release includes various quality-of-life improvements, including for robustness and performance. - -### Breaking changes - -* **New program IDs**. The up-to-date list can be found [here](https://www.zkcompression.com/developers/devnet-addresses). -* **JS RPC client**: compressed account endpoints now get returned with a cursor that allows for proper pagination. therefore accounts must be accessed via `response.items.accounts` instead of `response.accounts`. - -You can find a detailed list of all changes here: - -{% embed url="https://github.com/Lightprotocol/light-protocol/releases/tag/v.0.6.0" %} - -### Upgrading from v0.5.0 - -* Redeploy your programs on devnet pointing to the [**new program IDs**](../devnet-addresses.md#program-ids-and-accounts-from-27th-aug-2024-onward). You may also need to update your JS client's use of `getCompressedAccounts` according to the breaking changes highlighted above. - -### Examples - -* We added a new simple name service program reference implementation! It uses the latest releases [**here**](https://github.com/Lightprotocol/light-protocol/tree/main/examples/name-service). diff --git a/docs/introduction/event-solana-zero-hackathon.md b/docs/introduction/event-solana-zero-hackathon.md deleted file mode 100644 index 7b2a3a7..0000000 --- a/docs/introduction/event-solana-zero-hackathon.md +++ /dev/null @@ -1,115 +0,0 @@ ---- -hidden: true ---- - -# 🗓️ Event: Solana Zero Hackathon - -
- -{% hint style="info" %} -Solana Zero is a dedicated side track for the [Solana Radar hackathon](https://www.colosseum.org/radar). -{% endhint %} - -## Submissions are now closed! - -1. Use ZK Compression in your hackathon project. -2. If you did submit your project here or via the link below by September 8th, you can score in Solana Zero! 🎉 - -{% embed url="https://earn.superteam.fun/listings/hackathon/solana-zero-hackathon/" %} - -### Schedule - -| Text | Start | End | -| ------------------------------------------------------------------------------------------------- | ----------- | ----------- | -| Global Hackathon | 02 Sep 2024 | 02 Oct 2024 | -| Submissions ([submit here](https://earn.superteam.fun/listings/hackathon/solana-zero-hackathon/)) | 02 Oct 2024 | 08 Oct 2024 | -| Judging | 08 Oct 2024 | 15 Oct 2024 | - -## Resources - -* [ZK Compression documentation](https://www.zkcompression.com/) -* [Example token-escrow program](https://github.com/Lightprotocol/light-protocol/tree/main/examples/token-escrow/programs/token-escrow/src/escrow\_with\_pda) -* [Discord chat for the hackathon](https://discord.com/invite/qCv4Y7uYmh) -* [Project ideas](https://github.com/Lightprotocol/zk-compression-summer-hackathon/blob/main/ideas.md) - -## Judging - -The Radar Hackathon's [submission rules](https://www.colosseum.org/\_app/immutable/assets/Solana%20Radar%20Hackathon%20Official%20Rules%202024.8c044e21.pdf) apply. To be eligible for the side track, participants must register in the project registration form shared above and submit their project to the Radar Hackathon before October 8, 2024. Once all submissions are collected, we will distribute a list to the side-track judges for evaluation. - -Teams and individuals are evaluated on the following criteria: - -* Functionality -* Potential impact -* Novelty -* Design -* Extensibility - -After the judges complete individual evaluations, they will discuss and choose the winners based on the project's weighted scores. - -## Side Track Prizes - -| Place | Prize | -| ---------------------------------------------------------------------------- | -------------------------- | -| First Place | 1 winner up to $20k + Swag | -| Second Place | 1 team of $10k + Swag | -| Third Place | 2 teams of $5k each + Swag | -| All participants who submit a project that fulfills the eligibility criteria | $100 | - -{% hint style="info" %} -All winners will also receive personal help with VC intros and Go-to-Market strategy from [Mert](https://x.com/0xMert\_)! -{% endhint %} - -## FAQ - -
- -How do I submit? - -1. Submit your project [here](https://earn.superteam.fun/listings/hackathon/solana-zero-hackathon/) by October 08. - -
- -
- -What are the rules? - -The [Solana Foundation Rules](https://www.colosseum.org/\_app/immutable/assets/Solana%20Radar%20Hackathon%20Official%20Rules%202024.8c044e21.pdf) apply. - -Additionally, to be eligible to score in Solana Zero, your project must: - -* Use compressed tokens or compressed accounts in some capacity. -* Be submitted by October 8, 2024. -* Each participant can have a maximum of 1 project submission count towards scoring in the Solana Zero side track. -* Please note that the $100 participation bounty is awarded at our sole discretion, particularly as a measure to prevent Sybil attacks. - -
- -
- -Where can i access developer resources? - -* [ZK Compression documentation](zk-compression.md) -* [Light Protocol Monorepo](https://github.com/lightprotocol/light-protocol) -* [Example programs](https://github.com/Lightprotocol/light-protocol/tree/main/examples) -* Example clients ([web](https://github.com/Lightprotocol/example-web-client), [node](https://github.com/Lightprotocol/example-nodejs-client)) -* Introductory [Blog](https://www.helius.dev/blog/solana-builders-zk-compression) posts - -
- -
- -Where can I find ideas? - -We encourage you to build things that you're excited about building. - -For inspiration, we have compiled a list of interesting ideas [here](https://github.com/Lightprotocol/zk-compression-summer-hackathon/tree/main?tab=readme-ov-file). - -
- -
- -Where can I ask technical questions? - -1. Check out the [Light](https://discord.gg/CYvjBgzRFP) and [Helius](https://discord.gg/Uzzf6a7zKr) Developer Discord servers! - -
diff --git a/docs/introduction/zk-compression.md b/docs/introduction/zk-compression.md deleted file mode 100644 index e15a683..0000000 --- a/docs/introduction/zk-compression.md +++ /dev/null @@ -1,45 +0,0 @@ -# ZK Compression - -Light's core primitive is **ZK Compression**. This section is a directory guiding you to the relevant codebases, examples, and advanced guides. - -{% hint style="info" %} -We're hosting in-depth documentation and guides at [zkcompression.com](https://www.zkcompression.com) with the Helius team. -{% endhint %} - -### 1. Learn - -Explore our core concepts and get an overview of the protocol to understand the fundamentals of ZK Compression. - -{% embed url="https://www.zkcompression.com/learn/in-a-nutshell" %} - -### 2. Intro to development - -This guide has everything you need to know to start developing with ZK Compression on Solana. - -{% embed url="https://www.zkcompression.com/introduction/intro-to-development" %} - -### 3. TypeScript Client - -Our TypeScript library provides the tools you need to interact with ZK Compression using the JSON RPC API. - -{% embed url="https://www.zkcompression.com/developers/typescript-client" %} - -### 4. Wallet Integration for Compressed Tokens - -This section walks you through how to add compressed token support to your browser extension wallet. - -{% embed url="https://www.zkcompression.com/developers/add-compressed-token-support-to-your-wallet" %} - -### 5. JSON RPC Methods - -These pages outline all ZK Compression methods extending Solana's [default JSON RPC API](https://solana.com/docs/rpc). Helius Labs maintains the [canonical RPC API and indexer implementation](https://github.com/helius-labs/photon). - -{% embed url="https://www.zkcompression.com/developers/json-rpc-methods" %} - -### 6. Run a Node for ZK Compression - -This section covers setting up a node for development on public Networks. For public networks (i.e., Devnet, Mainnet-Beta), you can either work with an RPC infrastructure provider that supports ZK Compression, such as [Helius Labs](https://helius.xyz/), or run your own nodes (Photon RPC, Prover, or Forester). - -{% embed url="https://www.zkcompression.com/node-operators/run-a-node" %} -_Becoming an operator for any node type is permissionless._ -{% endembed %} diff --git a/docs/learn/core-concepts/README.md b/docs/learn/core-concepts/README.md deleted file mode 100644 index b13709d..0000000 --- a/docs/learn/core-concepts/README.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -hidden: true ---- - -# Core concepts - -Light Protocol's core primitive ZK Compression drastically reduces on-chain state costs while maintaining security, composability, and performance. ZK Compression allows developers to efficiently scale their applications to millions of users with the help of zero-knowledge proofs. - -In the following sections, we'll dive into the core concepts that make ZK Compression possible: - -* **Compressed Account Model**: Understand how compressed accounts differ from regular Solana accounts (not much!) and how they enhance efficiency. -* **State Trees**: Learn about the Merkle tree structure used to store compressed accounts and how it minimizes on-chain storage. -* **Validity Proofs**: Explore how the protocol uses zero-knowledge proofs to verify data validity while keeping proof sizes small. -* **Lifecycle of a Transaction**: Follow the journey of a ZK-compressed transaction from creation to execution. -* **Limitations and Considerations**: Discover the trade-offs and scenarios where ZK Compression may or may not be the best solution. - diff --git a/docs/learn/core-concepts/compressed-account-model.md b/docs/learn/core-concepts/compressed-account-model.md deleted file mode 100644 index 01dae51..0000000 --- a/docs/learn/core-concepts/compressed-account-model.md +++ /dev/null @@ -1,48 +0,0 @@ -# Compressed Account Model - -{% hint style="info" %} -This guide assumes that you're familiar with [Solana's account model](https://solana.com/docs/core/accounts). -{% endhint %} - -## Regular versus Compressed Accounts - -ZK compressed state is stored in compressed accounts. Compressed accounts are similar to regular Solana accounts but with four main differences: - -* Each compressed account can be identified by its hash -* Each write to a compressed account changes its hash -* An `address` can optionally be set as a permanent unique ID of the compressed account -* All compressed accounts are stored in [sparse state trees](state-trees.md). Only the tree's state root (i.e., a small fingerprint of all compressed accounts) is stored in the on-chain account space - -These differences allow the protocol to store states as calldata in the less expensive Solana ledger space instead of costly on-chain account space - -To understand the similarities and differences between Solana's regular account model and compressed accounts, let's first look at compressed accounts with Program-Derived Addresses (PDAs) - -> If you don't know what PDAs are, read [this explainer](https://solana.com/docs/core/pda) first - -## Compressed PDA Accounts - -Like regular accounts, each compressed PDA account can be identified by its unique persistent address, represented as 32 bytes in the format of a `PublicKey`. Like PDAs, compressed account addresses don't belong to a private key; rather, they're derived from the program that owns them - -

Compressed PDA Accounts

- -The compressed PDA account layout is similar to Solana's regular PDA account layout — it has the **Data**, **Lamports**, **Owner**, and **Address** fields. The **Data** field stores the program state. Notice the enshrined **AccountData** structure: **Discriminator**, **Data**, **DataHash**: - -

Compressed PDA Account with AccountData

- -The [Anchor](https://www.anchor-lang.com/) framework reserves the first 8 bytes of a regular account's data field for the discriminator. This helps programs distinguish between different program-owned accounts. The default compressed account layout is opinionated in this regard and enforces a discriminator in the Data field. You can ignore the **DataHash** field for now; we cover its importance for ZK Compression later. - -### Address & Hash - -The `address` field is optional for compressed accounts because ensuring that the address of a new account is unique incurs additional computational overhead, and not all use cases need the uniqueness property of addresses - -Instead, each compressed account can be identified by its hash, regardless of whether it has an address - -{% hint style="info" %} -* Use the address field wherever the state must be unique (such as for NFTs or certain PDAs) -* You don't need the address for any fungible state (e.g., fungible tokens) -{% endhint %} - -By definition, whenever the data of a compressed account changes, its hash changes. This impacts how developers interact with fungible state: - -* Check out the [examples](https://www.zkcompression.com/introduction/intro-to-development#build-by-example) section in the ZK Compression documentation to see what using hashes instead of addresses looks like in practice -* Visit the [State Trees](state-trees.md) section to understand why using the account's hash as its ID makes sense for the compression protocol diff --git a/docs/learn/core-concepts/lifecycle-of-a-transaction.md b/docs/learn/core-concepts/lifecycle-of-a-transaction.md deleted file mode 100644 index 6559e67..0000000 --- a/docs/learn/core-concepts/lifecycle-of-a-transaction.md +++ /dev/null @@ -1,35 +0,0 @@ -# Lifecycle of a Transaction - -ZK Compression transactions are fully compatible with Solana's Transaction and VersionedTransaction. There are three key nuances in building transactions with compressed accounts as compared to regular accounts: - -* Instructions must specify the list of all compressed accounts being read or written to. To read or write to a compressed account, the instruction must send the current account state on-chain and prove its validity. -* Each unique state tree that gets read or written to (via any compressed account) needs to be specified as per Solana's regular on-chain [account access lists](https://solana.com/docs/core/transactions#array-of-account-addresses). -* To read any compressed account state on-chain, the client must send a validity proof alongside the instruction data to the chain. Depending on your program logic, the validity proof can prove A) the validity of all specified read accounts and B) the non-existence of a specified PDA within the compressed address space, e.g., for creating a new compressed PDA account. - -We can express a transaction more generally as: - -`(state, validityProof) -> state transition -> state'` - -Here's what this looks like when updating a single compressed PDA account: - -

Simplified: Read and Write compressed accounts

- -In this example, we assume that the client previously created said compressed account and thereafter fetched its compressed account info from an [RPC node](broken-reference). - -The custom Solana program executing the state transition Data -> Data' should require its client to pack the instructions efficiently. In the above scenario, the total data that's sent to the chain is: `address (same)`, `owner program (same)`, `data`, `data'-data`, `validity proof.` - -The compressed account after its update looks like this: - -

Full representation of a compressed account with PDA

- -## On-chain Protocol Execution - -To write compressed state, a custom caller program must invoke the Light System Program via CPI. The system program then does the following: - -1. Runs relevant checks ([sum check](https://github.com/Lightprotocol/light-protocol/blob/main/programs/system/src/invoke/processor.rs#L64-L70), etc.) -2. [Verifies the validity proof](https://github.com/Lightprotocol/light-protocol/blob/main/programs/system/src/invoke/verify\_state\_proof.rs#L184-L190) -3. [Nullifies](https://github.com/Lightprotocol/light-protocol/blob/main/programs/system/src/invoke/processor.rs#L203-L208) the "old" leaf of the compressed account that is being written to -4. [Appends](https://github.com/Lightprotocol/light-protocol/blob/main/programs/system/src/invoke/processor.rs#L240-L249) the new compressed account hash to the state tree and advances the tree's state root -5. [Emits](https://github.com/Lightprotocol/light-protocol/blob/main/programs/system/src/invoke/processor.rs#L269-L276) the new "raw" compressed account state onto the Solana ledger - -An[ RPC node](https://www.zkcompression.com/node-operators/run-a-node#photon-indexer-node) then parses the transaction and compressed state and provides the read state to clients via the [ZK Compression RPC API](https://www.zkcompression.com/developers/json-rpc-methods) diff --git a/docs/learn/core-concepts/limitations.md b/docs/learn/core-concepts/limitations.md deleted file mode 100644 index 95a6c56..0000000 --- a/docs/learn/core-concepts/limitations.md +++ /dev/null @@ -1,62 +0,0 @@ -# Limitations - -Before using ZK Compression to scale your application state, consider the following limitations of compressed accounts: - -* [Larger Transaction Size](limitations.md#larger-transaction-size) -* [High Compute Unit Usage](limitations.md#high-compute-unit-usage) -* [Per-Transaction State Cost](limitations.md#state-cost-per-transaction) - -## General Recommendation - -{% hint style="info" %} -Consider which accounts in your application benefit from ZK Compression and which don't. You can use both types for different parts of your application! -{% endhint %} - -It may be preferred for an account _not_ to be permanently compressed if: - -* The account gets updated very frequently within a single block (e.g., shared liquidity pools in a DeFi protocol). -* You expect the lifetime number of writes to the same account to be very large (>>1000x). -* The account stores large amounts of data, and you need to access a large part of it (>1kb) inside one on-chain transaction. - -## **Larger Transaction Size** - -Solana's transaction size limit is 1232 Bytes. Transactions exceeding this limit will fail. ZK Compression increases your transaction size in two ways: - -* 128 bytes must be reserved for the validity proof, which is a constant size per transaction, assuming the transaction reads from at least one compressed account. -* You must send the account data you want to read/write on-chain. - -## **High Compute Unit Usage** - -{% hint style="info" %} -System CU usage: - -* \~100,000 CU for validity proof verification, which is a constant size per transaction, assuming the transaction reads from at least one compressed account -* \~100,000 CU system use (state tree [Poseidon](https://eprint.iacr.org/2019/458.pdf) hashing et al.) -* \~6,000 CU per compressed account read/write - -**Example**: a typical compressed token transfer uses around 292,000 CU. -{% endhint %} - -Higher CU usage can: - -* **Lead to usage limits:** The total CU limit per transaction is 1,400,000 CU, and the per-block write lock limit per State tree is 12,000,000 CU. -* **Require your users to increase their** [**priority fee**](https://solana.com/developers/guides/advanced/how-to-use-priority-fees) **during congestion:** Whenever Solana's global per-block CU limit (48,000,000 CU) is reached, validator clients may prioritize transactions with higher per-CU priority fees. - -## State Cost Per Transaction - -Each write operation incurs a small additional network cost. If you expect a single compressed account to amass a large amount of state updates, the lifetime cost of the compressed account may be higher than its uncompressed equivalent, which currently has a fixed per-byte rent cost at creation. - -{% hint style="info" %} -Whenever a [transaction](lifecycle-of-a-transaction.md) writes to a compressed account, it nullifies the previous compressed account state and appends the new compressed account as a leaf to the state tree. Both of these actions incur costs that add to Solana's base fee. -{% endhint %} - -
TypeLamportsNotes
Solana base fee5000 per signatureCompensates validators for processing transactions
Write new compressed account state ~300 per leaf (default)Depends on tree depth:
\left( 2^{\text{tree\_depth}} \times \text{tree\_account\_rent\_cost} \times \text{rollover\_threshold} \right)
~300 for the default depth of 26
Nullify old compressed account state5000 per transactionReimburses the cost of running a Forester transaction. The current default Forester node implementation can be found here
Create addresses5000 per transactionSame as nullify
- -## Next Steps - -Now you're familiar with the core concepts of ZK Compression, you're ready to take the next step! Dive into [building a program](https://www.zkcompression.com/introduction/intro-to-development#on-chain-program-development) or [application](https://www.zkcompression.com/introduction/intro-to-development#client-side-development) with ZK Compression, or learn how to [set up and run your own node](https://www.zkcompression.com/node-operators/run-a-node).\ -\ -For those interested in learning more about the fundamentals of ZK and its applications on Solana, we recommend reading the following: - -* [Zero-Knowledge Proofs: An Introduction to the Fundamentals](https://www.helius.dev/blog/zero-knowledge-proofs-an-introduction-to-the-fundamentals) -* [Zero-Knowledge Proofs: Its Applications on Solana](https://www.helius.dev/blog/zero-knowledge-proofs-its-applications-on-solana) diff --git a/docs/learn/core-concepts/state-trees.md b/docs/learn/core-concepts/state-trees.md deleted file mode 100644 index 8ba4124..0000000 --- a/docs/learn/core-concepts/state-trees.md +++ /dev/null @@ -1,17 +0,0 @@ -# State Trees - -The protocol stores compressed state in multiple state trees. - -{% hint style="info" %} -A state tree is a binary [Merkle tree](https://brilliant.org/wiki/merkle-tree/) that organizes data into a tree structure where each parent node is the hash of its two children nodes. This leads to a single unique root hash that allows for efficient cryptographic verification of the integrity of all the nodes, also referred to as leaves, in the tree. -{% endhint %} - -

A small binary Merkle tree (depth 2)

- -The hash of each [compressed account](compressed-account-model.md) is stored as a leaf in such a state tree: - -

Each compressed account hash is a leaf in the state tree

- -Note that each compressed account hash includes the public key of the state tree's respective on-chain account (i.e., `state tree hash`) and the compressed account's position in the tree (i.e., `leafIndex`). This ensures that each account hash is globally unique - -Each state tree has a corresponding on-chain state tree account that stores only the tree's final root hash and other metadata. Storing the final tree root hash on-chain allows the protocol to efficiently verify the validity of any leaf (compressed account) in the tree. The raw state can thus be stored as calldata in the much cheaper Solana ledger space while preserving the security guarantees of Solana. diff --git a/docs/learn/core-concepts/validity-proofs.md b/docs/learn/core-concepts/validity-proofs.md deleted file mode 100644 index 7738390..0000000 --- a/docs/learn/core-concepts/validity-proofs.md +++ /dev/null @@ -1,7 +0,0 @@ -# Validity Proofs - -Validity proofs are succinct zero-knowledge proofs (ZKPs) that can prove the existence of compressed accounts as leaves within state trees while maintaining a constant 128-byte size. These proofs are generated off-chain and verified on-chain, reducing Solana's overall computational burden. Note that ZK Compression uses [Groth16](https://docs.rs/groth16-solana/latest/groth16\_solana/), a renowned [pairing-based](https://en.wikipedia.org/wiki/Pairing-based\_cryptography) [zk-SNARK](https://www.helius.dev/blog/zero-knowledge-proofs-its-applications-on-solana#-zk-snarks-and-circuits), for its prover system - -

A Merkle proof path (purple nodes) consists of all sibling node hashes required to calculate the final root node.

- -The protocol leverages ZKP generation and verification under the hood, so you don't have to learn about ZK directly to use ZK Compression diff --git a/docs/learn/in-a-nutshell.md b/docs/learn/in-a-nutshell.md deleted file mode 100644 index 9aaea97..0000000 --- a/docs/learn/in-a-nutshell.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -description: This page provides a high-level overview of the Light Protocol architecture. ---- - -# In a Nutshell - -## High-level System Overview - -1. **State is stored as call data in** [**Solana's ledger**](https://www.helius.dev/blog/all-you-need-to-know-about-compression-on-solana#state-vs-ledger)**,** resulting in no rent cost -2. **Transaction Specify State:** Transactions define the state they access (read/write) and include it in the transaction payload -3. **State Validation:** - 1. Solana Programs [invoke](https://solana.com/docs/core/cpi) the [Light Protocol System Program](../developers/devnet-addresses.md#program-ids-and-accounts-from-27th-aug-2024-onward) to update compressed state - 1. **The protocol** [**validates**](core-concepts/validity-proofs.md) **the state** (validity of read state, sum checks, ownership checks) - 2. **The protocol enforces a schema:** Classic Accounts → Compressed Accounts. [Compressed accounts](core-concepts/compressed-account-model.md) have a layout similar to classic accounts -4. **State Updates:** At the end of a transaction, the new state is recorded as a log on the ledger -5. [**Photon RPC Nodes**](https://www.zkcompression.com/node-operators/run-a-node#photon-rpc-node)**:** These nodes index and persist the logs, making the compressed account state available to clients via the [ZK Compression RPC API](https://www.zkcompression.com/developers/json-rpc-methods) -6. **Forester nodes (cranks)**: Interact with the [Account Compression Program](../developers/devnet-addresses.md#program-ids-and-accounts-from-27th-aug-2024-onward) to empty queues, and roll-over trees, where compressed state is stored. diff --git a/docs/overview/core-concepts.md b/docs/overview/core-concepts.md deleted file mode 100644 index 17c5cd1..0000000 --- a/docs/overview/core-concepts.md +++ /dev/null @@ -1,2 +0,0 @@ -# Core concepts - diff --git a/docs/release-notes/1.0.0-mainnet-beta.md b/docs/release-notes/1.0.0-mainnet-beta.md deleted file mode 100644 index eb72a91..0000000 --- a/docs/release-notes/1.0.0-mainnet-beta.md +++ /dev/null @@ -1,9 +0,0 @@ -# 1.0.0 Mainnet-Beta - -This is a program and program-dependencies release. You can expect a stable API for those and deploy custom programs using ZK Compression in production. - -_Please note: Our SDK implementations (JS client SDKs and rust-SDK) continue to be v0 and are unaudited._ - -You can find a detailed list of all changes here: - -{% embed url="https://github.com/Lightprotocol/light-protocol/releases/tag/v.1.0.0" %} diff --git a/docs/resources/privacy-policy.md b/docs/resources/privacy-policy.md deleted file mode 100644 index 0697c36..0000000 --- a/docs/resources/privacy-policy.md +++ /dev/null @@ -1,207 +0,0 @@ ---- -description: 'Last updated: September 13, 2024.' -noRobotsIndex: true ---- - -# Privacy Policy - -1\. PURPOSE OF THIS DOCUMENT - -1.1. This privacy policy ("Privacy Policy") describes how Light Protocol Labs ("Light Protocol," "we," "us," or "our") collects, uses, and shares information about you. This Privacy Policy applies whenever you use [https://docs.lightprotocol.com](https://docs.lightprotocol.com/) (the "Website" or “Service”), contact our support team, interact with us on social media, or engage with us in any other manner. - -1.2. We do not collect, use, and share information about you when using [https://lightprotocol.com](https://lightprotocol.com). - -1.3. We may update this Privacy Policy from time to time and therefore encourage you to review this Privacy Policy frequently. If any changes are made, we will update the revision date at the top of this policy, and in certain cases, we may provide additional notice (such as posting a notice on our Website or sending a notification). - -1.4. For any matters, relating to data protection you may contact in writing by e-mail [friends@lightprotocol.com](mailto:friends@lightprotocol.com). - - - -2\. CONTENTS - -COLLECTING OF INFORMATION\ -USE OF INFORMATION\ -RETENTION OF INFORMATION\ -YOUR RIGHTS\ -DISCLOSURE OF DATA\ -TRANSFERS OF INFORMATION\ -DATA SECURITY AND LIABILITY\ -MINORS PRIVACY\ -LINKS TO OTHER WEBSITES\ -YOUR CALIFORNIA PRIVACY RIGHTS\ -ADDITIONAL DISCLOSURES FOR INDIVIDUALS IN EUROPE\ -CONTACT - - - -3\. COLLECTING OF INFORMATION - -3.1. We collect personal information you provide directly to us. - -3.2. We collect data about how you access and interact with our Website including information about the device and network you use, such as your hardware model, operating system version, browser type, IP address, mobile network, and unique device identifiers. Additionally, we track your activity on the Website, such as access times, pages viewed, links clicked, and the page that directed you to our Website. - -3.3. When accessing the Website via a mobile device, we may also gather information like your device ID, mobile browser type, and operating system. Usage data is collected automatically and includes diagnostic details such as the time spent on each page and other related metrics. - -3.4. With your device’s permissions, we may collect precise location data. You can disable the collection of this information at any time by adjusting your device settings. - -3.5. We use cookies and similar tracking technologies to gather information about your usage of our Website. Cookies are small data files stored on your device that help us enhance your experience, track popular features, and monitor visits. You may instruct Your browser to refuse all Cookies or to indicate when a Cookie is being sent. If you refuse Cookies, you may not be able to use some parts of our Service. - - - -4\. USE OF INFORMATION - -4.1. We use the information collected to provide, maintain, and improve our products, services, and Website. Additionally, we use the data to personalize your experience, respond to customer inquiries, and provide technical notices, security alerts, and support messages. - -4.2. Our use of the information extends to: - -4.2.1. Monitoring and analyzing trends, usage, and activities related to our Website. - -4.2.2. Detecting, investigating, and preventing fraudulent, illegal, or malicious activity to protect the rights and property of our company and others. - -4.2.3. Debugging and identifying errors in our Website. - -4.2.4. Fulfilling legal and financial obligations. - -4.2.5. We may also use the information for additional purposes described to you at the time the data was collected or for purposes like data analysis, identifying trends, and improving our services. - - - -5\. RETENTION OF INFORMATION - -5.1. We will retain your information only as long as necessary for the purposes outlined in this Privacy Policy and ay retain Usage Data for security improvements or legal obligations. - -5.2. We expect to delete your information (at the latest) once there is no longer any legal or regulatory requirement or legitimate business purpose. - - - -6\. YOUR RIGHTS - -You have certain data protection rights, including the right to: - -6.1. request access to, update, or delete your personal data, and manage your information directly within the Service. - -6.2. to correct incomplete or inaccurate data and request the restriction of processing in certain situations. - -6.3. to obtain information on how and why your personal data is processed. - -6.4. request that we stop processing your personal data and withdraw consent to direct marketing at any time. - -6.5. **the** right to be notified of any data breach that may affect your rights and freedoms. - -6.6. request the deletion of your personal data in specific circumstances, such as when it's no longer necessary for the original purpose (right to be forgotten). - - - -7\. DISCLOSURE OF DATA - -7.1. We may disclose your Data: - -7.1.1. in connection with business transactions. - -7.1.2. to comply with legal obligations, if we believe that disclosure is in accordance with, or required by, any applicable law or legal process, including lawful requests by public authorities to meet national security or law enforcement requirements - -7.1.3. if we believe that your actions are inconsistent with our user agreements or policies, if we believe that you have violated the law, or if we believe it is necessary to protect the rights, property, and safety of Light Protocol, our users, the public, or others. - -7.1.4. to protect the rights, property, or safety of the Company, Service, or users. - - - -8\. TRANSFERS OF INFORMATION - -8.1. Your information, including Personal Data, is processed at the Company's operating offices and in any other places where the parties involved in the processing are located. It means that this information may be transferred to — and maintained on — computers located outside of Your state, province, country or other governmental jurisdiction where the data protection laws may differ than those from Your jurisdiction - -8.2. Your consent to this Privacy Policy followed by your submission of such information represents your agreement to that transfer - -8.3. The Company will take all steps reasonably necessary to ensure that your data is treated securely and in accordance with this Privacy Policy and no transfer of your Personal Data will take place to an organization or a country unless there are adequate controls in place including the security of your data and other personal information. - - - -9\. DATA SECURITY AND LIABILITY - -9.1. We implement robust technical and organizational measures to safeguard your personal data from unauthorized access, manipulation, loss, or exposure. These security protocols are regularly updated and enhanced in line with evolving technological standards. - -9.2. Please be aware that transmitting data over the internet (e.g., through email communications) is not always completely secure, and we cannot be held responsible for any data shared with us via these methods. While we strive to protect your information, absolute security cannot be guaranteed. - -9.3. This privacy policy does not extend to third-party websites or any external links provided on our platform. We disclaim any responsibility or liability for the content or data protection practices of third-party websites. - - - -10\. MINORS PRIVACY - -10.1. Our Service does not address anyone under 18, and we do not knowingly collect information from minors. - -10.2. If you are a parent and aware that your minors has provided Personal Data, please contact Us. - -10.3. If We become aware that We have collected Personal Data from anyone under the age of 18 without verification of parental consent, We take steps to remove that information from Our servers. - - - -11\. LINKS TO OTHER WEBSITES - -11.1. Our Service may contain links to third-party websites that are not operated by us. - -11.2. We advise you to review the Privacy Policy of every site you visit. We have no control over and no responsibility for the content, privacy policies or practices of any third party sites or services. - - - -12\. YOUR CALIFORNIA PRIVACY RIGHTS - -12.1. This section applies to you, if you are a California Resident. - -12.2. The California Consumer Privacy Act or "CCPA" (California Consumer Privacy Act of 2018) affords consumers residing in California additional rights with respect to their personal information. - -12.3. You have the right to inform you of (i) the categories of personal information we have collected about you over the past 12 months; (ii) the specific pieces of personal information we collect, use, and disclose about you; (iii) the categories of sources from which we collected your personal information; (iv) The categories of third parties to whom your personal information was disclosed; (v) the purposes for collecting your personal information; (vi) request deletion of your personal information, and (vii) not be discriminated against for exercising these rights. You may make these requests by contacting us at [friends@lightprotocol.com](mailto:friends@lightprotocol.com). Please note that these rights may be subject to limitations as outlined by applicable laws. In certain cases, we may need to deny your request in order to comply with our legal obligations or protect our rights. - -12.4. Light Protocol does not sell your personal information. - -12.5. We will not discriminate against you if you exercise your rights under the CCPA. - - - -13\. ADDITIONAL DISCLOSURES FOR INDIVIDUALS IN EUROPE - -13.1. If you are located in the European Economic Area ("EEA"), the United Kingdom, or Switzerland, you have certain rights and protections under the law regarding the processing of your personal data, and this section applies to you. - - - -13.2. Legal Basis for Processing - -13.2.1. When we process your personal data, we will do so in reliance on the following lawful bases: To perform our responsibilities under our contract with you (e.g., processing payments for and providing the products and services you requested). - -13.2.2. When we have a legitimate interest in processing your personal data to operate our business or protect our interests (e.g., to provide, maintain, and improve our products and services, conduct data analytics, and communicate with you). - -13.2.3. To comply with our legal obligations (e.g., to maintain a record of your consents and track those who have opted out of communications). - -13.2.4. When we have your consent to do so (e.g., when you opt in to receive communications from us). - -13.2.5. When consent is the legal basis for our processing your personal data, you may withdraw such consent at any time. - - - -13.3. DATA RETENTION - -We store other personal data for as long as necessary to carry out the purposes for which we originally collected it and for other legitimate business purposes, including to meet our legal, regulatory, or other compliance obligations. - - - -13.4. DATA SUBJECT REQUESTS - -Subject to certain limitations, you have the right to request access to the personal data we hold about you and to receive your data in a portable format, the right to ask that your personal data be corrected or erased, and the right to object to, or request that we restrict, certain processing. If you would like to exercise any of these rights, please contact us at [friends@lightprotocol.com](mailto:friends@lightprotocol.com). - - - -13.5. QUESTIONS OR COMPLAINTS - -Where we are not able to rectify a concern about our processing of personal data you have the right to lodge a complaint with the data protection authority of your place of residence. You can contact your Data Protection Authority using your respective link below: - -· EEA residents: [https://edpb.europa.eu/about-edpb/board/members\_en](https://edpb.europa.eu/about-edpb/board/members\_en) - -· UK residents: [https://ico.org.uk/global/contact-us/](https://ico.org.uk/global/contact-us/) - -· Switzerland residents: [https://www.edoeb.admin.ch/edoeb/en/home/the-fdpic/contact.html](https://www.edoeb.admin.ch/edoeb/en/home/the-fdpic/contact.html) - - - -14\. CONTACT - -If you have any questions about this Privacy Policy, You can contact us at email [friends@lightprotocol.com](mailto:friends@lightprotocol.com) referencing “Data Protection Enquiry". diff --git a/docs/resources/security.md b/docs/resources/security.md deleted file mode 100644 index 02fdd5c..0000000 --- a/docs/resources/security.md +++ /dev/null @@ -1,24 +0,0 @@ -# Security - -### Bug Bounty - -Light Protocol is hosting a [bug bounty program](https://immunefi.com/bug-bounty/light-protocol/information/) in cooperation with Immunefi. - -### Security Audits - -The Light protocol programs were audited by independent security firms Neodyme, OtterSec, and Zellic. - -* Zellic audit report (September '24, to be published) -* [Neodyme audit report](https://github.com/Lightprotocol/light-protocol/blob/main/audits/neodyme\_v1\_audit.pdf) (August '24) -* [OtterSec audit report](https://github.com/Lightprotocol/light-protocol/blob/main/audits/ottersec\_v1\_audit.pdf) (July '24) - -### Groth16 Circuit Security - -The ZK Compression circuit was formally verified by Reilabs. See our report [here](https://github.com/Lightprotocol/light-protocol/blob/main/audits/reilabs\_circuits\_formal\_verification\_report.pdf). - -You can find all information about the Trusted Setup Ceremony for the groth16 circuit [here](https://github.com/Lightprotocol/gnark-mt-setup/blob/main/README.md). - -{% hint style="info" %} -**For additional information on Light Protocol's security policy, read** [**here**](https://github.com/Lightprotocol/light-protocol/blob/main/SECURITY.md)**.** -{% endhint %} - diff --git a/docs/resources/terms-of-use-website.md b/docs/resources/terms-of-use-website.md deleted file mode 100644 index 831b90c..0000000 --- a/docs/resources/terms-of-use-website.md +++ /dev/null @@ -1,441 +0,0 @@ ---- -description: 'Last updated: September 13, 2024' -hidden: true ---- - -# Terms of Use - Website - - - -1\. SCOPE - -1.1. These Terms govern the use of Light Protocol Websites, and, any other related Agreement or legal relationship with the Owner in a legally binding way. The terms of use for the Protocol are set forth here. Capitalized words are defined in the relevant dedicated section of this document. - -1.2. The User must read this document carefully and keep a copy of them for reference. Some provisions in these Terms may only apply to certain categories of Users. - -1.3. BY ACCESSING OR USING THE SERVICE, YOU AGREE THAT YOU HAVE READ, UNDERSTOOD, AND AGREE TO BE BOUND BY THE EULA. IF YOU DO NOT AGREE, PLEASE DO NOT USE THE SERVICE OR SITE. - -1.4. “Light Protocol Websites” is provided by Light Protocol Labs, which can be contacted via Owner contact email: [friends@lightprotocol.com](mailto:friends@lightprotocol.com). - -1.5. "Light Protocol Websites" refers to this website, including its subdomains and any other website through which the Owner makes its Service available; the Application Program Interfaces (API); the Service; any applications, sample and content files, source code, scripts, instruction sets or software included as part of the Service, as well as any related documentation. - -1.6. Unless otherwise specified, the terms of use detailed in this section apply generally when using Light Protocol Websites. - -1.7. Single or additional conditions of use or access may apply in specific scenarios and in such cases are additionally indicated within this document. - -1.8. By using Light Protocol Websites, Users confirm to meet the following requirements: - -1.8.1. There are no restrictions for Users in terms of being Consumers or Business Users; - -1.8.2. Users must be recognized as adult by applicable law; - -1.8.3. Minors may only use Light Protocol Websites under parental or adult supervision; - -1.8.4. Users aren’t located in a country that is subject to a U.S. government embargo, or that has been designated by the U.S. government as a “terrorist-supporting” country; - -1.8.5. Users aren’t listed on any U.S. government list of prohibited or restricted parties; - - - -2\. What the User should know at a glance - -2.1. We grant you permission to download the protocol and use it for your own purposes. However, your use of the Protocol is entirely at your own risk. You are solely responsible for deciding how to use and implement the Protocol and we have no control over and assume no responsibility for your use. We accept no liability for any losses that may arise in connection with your use of the Protocol. - -2.2. Please note that In particular, certain provisions may only apply to Consumers or to those Users that do not qualify as Consumers. Such limitations are always explicitly mentioned within each affected clause. In the absence of any such mention, clauses apply to all Users. - -2.3. Usage of Light Protocol Websites and the Service is age restricted: to access and use Light Protocol Websites and its - -2.4. Service the User must be an adult under applicable law. - -2.5. Minors may access Light Protocol Websites and use its Service only under parental or adult supervision. - - - -TERMS OF USE - -3\. Content on [Light Protocol Websites](http://www.lightprotocol.com/) - -3.1. Unless where otherwise specified or clearly recognizable, all content available on Light Protocol Websites is owned or provided by the Owner or its licensors. - -3.2. The Owner undertakes its utmost effort to ensure that the content provided on Light Protocol Websites infringes no applicable legal provisions or third-party rights. However, it may not always be possible to achieve such a result. In such cases, without prejudice to any legal prerogatives of Users to enforce their rights, Users are kindly asked to preferably report related complaints using the contact details provided in this document. - - - -4\. Rights regarding content on Light Protocol Websites - All rights reserved - -4.1. The Owner holds and reserves all intellectual property rights for any such content. - -4.2. Users may not, therefore, use such content in any way that is not necessary or implicit in the proper use of the Service. - -4.3. In particular, but without limitation, Users may not copy, download, share (beyond the limits set forth in these Terms), modify, translate, transform, publish, transmit, sell, sublicense, edit, transfer/assign to third parties or create derivative works from the content available on Light Protocol Websites, nor allow any third party to do so through the User or their device, even without the User's knowledge. - -4.4. Where explicitly stated on Light Protocol Websites, the User may download, copy and/or share some content available through Light Protocol Websites for its sole use and provided that the copyright attributions and all the other attributions requested by the Owner are correctly implemented. - -4.5. We grant you permission to download the protocol and use it for your own purposes. However, your use of the Protocol is entirely at your own risk. You are solely responsible for deciding how to use and implement the Protocol and we have no control over and assume no responsibility for your use. We accept no liability for any losses that may arise in connection with your use of the Protocol. - -4.6. Any applicable statutory limitation or exception to copyright shall stay unaffected. - - - -5\. Access to external resources - -5.1. Through Light Protocol Websites Users may have access to external resources provided by third parties. Users acknowledge and accept that the Owner has no control over such resources and is therefore not responsible for their content and availability. - -5.2. Conditions applicable to any resources provided by third parties, including those applicable to any possible grant of rights in content, result from each such third parties’ terms and conditions or, in the absence of those, applicable statutory law. - - - -6\. Acceptable use - -6.1. Light Protocol Websites and the Service may only be used within the scope of what they are provided for, under these Terms and applicable law. - -6.2. Users are solely responsible for making sure that their use of Light Protocol Websites and/or the Service violates no applicable law, regulations or third-party rights. - -6.3. Therefore, the Owner reserves the right to take any appropriate measure to protect its legitimate interests including by denying Users access to Light Protocol Websites or the Service, terminating contracts, reporting any misconduct performed through Light Protocol Websites or the Service to the competent authorities – such as judicial or administrative authorities - whenever Users engage or are suspected to engage in any of the following activities: violate laws, regulations and/or these Terms; infringe any third-party rights; considerably impair the Owner’s legitimate interests; - -6.4. offend the Owner or any third party. - - - -7\. Software license - -7.1. The software embedded in or related to Light Protocol Websites is provided under a some-rights-reserved license. - -7.2. This means that Users are granted broad rights, including but not limited to the rights to use, execute, copy or distribute the software, to the extent determined by such license. - -7.3. The terms of such license shall always prevail upon conflicting, divergent or inconsistent provisions of these Terms. - -7.4. Users may find further information regarding the license terms on [https://github.com/Lightprotocol](https://github.com/Lightprotocol). - - - -8\. API usage terms - -8.1. Users may access their data relating to Light Protocol Websites via the Application Program Interface (API). Any use of the API, including use of the API through a third-party product/service that accesses Light Protocol Websites, is bound by these Terms and, in addition, by the following specific terms:the User expressly understands and agrees that the Owner bears no responsibility and shall not be held liable for any damages or losses resulting from the User’s use of the API or their use of any third-party products/services that access data through the API. - - - -COMMON LIABILITY AND INDEMNIFICATION - -Unless otherwise explicitly stated or agreed with Users, the Owner’s liability for damages in connection with the execution of the Agreement shall be excluded, limited and/or reduced to the maximum extent permitted by applicable law. - - - -9\. Indemnification - -9.1. The User agrees to indemnify and hold the Owner and its subsidiaries, affiliates, officers, directors, agents, co-branders, partners and employees harmless from and against any claim or demand ⁠ — including but not limited to lawyer's fees and costs ⁠ — made by any third party due to or in relation with any culpable violation of these Terms, third-party rights or statutory provisions connected to the use of the Service by the User or its affiliates, officers, directors, agents, co-branders, partners and employees to the extent allowed by applicable law. - -9.2. The above also applies to any claims exercised by third parties (including but not limited to the Owner’s clients or customers) against the Owner related to Digital Products provided by the User such as, for instance, conformity claims. - - - -10\. Limitation of liability - -10.1. Unless otherwise explicitly stated and without prejudice to applicable law, Users shall have no right to claim damages against the Owner (or any natural or legal person acting on its behalf). - -10.2. This does not apply to damages to life, health or physical integrity, damages resulting from the breach of material contractual obligations such as any obligation strictly necessary to achieve the purpose of the contract, and/or damages resulting from intent or gross negligence, as long as Light Protocol Websites has been appropriately and correctly used by the User. - -10.3. Unless damages have been caused by way of intent or gross negligence, or they affect life, health or physical integrity, the Owner shall only be liable to the extent of typical and foreseeable damages at the moment the contract was entered into. - - - -AUSTRALIAN USERS LIABILITY AND INDEMNIFICATION - -11\. Nothing in these Terms excludes, restricts or modifies any guarantee, condition, warranty, right or remedy which the User may have under the Competition and Consumer Act 2010 (Cth) or any similar state and territory legislation and which cannot be excluded, restricted or modified (non-excludable right). To the fullest extent permitted by law, our liability to the User, includingliability for a breach of a non-excludable right and liability which is not otherwise excluded under these Terms, is limited, at the Owner’s sole discretion, to the re-performance of the services or the payment of the cost of having the services supplied again. - - - -US USERS LIABILITY AND INDEMNIFICATION - -12\. Disclaimer of Warranties - -12.1. Light Protocol Websites is provided strictly on an “as is” and “as available” basis. Use of the Service is at Users’ own risk. - -12.2. To the maximum extent permitted by applicable law, the Owner expressly disclaims all conditions, representations, and warranties — whether express, implied, statutory or otherwise, including, but not limited to, any implied warranty of merchantability, fitness for a particular purpose, or non-infringement of third-party rights. No advice or information, whether oral or written, obtained by the User from the Owner or through the Service will create any warranty not expressly stated herein. - -12.3. Without limiting the foregoing, the Owner, its subsidiaries, affiliates, licensors, officers, directors, agents, co-branders, partners, suppliers and employees do not warrant that the content is accurate, reliable or correct; that the Service will meet Users’ requirements; that the Service will be available at any particular time or location, uninterrupted or secure; that any defects or errors will be corrected; or that the Service is free of viruses or other harmful components. Any content downloaded or otherwise obtained through the use of the Service is downloaded at Users' own risk and Users shall be solely responsible for any damage to Users’ computer system or mobile device or loss of data that results from such download or Users’ use of the Service. - -12.4. The Owner does not warrant, endorse, guarantee, or assume responsibility for any product or service advertised or offered by a third party through the Service or any hyperlinked website or service, and the Owner shall not be a party to or in any way monitor any transaction between Users and third-party providers of products or services.The Service may become inaccessible or it may not function properly with Users’ web browser, mobile device, and/or operating system. The owner cannot be held liable for any perceived or actual damages arising from Service content, operation, or use of this Service. - -12.5. Federal law, some states, and other jurisdictions, do not allow the exclusion and limitations of certain implied warranties. The above exclusions may not apply to Users. This Agreement gives Users specific legal rights, and Users may also have other rights which vary from state to state. The disclaimers and exclusions under this agreement shall not apply to the extent prohibited by applicable law. - - - -13\. Limitations of liability - -13.1. To the maximum extent permitted by applicable law, in no event shall the Owner, and its subsidiaries, affiliates, officers, directors, agents, co-branders, partners, suppliers and employees be liable for: any indirect, punitive, incidental, special, consequential or exemplary damages, including without limitation damages for loss of profits, goodwill, use, data or other intangible losses, arising out of or relating to the use of, or inability to use, the Service; and any damage, loss or injury resulting from hacking, tampering or other unauthorized access or use of the Service or - -13.2. User account or the information contained therein; any errors, mistakes, or inaccuracies of content; personal injury or property damage, of any nature whatsoever, resulting from User access to or use of the Service; any unauthorized access to or use of the Owner’s secure servers and/or any and all personal information stored therein; any interruption or cessation of transmission to or from the Service; any bugs, viruses, trojan horses, or the like that may be transmitted to or through the Service; any errors or omissions in any content or for any loss or damage incurred as a result of the use of any content posted, emailed, transmitted, or otherwise made available through the Service; and/or the defamatory, offensive, or illegal conduct of any User or third party. In no event shall the Owner, and its subsidiaries, affiliates, officers, directors, agents, co-branders, partners, suppliers and employees be liable for any claims, proceedings, liabilities, obligations, damages, losses or costs in an amount exceeding the amount paid by User to the Owner hereunder in the preceding 12 months, or the period of duration of this agreement between the Owner and User, whichever is shorter. - -13.3. This limitation of liability section shall apply to the fullest extent permitted by law in the applicable jurisdiction whether the alleged liability is based on contract, tort, negligence, strict liability, or any other basis, even if the User has been advised of the possibility of such damage. - -13.4. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, therefore the above limitations or exclusions may not apply to the User. The terms give User specific legal rights, and User may also have other rights which vary from jurisdiction to jurisdiction. The disclaimers, exclusions, and limitations of liability under the terms shall not apply to the extent prohibited by applicable law. - - - -14\. Indemnification - -The User agrees to defend, indemnify and hold the Owner and its subsidiaries, affiliates, officers, directors, agents, co-branders, partners, suppliers and employees harmless from and against any and all claims or demands, damages, obligations, losses, liabilities, costs or debt, and expenses, including, but not limited to, legal fees and expenses, arising from User’s use of and access to the Service, including any data or content transmitted or received by User; User’s violation of these terms, including, but not limited to, User’s breach of any of the representations and warranties set forth in these terms; User’s violation of any third-party rights, including, but not limited to, any right of privacy or intellectual property rights; User’s violation of any statutory law, rule, or regulation; any content that is submitted from User’s account, including third party access with User’s unique username, password or other security measure, if applicable, including, but not limited to, misleading, false, or inaccurate information; User’s wilful misconduct; or statutory provision by User or its affiliates, officers, directors, agents, co-branders, partners, suppliers and employees to the extent allowed by applicable law. - - - -COMMON PROVISIONS - -15\. No Waiver - -15.1. The Owner’s failure to assert any right or provision under these Terms shall not constitute a waiver of any such right or provision. - -15.2. No waiver shall be considered a further or continuing waiver of such term or any other term. - -16\. Service interruption - -16.1. To ensure the best possible service level, the Owner reserves the right to interrupt the Service for maintenance, system updates or any other changes, informing the Users appropriately. - -16.2. Within the limits of law, the Owner may also decide to suspend or discontinue the Service altogether. If the Service is discontinued, the Owner will cooperate with Users to enable them to withdraw personal data or information and will respect Users' rights relating to continued product use and/or compensation, as provided for by applicable law. - -16.3. Additionally, the Service might not be available due to reasons outside the Owner’s reasonable control, such as “force majeure” events (infrastructural breakdowns or blackouts etc.). - - - -17\. Service reselling - -Users may not reproduce, duplicate, copy, sell, resell or exploit any portion of Light Protocol Websites and of its Service without the Owner’s express prior written permission, granted either directly or through a legitimate reselling programme. - - - -18\. Privacy policy - -For information about the use of their personal data, Users must refer to the privacy policy of Light Protocol Websites/privacy-policy which is hereby declared to be part of these Terms. - - - -19\. Intellectual property rights - -19.1. Without prejudice to any more specific provision of these Terms, any intellectual property rights, such as copyrights, trademark rights, patent rights and design rights related to Light Protocol Websites are the exclusive property of the Owner or its licensors and are subject to the protection granted by applicable laws or international treaties relating to intellectual property. - -19.2. All trademarks — nominal or figurative — and all other marks, trade names, service marks, word marks, illustrations, images, or logos appearing in connection with Light Protocol Websites are, and remain, the exclusive property of the Owner or its licensors and are subject to the protection granted by applicable laws or international treaties related to intellectual property. - - - -20\. Changes to these Terms - -20.1. The Owner reserves the right to amend or otherwise modify these Terms at any time. In such cases, the Owner will appropriately inform the User of these changes. - -20.2. Such changes will only affect the relationship with the User from the date communicated to Users onwards. - -20.3. The continued use of the Service will signify the User’s acceptance of the revised Terms. - -20.4. If Users do not wish to be bound by the changes, they must stop using the Service and may terminate the Agreement. - -20.5. The applicable previous version will govern the relationship prior to the User's acceptance. The User can obtain any previous version from the Owner. - -20.6. If legally required, the Owner will notify Users in advance of when the modified Terms will take effect. - - - -21\. Assignment of contract - -21.1. The Owner reserves the right to transfer, assign, dispose of by novation, or subcontract any or all rights or obligations under these Terms, taking the User’s legitimate interests into account. Provisions regarding changes of these Terms will apply accordingly. - -21.2. Users may not assign or transfer their rights or obligations under these Terms in any way, without the written permission of the Owner. - - - -22\. Contacts - -All communications relating to the use of Light Protocol Websites must be sent using [friends@lightprotocol.com](mailto:friends@lightprotocol.com) referencing “Terms of Use Enquiry”. - - - -23\. Severability - -Should any provision of these Terms be deemed or become invalid or unenforceable under applicable law, the invalidity or unenforceability of such provision shall not affect the validity of the remaining provisions, which shall remain in full force andeffect. - - - -US USER PROVISIONS - -24\. Any such invalid or unenforceable provision will be interpreted, construed and reformed to the extent reasonably required to render it valid, enforceable and consistent with its original intent. - - - -25\. These Terms constitute the entire Agreement between Users and the Owner with respect to the subject matter hereof, and supersede all other communications, including but not limited to all prior agreements, between the parties with respect to such subject matter. - - - -26\. These Terms will be enforced to the fullest extent permitted by law. - - - -EU USER PROVISIONS - -27\. Should any provision of these Terms be or be deemed void, invalid or unenforceable, the parties shall do their best to find, in an amicable way, an agreement on valid and enforceable provisions thereby substituting the void, invalid or unenforceable parts. - - - -28\. In case of failure to do so, the void, invalid or unenforceable provisions shall be replaced by the applicable statutory provisions, if so permitted or stated under the applicable law. - - - -29\. Without prejudice to the above, the nullity, invalidity or impossibility to enforce a particular provision of these Terms shall not nullify the entire Agreement, unless the severed provisions are essential to the Agreement, or of such importance that the parties would not have entered into the contract if they had known that the provision would not be valid, or in cases where the remaining provisions would translate into an unacceptable hardship on any of the parties. - - - -30\. These Terms are drawn up and revised in English. Other language versions of these Terms are provided for information purposes only. In the event of any inconsistency between different linguistic versions, the original version shall always prevail. - - - -31\. These Terms are governed by the law of the place where the Owner is based, as disclosed in the relevant section of this document, without regard to conflict of laws principles. - - - -32\. However, regardless of the above, if the law of the country that the User is located in provides for higher applicable consumer protection standards, such higher standards shall prevail. - - - -33\. Exception for Consumers in Switzerland: If the User qualifies as a Consumer in Switzerland, Swiss law will apply. - - - -34\. Exception for Consumers in Brazil: If the User qualifies as a Consumer in Brazil and the product and/or service is commercialized in Brazil, Brazilian law will apply. - - - -VENUE OF JURISDICTION - -35\. The exclusive competence to decide on any controversy resulting from or connected to these Terms lies with the courts of the place where the Owner is based, as displayed in the relevant section of this document. - - - -36\. Exception for Consumers in Europe - -The above does not apply to any Users that qualify as European Consumers, nor to Consumers based in the United Kingdom, Switzerland, Norway or Iceland. - - - -37\. Exception for Consumers in Brazil - -The above does not apply to Users in Brazil that qualify as Consumers. - - - -38\. UK Consumers - -38.1. Consumers based in England and Wales may bring legal proceedings in connection with these Terms in the English and Welsh courts. - -38.2. Consumers based in Scotland may bring legal proceedings in connection with these Terms in either the Scottish or the English courts. - -38.3. Consumers based in Northern Ireland may bring legal proceedings in connection with these Terms in either the Northern Irish or the English courts. - - - -39\. US Users - -39.1. Each party specifically waives any right to trial by jury in any court in connection with any action or litigation. - -39.2. Any claims under these terms shall proceed individually and no party shall join in a class action or other proceeding with or on behalf of others. - - - -US USERS - -40\. Surviving provisions - -40.1. This Agreement shall continue in effect until it is terminated by either Light Protocol Websitess or the User. - -40.2. Upon termination, the provisions contained in these Terms that by their context are intended to survive termination or expiration will survive, including but not limited to the following: - -40.2.1. the User’s grant of licenses under these Terms shall survive indefinitely; - -40.2.2. the User’s indemnification obligations shall survive for a period of five years from the date of termination; - -40.2.3. the disclaimer of warranties and representations, and the stipulations under the section containing indemnity and limitation of liability provisions, shall survive indefinitely. - - - -ACCESSIBILITY - -41\. The Owner is committed to making the content accessible to Users with disabilities. If Users have a disability and are unable to access any portion of Light Protocol Websitess due to their disability, they should give a notice including a detailed description of the issue encountered. - - - -42\. If the issue is readily identifiable and resolvable in accordance with industry-standard information technology tools and techniques, the Owner commits to promptly address it. - - - -\ - - - - -DEFINITIONS AND LEGAL REFERENCES - -Light Protocol Websitess - -The property that enables the provision of the Service on or [https://docs.lightprotocol.com](https://docs.lightprotocol.com/) or [www.lightprotocol.com](http://www.lightprotocol.com/). - - - -Agreement - -Any legally binding or contractual relationship between the Owner and the User, governed by these Terms. - - - -Brazilian (or Brazil) - -Applies where a User, regardless of nationality, is in Brazil. - - - -Business User - -Any User that does not qualify as a Consumer. - - - -Digital Product - -Is a Product that consists of: content produced and supplied in digital form; and/or - -a service that allows for the creation, processing, storing or accessing data in a digital form or the sharing or any other form of interaction with digital data uploaded or created by the User or any other user of [www.lightprotocol.com](http://www.lightprotocol.com/) or [https://docs.lightprotocol.com](https://docs.lightprotocol.com/). - - - -European (or Europe) - -Applies where a User, regardless of nationality, is in the EU. - - - -Owner (or We) - -Indicates Light Protocol Labs that provides [www.lightprotocol.com](http://www.lightprotocol.com/), [https://docs.lightprotocol.com](https://docs.lightprotocol.com/) and/or the Service to Users. - - - -Service - -The service provided by www.lightprotocol.com as described in these Terms and on [www.lightprotocol.com](http://www.lightprotocol.com/)or [https://docs.lightprotocol.com](https://docs.lightprotocol.com/). - - - -Terms - -All provisions applicable to the use of www.lightprotocol.com and/or the Service as described in this document, including any other related documents or agreements, and as updated from time to time. - - - -User (or You) - -Indicates any natural person or legal entity using [www.lightprotocol.com](http://www.lightprotocol.com/) or [https://docs.lightprotocol.com](https://docs.lightprotocol.com/). - - - -Consumer - -Consumer is any User qualifying as such under applicable law. - - - - diff --git a/docs/resources/terms-of-use.md b/docs/resources/terms-of-use.md deleted file mode 100644 index c6f7956..0000000 --- a/docs/resources/terms-of-use.md +++ /dev/null @@ -1,287 +0,0 @@ ---- -description: 'Last updated: September 14, 2024.' -hidden: true -noRobotsIndex: true ---- - -# Terms of Use - -Heads up: We grant you permission to download the protocol, use it for your own purposes. - -Please read these Terms of Use carefully before you start to use the Protocol. By using the Protocol, you accept and agree to be bound and abide by these Terms of Use. If you do not want to agree to these Terms of Use, you must not use the Protocol. - -Please send all communications relating to these Terms of Use to [friends@lightprotocol.com](mailto:friends@lightprotocol.com) referencing “Terms of Use Enquiry”. - -*** - -1\. ACCEPTANCE OF THE TERMS OF USE - -1.1. These terms of use are entered into by and between you and Light Protocol Labs (“Light Protocol”, “we” or “us”). The following terms of use, together with any documents namely incorporated by reference (collectively, these “Terms of Use”), govern the use by you (“you”, and in its variants including “your”) of Light Protocol’s Solana based protocol and its associated software and documentation, including ZK Compression (collectively, the “Protocol”) made available on GitHub. - -1.2. These Terms of Use apply exclusively to the Protocol and does not cover any other protocols or software available from Light Protocol or any other parties, whether accessible through GitHub or elsewhere. We do not own, control, or bear any responsibility for these third parties materials and tools, such as protocols or smart contracts, namely the Solana Protocol, which is controlled, maintained, and/or operated by third parties. Please consult the relevant third parties’ user agreements for information regarding your rights and the associated risks with your use of and access to the respective protocols and related materials. - -1.3. When the user uses the Protocol under the authority of another person or entity, such as an employer, then “you” (and any related terms like “your”) refers to the party on whose behalf the Protocol is being used. Additionally, if someone else is using the Protocol on your behalf, you accept full responsibility for their actions or inactions, as though they were your own. - - - -2\. AMENDMENTS TO THE TERMS OF USE - -2.1. We may update these Terms of Use at any time. The changes will take effect immediately upon posting and apply for all use of the Protocol thereafter. - -2.2. Changes to the Governing Law and dispute resolution section will not apply to any disputes known before the date of posting. - -2.3. By continuing to use the Protocol after updates, you agree to the revised terms. It is your responsibility to check for updates each time you use the Protocol, as they are binding on you. - - - -3\. PROTOCOL FUNCTIONALITY, SECURITY AND RISKS - -3.1. The Protocol is an open-source solution to network congestion and data storage costs on Solana in a way, that it enables compressed transactions and accounts. This minimises cost by securely storing specific kinds of data on cheaper ledger space instead of the more expensive account space. - -3.1.1. The Protocol includes the system program and compressed token program, which are made available publicly, and runs on open-source self executing smart contracts. - -3.1.2. The Protocol requires keeper nodes called "foresters" (“Forester” or “Foresters”) to function. The Foresters constantly empties queues of transactions in an asynchronous process to ensure network liveness. Foresters have no influence on compressed transactions or accounts and do not interact with users. - -3.1.3. The Protocol is not centrally operated due to the use of a multi-signature system, with its addresses made publicly available here \ - -3.2. We prioritize the security of the Protocol and have implemented measures to mitigate potential risks, as detailed in our [security section](broken-reference). - -3.2.1. However, since the Protocol is built on open-source software, it may contain bugs or vulnerabilities that could adversely affect its functionality. In rare but severe cases, these issues could lead to the loss of your digital assets or your ability to access your digital wallet. - -3.2.2. You recognize that hackers or other malicious individuals may attempt to disrupt the Protocol or your use of it through various means, including but not limited to deploying malicious software, conducting denial-of-service attacks, performing Sybil attacks, or engaging in spoofing activities. - -3.2.3. By using the Protocol, you acknowledge and accept these inherent risks. You agree to release us from any liability and hold us harmless for any losses you may incur as a result of such vulnerabilities or malicious activities. - -3.2.4. You acknowledge that the Protocol may utilize, incorporate, or provide links to certain open-source components. Your use of the Protocol is subject to any applicable open-source licenses governing these components, and you agree to comply with all such license terms. - -3.3. Light Protocol does not hold your digital assets, nor does it take custody of them. - -3.3.1. We have no access to your assets or funds. Neither the Protocol or Light Protocol has control over the private keys of any assets belonging to users. It is a user’s responsibility to ensure to maintain control of her digital assets and she have sole responsibility for exchanging them. - -3.3.2. You understand and agree that you are solely responsible for any losses arising from your digital asset transactions and exchanges. You commit to indemnify, defend, and hold us harmless from any claims or losses that you or others may incur as a result of your digital asset transactions, even if you executed these transactions by following documenation or instructions available in the Protocol. - -3.3.3. We are not your financial advisors and do not offer any investment advice concerning your use or exchange of digital assets. - -3.4. Light Protocol is not a financial institution, and we have no fiduciary duty to you. - - - -4\. INTELLECTUAL PROPERTY RIGHTS OF THE PROTOCOL - -4.1. The Protocol and its entire contents, features, and functionality are owned by Light Protocol, its licensors, or other providers of such material and are protected by EU and international copyright, trademark, patent, trade secret, and other intellectual property or proprietary rights laws. - -4.2. The Protocol is licensed under the terms of the Apache License, Version 2.0, available at http://www.apache.org/licenses/ and GNU General Public License 3.0, available at https://www.gnu.org/licenses/gpl-3.0.en.html (together “Licenses”), incorporated herein by reference and, and together with these Terms of Use. In the event of any conflict between the Licenses’ terms and these Terms of Use, the terms of the Licenses will prevail. - -4.3. You are afforded broad rights under these Terms of Use and the Licenses, including the ability to use, execute, copy, and distribute the Protocol as specified by the Licenses and these Terms of Use: - -4.3.1. We authorize you to download and utilize the Protocol for your own purposes. Please be aware that you use the Protocol entirely at your own risk. You are solely responsible for determining how you employ and implement the Protocol. We do not control or assume responsibility for your use and disclaim any liability for losses that may result from it. - -4.3.2. If you print, copy, modify, download, or otherwise use any part of the Protocol in violation of these Terms of Use, your permission to use the Protocol will terminate immediately. You must cease all use and destroy any copies or derivatives of the software you have obtained or created. Unauthorized use not expressly permitted by the Licenses’ terms or these Terms of Use constitutes a breach and may violate copyright, trademark, and other applicable laws. - -4.3.3. We reserve the exclusive right to modify or withdraw the Protocol at our sole discretion without prior notice. We will not be liable if the Protocol, in whole or in part, is unavailable at any time or for any period. From time to time, we may also restrict access to certain parts or the entire Protocol. - -4.3.4. You are responsible for making all necessary arrangements to access, download, and use the Protocol. - - - -5\. USE OF THE PROTOCOL - -5.1. The Protocol may only be used within the scope of what lawful purposes it is provided for, under these Terms and applicable law. - -5.2. We make no claims that the Protocol or any of its content is accessible or appropriate in your country or region, is accurate, complete, or useful. If you choose to rely on it, you do so entirely at your own risk. We are not responsible or liable for any consequences resulting from your or others' reliance on the Protocol. - -5.3. We reserve the exclusive right to modify or discontinue the Protocol at our sole discretion and without prior notice. We shall not be held liable if any part or the entirety of the Protocol becomes unavailable at any time or for any duration, regardless of the reason. - -5.4. You are responsible for making all necessary arrangements to access, download, and use the Protocol. - -5.5. By using the Protocol, you confirm and warrant you meet the following requirements, and if you do not fulfill these requirements, you must refrain from using the Protocol: - -5.5.1. you are 18 years of age or older, except when using the Protocol under the supervision of a parent or authorised adult guardian; - -5.5.2. you affirm that you are legally competent to enter into a binding agreement with Light Protocol and that you meet all the eligibility criteria mentioned above; - -5.5.3. you are solely responsible for making sure that your use of the Protocol violates no applicable law and your local law, regulations or third-party rights; - -5.5.4. you are not citizen, resident, or located in a country that is subject to a United States, European Union or its Member States, United Kingdom, United Nations embargo, or that has been designated as a “terrorist-supporting” country or region (collectively “Sanctioned Countries”), or any other country or region where your use of or access to the Protocol would be illegal or otherwise violate any applicable or local law; - -5.5.5. you aren’t listed, represent, or operate for anyone listed on any a United States, European Union or its Member States, United Kingdom, United Nations list of prohibited or restricted parties (collectively “Sanctioned Persons”). - -5.6. You agree to use not to use the Protocol only for the lawful purposes it is provided for, under these Terms and applicable law. You agree not to use the protocol for - -5.6.1. employ any devices, introduce any harmful software, or routines that interfere with the Protocol's normal functioning; - -5.6.2. circumvent or disable any security features designed to protect the Protocol; - -5.6.3. attempt to access, interfere with, or disrupt any part of the Protocol or its connected servers and databases without authorization; - -5.6.4. engage in any activity that hinders or disrupts the proper operation of the Protocol; - -5.6.5. participate in or facilitate any illegal or fraudulent actions, including handling or transferring funds obtained through criminal means; - -5.6.6. fabricate transactions, manipulate market conditions, engage in deceptive trading practices, or encourage others to engage in such unethical behavior; - -5.6.7. exploit, harm, or attempt to harm minors by exposing them to inappropriate content, soliciting personally identifiable information, or any other means of exploitation; - -5.6.8. send, receive, upload, download, or utilize any materials that are in violation of these Terms of Use; - -5.6.9. impersonate or attempt to impersonate Light Protocol, its team members, other users, or any other individual or entity, including through the misuse of digital wallets, email addresses, or usernames associated with them; and - -5.6.10. engage in any behavior that restricts or inhibits any other person's ability to use or enjoy the Protocol, or that may harm Light Protocol or its users, or expose them to legal liability. - - - -6\. ENFORCEMENT AND TERMINATION - -6.1. We reserve the right to take any adequate actions to protect the Protocol and the legitimate interests of its users upon breach of these Terms of Use or applicable law. This includes: - -6.1.1. initiating legal proceedings or reporting to law enforcement authorities any illegal or unauthorized use of the Protocol; - -6.1.2. terminating or suspending access to all or part of the Protocol, with or without notice, for adequate reason, including violations of these Terms of Use for the respective user; and - -6.1.3. implementing appropriate measures, such as denying access or reporting misconduct to relevant authorities, if a user engages in or are reasonably suspected of engaging in prohibited activities. - -6.2. Please note that we do not monitor or control any content within the Protocol, nor do we oversee on-chain transactions. As a result, we disclaim all liability for the actions or omissions of other users of the Protocol. - - - -7\. GENERAL RISKS ASSOCIATED WITH BLOCKCHAIN - -7.1. By accessing or interacting with the Protocol in any manner, you represent and warrant that you fully comprehend the inherent risks associated with: - -7.1.1. cryptographic systems and blockchain based-networks, including the fundamental principles and vulnerabilities of cryptography and distributed ledger technologies; - -7.1.2. digital assets; - -7.1.3. smart contract-based tokens, in particular recognizing the functionalities and potential risks of tokens governed by smart contracts; and - -7.1.4. systems interacting with blockchain networks. - -7.2. You acknowledge and accept that cryptography is a rapidly advancing field. Breakthroughs in code decryption or other technological innovations—such as the development of quantum computers—may introduce new risks to digital assets and smart contracts accessible via the Protocol. These advancements could potentially lead to the theft or loss of your digital assets. - - - -8\. DISCLAIMER - -8.1. By accessing and using the Protocol, you acknowledge that we do not offer investment advice, and no advisory relationship is established between you and us. We do not provide financial, investment, tax, legal, or securities advice through the Protocol. Any information or content available on the Protocol, whether from us, third parties, or other users, should not be interpreted as investment advice. We disclaim any responsibility or liability for decisions you make or actions you take based on your use of the Protocol. - -8.1.1. Nothing presented within the Protocol should be construed as a solicitation, recommendation, endorsement, or offer by us or any third party to engage in any transaction involving digital assets, securities, or other financial instruments. We and our affiliates do not endorse or sponsor any digital assets that may be transacted through the Protocol. - -8.1.2. You understand and agree that using the Protocol may require you to pay fees associated with interacting with blockchain technologies. You are solely responsible for paying these fees and costs. Light Protocol is not responsible for covering any such expenses. - -8.2. We value security, as outlined above in 6.2., however you acknowledge and agree that we cannot guarantee that the Protocol or any files available for download are free of viruses, malware, or other harmful components. - -8.2.1. You are responsible for implementing appropriate security measures to protect your systems and data, including maintaining backups and antivirus protections. - -8.2.2. To the maximum extent allowed by applicable law, we are not liable for any loss or damage caused by viruses or other technologically harmful material that may infect your devices, software, data, or other proprietary material due to your use of the Protocol or any services or items obtained through the Protocol. - - - -9\. WARRANTIES - -9.1. You acknowledge and agree that the Protocol is provided to you on an "as is" and "as available" basis, without any warranties of any kind, whether express, implied, statutory, or otherwise. Your use of the Protocol is entirely at your own risk. - -9.2. To the fullest extent permitted by applicable law, Light Protocol and its subsidiaries, affiliates, officers, directors, agents, co-branders, partners, suppliers, employees, and service providers disclaim all warranties, express or implied. This includes, but is not limited to, implied warranties of merchantability, fitness for a particular purpose, non-infringement, and any warranties arising from course of dealing or usage of trade. - -9.3. We make no representations or warranties regarding the completeness, accuracy, reliability, security, quality, or availability of the Protocol. No advice or information, whether oral or written, obtained by you from us or through the Protocol shall create any warranty not expressly stated herein. - -9.4. Specifically, we do not warrant that: - -· The Protocol will meet your requirements or expectations. - -· The Protocol will be uninterrupted, timely, secure, or error-free. - -· Any defects or errors will be corrected. - -· The Protocol is free from viruses or other harmful components. - -· Any content or information obtained through the Protocol will be accurate or reliable. - -9.5. Nothing in these Terms affects any warranties that cannot be excluded or limited under applicable law. - - - -10\. LIMITATION OF LIABILITY - -10.1. To the maximum extent permitted by applicable law, in no event shall Light Protocol, along with its subsidiaries, affiliates, officers, directors, agents, co-branders, partners, suppliers, employees, or service providers, be liable for any indirect, incidental, special, consequential, or exemplary damages. - -10.1.1. This includes, without limitation, damages for loss of profits, goodwill, use, data, or other intangible losses arising out of or relating to your use of, or inability to use, the Protocol. - -10.1.2. This limitation applies even if such damages were foreseeable or if we have been advised of the possibility of such damages. - -10.2. Nothing in these Terms affects any warranties that cannot be excluded or limited under applicable law. - - - -11\. INDEMNIFICATION - -11.1. You agree to defend, indemnify, and hold harmless Light Protocol, its affiliates, licensors, service providers, and their respective officers, directors, employees, contractors, agents, shareholders, members, suppliers, successors, and assigns from and against any and all claims, liabilities, damages, judgments, awards, losses, costs, expenses, or fees—including reasonable attorneys' fees and legal expenses—that arise out of or relate to: - -11.1.1. your breach or violation of these Terms of Use; - -11.1.2. your use or misuse of the Protocol, including any data or content you transmit or receive; - -11.1.3. any use of the Protocol's content that is not expressly authorized in these Terms of Use; - -11.1.4. your violation of any applicable laws, statutes, regulations, or rules. - -11.2. This indemnification obligation applies to the maximum extent permitted by applicable law. - - - - - -12\. GOVERNING LAW AND JURISDICTION - -12.1. All issues arising from or related to the Protocol and these Terms of Use, including any disputes or claims—whether contractual or non-contractual—shall be governed by and interpreted in accordance with the laws of the Cayman Islands. This applies without regard to any choice of law or conflict of law rules, whether from the Cayman Islands or any other jurisdiction. - -12.2. Subject to the arbitration provisions below, any legal actions, suits, or proceedings related to the Protocol or these Terms must be brought exclusively in the courts of the Cayman Islands. However, we reserve the right to initiate legal proceedings against you in your country or state of residence or any other applicable jurisdiction if you breach these Terms of Use. - -12.3. By agreeing to these Terms, you waive any objections to the jurisdiction of such courts and to the venue in which they are located. - - - -13\. ARBITRATION - -13.1. Any disputes arising from these Terms of Use or related to your use of the Protocol—including disputes over interpretation, violation, invalidity, non-performance, or termination—may be required to be submitted to final and binding arbitration, at the sole discretion of Light Protocol. Such arbitration will be administered by the Cayman International Mediation and Arbitration Centre (CI-MAC) under the Arbitration Act of the Cayman Islands and governed by Cayman Islands law. - -13.2. The arbitration will be conducted in English, in George Town, Cayman Islands, with a single arbitrator presiding. The arbitrator shall have the authority to rule on any challenges to its jurisdiction or to the validity and enforceability of these arbitration provisions. - -13.3. The decision rendered by the sole arbitrator will be final and binding on both parties, and each party waives the right to challenge the jurisdiction of the arbitration or object to the venue, including under the doctrine of forum non conveniens. - -13.4. All disputes will be resolved on an individual basis. Class arbitration and any claims brought as a plaintiff or class member in any representative or collective proceeding are expressly prohibited. The arbitrator is not permitted to consolidate claims or preside over any form of class or representative arbitration. - -13.5. By agreeing to these Terms of Use, you consent to this arbitration provision, which affects how disputes between you and Light Protocol will be resolved. Please read this section carefully, as it requires you to resolve disputes through individual arbitration and prohibits class actions. - - - -14\. LIMITATION ON TIME TO FILE CLAIMS - -14.1. Any claim or legal action arising out of or relating to these Terms of Use or your use of the Protocol must be initiated within one year from the date the cause of action occurs. - -14.2. Failure to bring such a claim within this timeframe will result in the claim being permanently barred. - - - -15\. WAIVER, SEVERABILITY - -15.1. No waiver by Light Protocol of any term or condition in these Terms of Use shall be considered a continuing waiver or a waiver of any other term or condition. - -15.2. If Light Protocol does not enforce a right or provision under these Terms at any time, this shall not be considered a waiver of that right or provision. - -15.3. Should any provision of these Terms be deemed or become invalid or unenforceable under applicable law, the invalidity or unenforceability of such provision shall not affect the validity of the remaining provisions, which shall remain in full force and effect. - - - -16\. AGREEMENT AND SURVIVING PROVISIONS - -16.1. These Terms of Use and the Licenses constitute the entire Agreement between you and the Light Protocol with respect to the Protocol, and supersede all other communications, including but not limited to all prior agreements, whether in writing or oral, between the parties with respect to the Protocol. - -16.2. This Agreement shall continue in effect until it is terminated by either Light Protocol or you. Upon termination, the provisions contained in these Terms of Use that by their context are intended to survive termination or expiration will survive, including but not limited to the following: - -16.2.1. your grant of licenses under these Terms shall survive indefinitely; - -16.2.2. your indemnification obligations shall survive for a period of five years from the date of termination; - -16.2.3. the disclaimer of warranties and representations, and the stipulations under the section containing indemnity and limitation of liability provisions, shall survive indefinitely. - -16.3. Please send all communications relating to these Terms of Use to [friends@lightprotocol.com](mailto:friends@lightprotocol.com) referencing “Terms of Use Enquiry”.