{"id":19831796,"url":"https://github.com/mateolafalce/decenwser","last_synced_at":"2026-05-18T15:05:08.425Z","repository":{"id":65529869,"uuid":"583646265","full_name":"mateolafalce/Decenwser","owner":"mateolafalce","description":"A decentralized browser , anonymous 🧥, with a local server and based on blockchain technology that allows the content to be immutable worldwide. Web3 is here  more than ever","archived":false,"fork":false,"pushed_at":"2023-06-01T13:23:27.000Z","size":600,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-24T13:54:27.901Z","etag":null,"topics":["anonymity","blockchain","browser","decentralized","decenwser","privacy","solana"],"latest_commit_sha":null,"homepage":"https://github.com/mateolafalce/Decenwser","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mateolafalce.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-30T12:40:42.000Z","updated_at":"2024-09-04T09:36:20.000Z","dependencies_parsed_at":"2024-11-12T11:45:16.628Z","dependency_job_id":null,"html_url":"https://github.com/mateolafalce/Decenwser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mateolafalce/Decenwser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mateolafalce%2FDecenwser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mateolafalce%2FDecenwser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mateolafalce%2FDecenwser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mateolafalce%2FDecenwser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mateolafalce","download_url":"https://codeload.github.com/mateolafalce/Decenwser/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mateolafalce%2FDecenwser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272858568,"owners_count":25005100,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-30T02:00:09.474Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["anonymity","blockchain","browser","decentralized","decenwser","privacy","solana"],"created_at":"2024-11-12T11:34:39.493Z","updated_at":"2026-05-18T15:05:03.380Z","avatar_url":"https://github.com/mateolafalce.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg height=\"170\" src=\"/public/img/Decenwser.ico\" /\u003e\n  \u003ch1 id=\"title\"\u003eDecenwser\u003c/h1\u003e\n  \u003cp\u003e\n    \u003cstrong\u003eDecentralized browser based on blockchain technology\u003c/strong\u003e\n  \u003c/p\u003e\n\n  \u003cp\u003e\n    \u003ca href=\"http://www.apache.org/licenses/LICENSE-2.0\"\u003e\u003cimg alt=\"License\" src=\"https://img.shields.io/badge/license-Apache%202.0-blue.svg\" /\u003e\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n---\n\n\u003ch3 align=\"center\"\u003eProgram Ids\u003c/h3\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n| Program                                                | Devnet                                                                                                                                            | Mainnet Beta |\n| ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |\n| [Decenwser](https://github.com/mateolafalce/Decenwser) | [`A9KnHa1iaHtDfsZDNNnM8ZMSmBr6gBFqMHnqw7EyyPir`](https://explorer.solana.com/address/A9KnHa1iaHtDfsZDNNnM8ZMSmBr6gBFqMHnqw7EyyPir?cluster=devnet) | `...`        |\n\n\u003c/div\u003e\n\n---\n\n\nWeb 3.0 has arrived to revolutionize the way we navigate the Internet and interact online. With decentralization as its main feature, this new stage of the web promises to offer a more secure, transparent and equitable experience for all users. In this context, Decenwser is a browser that emerges as an innovative alternative to the traditional server-client model.\n\nDecenwser is a decentralized browser that runs locally as a server at http://127.0.0.1:2004. Its main purpose is to guarantee the immutability of HTML and JavaScript content that has been previously stored on the Solana blockchain. This means that any web page that has been registered on the blockchain cannot be modified or removed by national or international government institutions. In this way, the privacy and security of the information we share online is ensured.\n\nIn addition, Decenwser is presented as an alternative to the current server-client model. Instead of relying on remote servers, the browser acts as a blockchain client or local client, which means that users can save web information on their own computers. This guarantees the independence of the user and the reduction of the power of the big technological corporations.\n\nAmong the benefits of Decenwser is the ability to regain control over our online data and the ability to browse the web without restrictions or censorship. In addition, by using blockchain technology, the browser offers greater transparency and security in data management, avoiding any type of tampering or manipulation.\n\nDecenwser is a tool that promises to change the way we interact with the web and interact online. With its decentralized approach and its ability to store information securely and immutably, it allows us to regain trust in technology and ensure privacy and independence online.\n\n![Decenwser](/public/img/decenwser.PNG)\n\n---\n\n\u003cdetails\u003e\n\u003csummary\u003eIndex\u003c/summary\u003e\n\n\u003cbr\u003e\n\n- \u003ca href=\"#install\"\u003e**Install the Project 📋**\u003c/a\u003e\n  - \u003ca href=\"#install-rust\"\u003eInstall Rust \u003c/a\u003e\n  - \u003ca href=\"#install-solana\"\u003eInstall Solana\u003c/a\u003e\n  - \u003ca href=\"#install-node\"\u003eInstall Node Js\u003c/a\u003e\n  - \u003ca href=\"#source\"\u003eDownload the source \u003c/a\u003e\n- \u003ca href=\"#blockchain-program\"\u003e**Blockchain Program ⛓️**\u003c/a\u003e\n  - \u003ca href=\"#main-account\"\u003e Create a domain\u003c/a\u003e\n  - \u003ca href=\"#store\"\u003e Store the content of the web page\u003c/a\u003e\n  - \u003ca href=\"#add\"\u003eAdd more content to the web \u003c/a\u003e\n  - \u003ca href=\"#delete\"\u003eRemove content from the web\u003c/a\u003e\n- \u003ca href=\"#decenwser-index\"\u003e**Decenwser Browser 💻**\u003c/a\u003e\n  - \u003ca href=\"#upload-web\"\u003eHow to upload a page to Decenwser?\u003c/a\u003e\n  - \u003ca href=\"#important\"\u003eImportant things to keep in mind\u003c/a\u003e\n  - \u003ca href=\"#change-network\"\u003eChange network\u003c/a\u003e\n  - \u003ca href=\"#save-web-locally\"\u003eSave a webpage locally\u003c/a\u003e\n  - \u003ca href=\"#get_page\"\u003eget_page()\u003c/a\u003e\n\n \u003c/details\u003e\n\n---\n\n\u003cdetails\u003e\n\u003csummary\u003eInstall the project📋\u003c/summary\u003e\n\n\u003cbr\u003e\n\nIf you're looking to install and run a project on your PC, it's important to follow a set of instructions to ensure everything runs smoothly. Below are some guidelines to help you get started\n\n\n\u003ch2\u003e Installation Guide \u003c/h2\u003e\nTo be able to install and run the project on your PC, you'll need to follow a set of instructions. Below are some guidelines to help you get started.\n\n\u003ch3 id=\"install-rust\"\u003e Install Rust 🦀 \u003c/h3\u003e\nRust is required to compile the code on your machine. To install Rust, follow the steps below:\n\nGo to the [official Rust website](https://www.rust-lang.org/tools/install)and select your operating system.\n\nFollow the instructions provided to download and install Rust.\n\nVerify that Rust has been installed correctly by running the following command in your terminal:\n\n```bash\nrustc --version\n```\nThis should print out the version of Rust that you just installed.\n\n\u003ch3 id=\"install-solana\"\u003e Install Solana 🌞 \u003c/h3\u003e\nSolana is required to connect to the blockchain and sign transactions. To install Solana, follow the steps below:\n\nGo to the [Solana CLI installation page](https://docs.solana.com/cli/install-solana-cli-tools#use-solanas-install-tool)..\n\nFollow the instructions provided to download and install the Solana CLI.\n\nVerify that Solana has been installed correctly by running the following command in your terminal:\n\n```bash\nsolana --version\n```\nThis should print out the version of Solana that you just installed.\n\n\u003ch3 id=\"install-node\"\u003e Install Node.js 🚀 \u003c/h3\u003e\nNode.js is required to mount decentralized servers. To install the latest version of Node.js, follow the steps below:\n\nGo to the [official Node.js website](https://nodejs.org/en/download/) and select your operating system.\n\nFollow the instructions provided to download and install Node.js.\n\nVerify that Node.js has been installed correctly by running the following command in your terminal:\n\n```bash\nnode --version\n```\nThis should print out the version of Node.js that you just installed.\n\n\u003ch3 id=\"source\"\u003e Download the source 🗂️ \u003c/h3\u003e\nTo download the source code and run the project, follow the steps below:\n\nClone the Decenwser repository by running the following command in your terminal:\n\n```bash\ngit clone https://github.com/mateolafalce/Decenwser.git\n```\nChange into the Decenwser directory by running the following command in your terminal:\n\n```bash\ncd Decenwser\n```\nBuild and run the project by running the following command in your terminal:\n\n```bash\ncargo run\n```\nThis should build and run the project, allowing you to interact with the decentralized servers.\n\n \u003c/details\u003e\n\n---\n\n\u003cdetails\u003e\n\u003csummary\u003eBlockchain program⛓️\u003c/summary\u003e\n\n\u003cbr\u003e\n\nAvailable [`here`](https://github.com/mateolafalce/Decenwser-blockchain-program)\n\nThe constant evolution of technology has given rise to a new paradigm that is revolutionizing the way we interact with the web. The web3 and decentralization are two concepts that have become the basis of a new digital age, where privacy and security are the priority.\n\nIn this context, the Decenwser browser has become a key tool to take advantage of the benefits of web3 and decentralization. This browser is designed to interact directly with the Solana blockchain network and its programmatic application, which consists of seven fundamental functions.\n\nThe first function is dedicated to the creation of the web domain, which allows establishing a unique and decentralized identity for the site. Functions two and three (html and js) focus on creating the respective PDAs (Permanent Data Files) that store the page content securely and reliably on the blockchain network.\n\nFunctions four and five (html and js) allow the modification of the PDA content by adding new data, which guarantees the constant updating of the site. Functions six and seven are dedicated to removing content from the web, allowing users to close their PDAs and receive the corresponding SOL (Solana's cryptocurrency) as a reward for their contribution to the network.\n\nThe Decenwser browser has become an essential tool for those looking to reap the benefits of web3 and decentralization. By allowing direct access to the Solana blockchain network and its programmatic application, users can enjoy a more secure and private online experience. In addition, the use of decentralized PDAs ensures the immutability of the page content and resistance to censorship, which guarantees that the content is available forever.\n\nIn summary, web3 and decentralization represent a new era of the web, where security, privacy and freedom are the main values. Decenwser has positioned itself as a key browser to reap these benefits, making it a must-have for users looking for a safer and more reliable online experience.\n\n---\n\n\u003ch3 id=\"main-account\" align=\"center\"\u003e Create a domain 💻\u003c/h3\u003e\n\n```rust\npub fn main_account(\n    ctx: Context\u003cMainAccountStruct\u003e,\n    web_name: String\n) -\u003e Result\u003c()\u003e {\n    require!(web_name.len() \u003c= 32, ErrorCode::TooLong);\n    let main_account: \u0026mut Account\u003cMainAccount\u003e = \u0026mut ctx.accounts.main_account;\n    let (_pda, bump) = Pubkey::find_program_address(\n          \u0026[\u0026anchor_lang::solana_program::hash::hash(web_name.as_bytes()).to_bytes()\n        ],\n        ctx.program_id\n    );\n    main_account.bump_original = bump;\n    main_account.web_name = web_name;\n    main_account.authority = ctx.accounts.signer.key();\n    main_account.html = 0;\n    main_account.js = 0;\n    msg!(\n        \"{} is part of the international decentralized information interchange. Authority: {}\",\n        main_account.web_name,\n        ctx.accounts.signer.key()\n    );\n    Ok(())\n}\n\n#[derive(Accounts)]\n#[instruction(web_name: String)]\npub struct MainAccountStruct\u003c'info\u003e {\n    #[account(init,\n        seeds = [\n              \u0026anchor_lang::solana_program::hash::hash(web_name.as_bytes()).to_bytes()\n            ],\n            bump,\n            payer = signer,\n            space = MainAccount::SIZE + 8\n        )\n    ]\n    pub main_account: Account\u003c'info, MainAccount\u003e,\n    #[account(mut)]\n    pub signer: Signer\u003c'info\u003e,\n    pub system_program: Program\u003c'info, System\u003e,\n}\n```\n\nThis function is designed to create the foundation for a user's domain on the network. The process begins by creating a PDA (Program Derived Address) which is used to store important data related to each code update, data retrieval, or deletion. This PDA is created using the web_name parameter passed into the function, which represents the name of the web domain being created.\n\nThe function checks that the length of the web_name parameter is no greater than 32 characters, to ensure compatibility with the Solana blockchain. Once the PDA is created, the transaction signer is saved as the account authority to ultimately emit a message in the transaction providing proof of what was saved.\n\nTwo crucial values are then created for content storage. The value corresponding to the size of the HTML or JS after each iteration will be saved there as a u16. This ensures that the amount of data stored is manageable and optimized for performance.\n\n\u003e It's worth noting that an alternative architecture was previously experimented with, where the size of the HTML and JS was a u64 that increased in value based on the content increase. However, this model was abandoned as it stored an excessively large amount of data for the web, with a limit of 1.660207e+22 compared to the current model's 648,796,500 characters.\n\nThe user's main account is then created and initialized with the PDA, and the values for HTML and JS are both set to 0. Finally, a message is emitted in the transaction indicating that the domain has been successfully created and that it is now part of the international decentralized information interchange.\n\nIt's important to note that while the domain itself (the PDA) cannot be removed from the network, all of its content stored within it can be. This decision was made to limit external interventions as much as possible in the websites rendered by Decenwser.\n\nOverall, this smart contract provides a secure and efficient way for users to create and manage their own domains on the Solana blockchain. By leveraging the power of decentralization, users can enjoy increased control and autonomy over their online presence, while also benefiting from improved security and performance.\n\n\u003cdiv align=\"center\"\u003e\n\n![inputs-main](/public/img/inputs-main.PNG)\n\n![create-account-main](/public/img/create-account-main.PNG)\n\n![main-account-logs](/public/img/main-account-logs.PNG)\n\n\u003c/div\u003e\n\n\u003c/details\u003e\n\n---\n\n\u003cdetails\u003e\n\u003csummary\u003eStore the content of the web page📝\u003c/summary\u003e\n\n\u003cbr\u003e\n\n```rust\npub fn html_store(\n    ctx: Context\u003cHtmlStore\u003e,\n    content: Vec\u003cu8\u003e\n) -\u003e Result\u003c()\u003e {\n    require!(\n        ctx.accounts.main_account.authority.key() == ctx.accounts.signer.key(),\n        ErrorCode::AuthorityError\n    );\n    let (_pda, bump) = Pubkey::find_program_address(\u0026[\n        b\"HTML\",\n        ctx.accounts.main_account.html.to_le_bytes().as_ref(),\n        ctx.accounts.main_account.key().as_ref()\n        ],\n        ctx.program_id);\n    let main_account: \u0026mut Account\u003cMainAccount\u003e = \u0026mut ctx.accounts.main_account;\n    let store: \u0026mut Account\u003cStoreAccount\u003e = \u0026mut ctx.accounts.store;\n    store.content = content;\n    store.bump_original = bump;\n    msg!(\n        \"New account stores the HTML content with seed = [HTML, {}, {}]\",\n        main_account.html,\n        main_account.key()\n    );\n    Ok(())\n}\n\n#[derive(Accounts)]\npub struct HtmlStore\u003c'info\u003e {\n    #[account(\n        mut,\n        seeds = [\n            \u0026anchor_lang::solana_program::hash::hash(\n                main_account.web_name.as_bytes()\n            ).to_bytes()\n            ],\n        bump = main_account.bump_original\n    )]\n    pub main_account: Account\u003c'info, MainAccount\u003e,\n    #[account(\n        init,\n        seeds =\n            [\n            b\"HTML\",\n            main_account.html.to_le_bytes().as_ref(),\n            main_account.key().as_ref()\n            ],\n        bump, payer = signer,\n        space = StoreAccount::SIZE + 8\n    )]\n    pub store: Account\u003c'info, StoreAccount\u003e,\n    #[account(mut)]\n    pub signer: Signer\u003c'info\u003e,\n    pub system_program: Program\u003c'info, System\u003e,\n}\n```\n\nThe HTML and JavaScript content storage in the Solana blockchain is made possible through the use of Programmable Data Accounts (PDAs), which offer a decentralized architecture for secure data storage. The html_store() function within the smart contract code is responsible for storing HTML content on the blockchain. It takes in a vector of bytes as an argument, which is a string converted to bytes in order to prevent issues with Rust special characters and non-UTF-8 characters such as emojis or non-Latin alphabets.\n\nTo ensure the security of the data, only the domain authority is able to update the website with new content. The PDA data, which includes the content and bump, is then saved in the account. The bump is a value generated by the program that is used to prevent replay attacks.\n\nSimilarly, the js_store() function is responsible for storing JavaScript content on the blockchain, and it follows the same logic as html_store(), but passes \"JS\" as bytes in the PDA.\n\nIt is worth noting that the functions are divided into two parts to use the available runtime data and avoid using external variables that could cause errors when initializing the account. This helps to ensure that the account initialization process is smooth and secure.\n\n\u003e Overall, the use of Solana's PDAs for content storage provides a number of benefits, including decentralization, security, and flexibility in terms of data formats. By leveraging this architecture, users can trust that their content is safe and accessible, while also enjoying the benefits of a decentralized network.\n\n\u003cdiv align=\"center\"\u003e\n\n![store-input](/public/img/store-input.PNG)\n\n![create-store](/public/img/create-store.PNG)\n\n![logs-store](/public/img/logs-store.PNG)\n\n\u003c/div\u003e\n\n\u003c/details\u003e\n\n---\n\n\u003cdetails\u003e\n\u003csummary\u003eAdd more content to the web📤\u003c/summary\u003e\n\n\u003cbr\u003e\n\n\n```rust\npub fn add_html(\n    ctx: Context\u003cAddHtml\u003e,\n    content: Vec\u003cu8\u003e\n) -\u003e Result\u003c()\u003e {\n    require!(\n        ctx.accounts.main_account.authority.key() == ctx.accounts.signer.key(),\n        ErrorCode::AuthorityError\n    );\n    require!(\n        ctx.accounts.store.content.len() \u003c 9900,\n        ErrorCode::Max9900\n    );\n    let main_account: \u0026mut Account\u003cMainAccount\u003e = \u0026mut ctx.accounts.main_account;\n    let store: \u0026mut Account\u003cStoreAccount\u003e = \u0026mut ctx.accounts.store;\n    store.content.extend(content);\n    msg!(\"The content of the PDA was updated.\");\n    if store.content.len() == 9900 {\n        main_account.html += 1;\n    }\n    Ok(())\n}\n\n#[derive(Accounts)]\npub struct AddHtml\u003c'info\u003e {\n    #[account(\n        mut,\n        seeds = [\n            \u0026anchor_lang::solana_program::hash::hash(\n                main_account.web_name.as_bytes()\n            ).to_bytes()\n            ],\n        bump = main_account.bump_original\n    )]\n    pub main_account: Account\u003c'info, MainAccount\u003e,\n    #[account(\n        mut,\n        seeds =\n            [\n            b\"HTML\",\n            main_account.html.to_le_bytes().as_ref(),\n            main_account.key().as_ref()\n            ],\n        bump = store.bump_original,\n        realloc = 8 + 4 + 1 + store.content.len() + 900,\n        realloc::payer = signer,\n        realloc::zero = false,\n    )]\n    pub store: Account\u003c'info, StoreAccount\u003e,\n    #[account(mut)]\n    pub signer: Signer\u003c'info\u003e,\n    pub system_program: Program\u003c'info, System\u003e,\n}\n```\n\nThe function add_html is a crucial part of the program that is responsible for updating the content of the PDA on the Solana blockchain. This function provides an efficient and effective way of increasing the storage space of the PDA by adding HTML/JS content to it. The function is implemented in Rust and consists of several steps that ensure the security and integrity of the data being stored.\n\nFirstly, the function verifies that the authority is the owner of the PDA by checking the signer key. Once the ownership is verified, the function checks the maximum allowed size of the PDA, which has been set at 9900 bytes of HTML/JS content. If the content to be added exceeds the maximum size, an error is returned.\n\nAfter verifying the ownership and maximum size of the PDA, the content is added to the PDA, and a global message is emitted to confirm the update. Furthermore, the function checks if the data volume has reached its maximum. If so, the .html or .js of the account is increased by one, which creates another PDA, and the data upload process continues seamlessly.\n\n\u003e This type of architecture was implemented in version 0.2.4, which allows for great performance when rendering the webpage. The function is part of a larger program that runs on the Solana blockchain and has several other functions that work together to create and manage the web domain. The program's main goal is to provide an efficient and decentralized way of hosting web content on the blockchain, which brings numerous benefits such as increased security, accessibility, and censorship resistance.\n\n\u003cdiv align=\"center\"\u003e\n\n![add-input](/public/img/add-input.PNG)\n\n![add-transfer](/public/img/add-transfer.PNG)\n\n![add-logs](/public/img/add-logs.PNG)\n\n\u003c/div\u003e\n\n\u003c/details\u003e\n\n---\n\n\u003cdetails\u003e\n\u003csummary\u003eRemove content from the web❌\u003c/summary\u003e\n\n\u003cbr\u003e\n\n```rust\npub fn delete_html(\n    ctx: Context\u003cDeleteHtml\u003e\n) -\u003e Result\u003c()\u003e {\n    require!(ctx.accounts.main_account.authority.key() == ctx.accounts.signer.key(), ErrorCode::AuthorityError);\n    let lamport: u64 = ctx.accounts.account.to_account_info().lamports() - 890880;\n    let main_account: \u0026mut Account\u003cMainAccount\u003e = \u0026mut ctx.accounts.main_account;\n    main_account.html -= 1;\n    **ctx.accounts.account.to_account_info().try_borrow_mut_lamports()? -= lamport;\n    **ctx.accounts.signer.to_account_info().try_borrow_mut_lamports()? += lamport;\n    msg!(\n        \"{} account removes HTML content and removes {} lamports from {} account\",\n        ctx.accounts.signer.key(),\n        lamport,\n        ctx.accounts.account.key()\n    );\n    Ok(())\n}\n#[derive(Accounts)]\npub struct DeleteHtml\u003c'info\u003e {\n    #[account(\n        mut,\n        seeds = [\n            \u0026anchor_lang::solana_program::hash::hash(\n                main_account.web_name.as_bytes()\n            ).to_bytes()\n        ],\n        bump = main_account.bump_original\n    )]\n    pub main_account: Account\u003c'info, MainAccount\u003e,\n    #[account(\n        mut,\n        seeds = [\n            b\"HTML\",\n            main_account.html.to_le_bytes().as_ref(),\n            main_account.key().as_ref()\n        ],\n        bump = account.bump_original,\n        close = signer\n    )]\n    pub account: Account\u003c'info, StoreAccount\u003e,\n    #[account(mut)]\n    pub signer: Signer\u003c'info\u003e,\n    pub system_program: Program\u003c'info, System\u003e,\n}\n```\n\nThe function described in this code focuses on deleting the contents of a PDA (Permanent Data Files) and returning SOLs (Solana's cryptocurrency) to the creator. This process is carried out through a series of verifications and actions that ensure the security and integrity of the Solana blockchain network.\n\nThe first check performed in this function is the authority of the signer, which ensures that the person performing the action has the necessary permissions to do so. Once the authority is verified, we proceed to obtain the SOLs from the PDA and subtract them from the corresponding account.\n\nTo carry out this operation, the information stored in the main account and in the PDA account is used, including the seed, the bump and the address of the accounts. In addition, a SOL transaction takes place between the signer's account and the PDA's account, ensuring that SOLs are returned to the creator safely and reliably.\n\nFinally, a message is issued informing users about the details of the operation performed. This includes the address of the signer, the number of SOLs removed, and the address of the corresponding PDA account.\n\nThis function is a critical part of the programmatic application that runs on the Solana blockchain network. Its goal is to ensure the security and privacy of users by removing content from PDAs and reliably returning SOLs to their creator. By following a series of carefully designed checks and actions, this feature ensures that content removal is done effectively and securely, making it an essential part of the programmatic application on the Solana blockchain network.\n\n\u003cdiv align=\"center\"\u003e\n\n![delete-input](/public/img/delete-input.PNG)\n\n![delete-accounts](/public/img/delete-accounts.PNG)\n\n![delete-logs](/public/img/delete-logs.PNG)\n\n\u003c/div\u003e\n\n\u003c/details\u003e\n\n---\n\n\u003cdetails\u003e\n\u003csummary\u003eDecenwser browser concept💻\u003c/summary\u003e\n\n\u003cbr\u003e\n\nIn this section, all aspects related to the operation of the browser will be analyzed. The rationale for the general development framework used and its performance will be addressed. The key features of the browser will be examined and its advantages and disadvantages in relation to other browsers will be discussed. The different components of the browser will also be explored, including its rendering engine and its Node.js and Rocket.rs engine, as well as the underlying technologies that make them possible. In general, this section will provide a detailed insight into the inner workings of the browser and help users better understand its operation and performance.\n\n\u003c/details\u003e\n\n---\n\n\u003cdetails\u003e\n\u003csummary\u003eHow to upload a page to Decenwser?👀\u003c/summary\u003e\n\n\u003cbr\u003e\n\nTo upload a web page using Decenwser, you will first need to download the browser and compile the HTML and JavaScript files into two separate files. Once you have completed this, you can go to the \"Upload a web\" option located in the top bar of the Decenwser browser.\n\nThe upload process involves the following steps:\n\n- The code is converted into bytes, enabling it to be sent to the Solana blockchain.\n- The user is then prompted to create a unique domain to host the uploaded HTML and JavaScript files. During this process, the wallet will be required to sign the transaction and any subsequent ones.\n- Next, the HTML file is sent to the blockchain.\n- Finally, the JavaScript file is sent to the blockchain.\n\nOverall, the upload process is simple and intuitive to execute. However, it's important to note that uploading data to the blockchain can sometimes take a while. For example, a page created with React and compiled with webpack, containing approximately 400,000 lines of code, may take between 3 to 4.5 hours to upload, depending on the user's internet connectivity. Despite this, the benefits of using a decentralized platform like Decenwser far outweigh the temporary inconvenience of a longer upload time, as it provides a secure and trustless way to host your content without relying on centralized intermediaries.\n\n\u003c/details\u003e\n\n---\n\n\u003cdetails\u003e\n\u003csummary\u003eImportant things to keep in mind❗\u003c/summary\u003e\n\n\u003cbr\u003e\n\nWhen you are developing an app for Decenwser, the .js file should be called from the HTML as a\n\n```html\n\u003cscript src=\"../js.js\"\u003e\u003c/script\u003e\n```\nThis line of code is crucial for your application to run correctly on Decenwser's platform. By calling the .js file from the HTML, you ensure that all elements of your application load correctly and communicate effectively.\n\nIt is important to note that the .js file must be located in the same folder as the corresponding HTML file. Otherwise, the Decenwser platform will not be able to find and load the .js file, which could lead to errors and crashes in the application.\n\nIn conclusion, by calling the .js file from the HTML properly, you are ensuring that your application works effectively on Decenwser's platform. Therefore, it is important to follow these instructions to ensure success in developing your app on this decentralized platform.\n\nYou have to add a CDN link depending on the framework you are working with, like React for example.\n\n```html\n\u003cscript\n  crossorigin\n  src=\"https://unpkg.com/react@18/umd/react.production.min.js\"\n\u003e\u003c/script\u003e\n\u003cscript\n  crossorigin\n  src=\"https://unpkg.com/react-dom@18/umd/react-dom.production.min.js\"\n\u003e\u003c/script\u003e\n```\n\nTo compile the code and produce two outputs in production mode, it is necessary to configure Webpack and Babel appropriately. Here we present a template so that you only have to write the corresponding web logic.\n\nWebpack is a tool used to package and compile the source code of a web application into a set of smaller, browser-optimized files. To do this, it is necessary to correctly configure the Webpack configuration file, so that the inputs, outputs, and different modules to be used are specified.\n\nFor its part, Babel is a code compiler used to convert modern JavaScript code to a version compatible with older browsers. To do this, you must install the necessary plugins and presets and configure the Babel configuration file according to the needs of the application.\n\nOnce Webpack and Babel have been properly configured, you must ensure that two outputs are produced in production mode. This can be achieved by configuring Webpack to generate two different output files, one for the JavaScript code and one for the CSS styles. These files can be minified and optimized for faster page load.\n\n[link here](https://github.com/mateolafalce/template-decenwser-app)\n\nIt includes a React CDN link, but you can use any.\n\n\u003e The wallet is only stored in the application signing process and in case of modifying or deleting content. After that, it is cleaned of the data by the system program.\n\nThe images in Decenwser must be imported from either traditional servers or decentralized servers. Currently, storing images passed to base64 on the blockchain is very expensive. If a user chooses to do so, they do it at their own risk. From banners to the favicon, they must be externally imported with links into the application's source code running on Decenwser.\n\n\u003c/details\u003e\n\n---\n\u003cdetails\u003e\n\u003csummary\u003eChange Network♻️\u003c/summary\u003e\n\n\u003cbr\u003e\n\nIf you want to switch between Devnet and Mainnet in the app, you can do it through the main panel. Just select the network you want to navigate with a single click. When you switch networks, all of the app's state will automatically adjust to your needs, whether it's for development or browsing.\n\nThis process is very simple and easy to perform, and it allows you to switch between both networks without problems. In addition, by doing so, you will be able to access all the functionalities and tools available in each one of them.\n\nBy changing networks, you will also be able to test your application in different environments, allowing you to ensure that it works correctly in all possible scenarios. This is especially important if you are developing an application for use on the blockchain network, as you will need to ensure its compatibility and functionality in all possible environments.\n\n\n\u003cdiv align=\"center\"\u003e\n\n  ![change-network](/public/img/change-network.PNG)\n\n\u003c/div\u003e\n\n\u003c/details\u003e\n\n---\n\n\u003cdetails\u003e\n\u003csummary\u003eSave a webpage locally⛺\u003c/summary\u003e\n\n\u003cbr\u003e\n\nIf you want to avoid having to wait for content to load directly from the blockchain every time you access the page, there is a simple solution: you can store the app locally in your browser. To do this, simply press Ctrl + d and you will be able to access the page immediately on your next searches.\n\nIt is important to note that this function stores the content of the page at the time of saving it. If the page's source code is updated (but not necessarily the content), you'll need to delete the app from the browser and save it again to access the latest version.\n\nTo remove the application from the browser, just go to the applications tab on the main page of the browser and select the application you want to remove. Once you've deleted the app, you can save it again to access the updated version.\n\nStoring the app locally in the browser can be a great way to save time by accessing content faster. However, it is important to note that this function stores the current version of the page, so if the source code is updated, you need to delete the app from the browser and save it again to access the most recent version.\n\n\u003c/details\u003e\n\n---\n\n\u003cdetails\u003e\n\u003csummary\u003efn get_page()📬\u003c/summary\u003e\n\n\u003cbr\u003e\n\nThe get_page() function is responsible for fetching the content of the PDAs from the Solana blockchain and rendering them in the app. The speed at which this process occurs varies depending on the version being used, as shown in the table below:\n\n\u003cdiv align=\"center\"\u003e\n\n| Version | Speed      |\n| ------- | ---------- |\n| 0.1.0   | 2278.01 ms |\n| 0.1.1   | 1087.94 ms |\n| 0.2.0   | 724.38 ms  |\n| 0.2.1   | 463.14 ms  |\n| 0.2.2   | 283.75 ms  |\n| 0.2.3   | 343.09 ms  |\n| 0.2.4   | 108.26 ms  |\n\n\u003c/div\u003e\n\n\u003e The current version (0.2.4) of the architecture is the most efficient, having solved the problem of iterative volume with the PDAs during rendering. Additionally, it is worth noting that the PDAs now pass bytes instead of strings, further improving the efficiency of the process. Overall, the get_page() function plays a crucial role in enabling users to access and view the content stored on the decentralized web3 platform.\n\n\u003c/details\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmateolafalce%2Fdecenwser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmateolafalce%2Fdecenwser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmateolafalce%2Fdecenwser/lists"}