Nervos’ two most important technical advantages

Beginner3/11/2024, 12:32:17 PM
This article introduces the two major advantages of the Nervos public chain from a technical perspective - custom cryptography and account abstraction.

Custom cryptography

Byte Jun will first introduce to everyone what cryptography is. in short,Cryptography is the science that studies how to encrypt and how to decrypt.。

Encryption and decryption have been around since ancient times, such as the famous “Caesar cipher”. Caesar is the founder of the Roman Empire. He is regarded by some historians as the uncrowned emperor of the Roman Empire and is known as “Caesar the Great”. In fact, Caesar himself was very keen on writing secret texts.

During the war in Gaul (now southern France), Caesar not only defeated his enemies, but also established an extensive and deep intelligence network. In the records of the Gallic War, it is mentioned how his friend, the Roman general Cicero, had messages passed to him in cipher text when he was surrounded. Caesar used the form of cipher text to avoid “when the message is intercepted by the enemy, our countermeasures will not be discovered by the enemy.”

This classic ciphertext is “VIMRJSVGIQIRXW SRXLI AEC”, which is encrypted through a four-bit shift, such as the initial letter R+4=V. After deciphering the cipher text, the plain text obtained is “REINFORCEMENTS ON THE WAY”, which means “reinforcements are on the way.”

Therefore, the Caesar cipher actually encrypts the letters by moving the letters in the plain text backward according to a fixed number.

With the development of the times, encryption and decryption gradually evolved into a science - cryptography.Before the emergence of blockchain, cryptography had many applications in the Internet, such as the most famous asymmetric encryption algorithm RSA. Here, Byte Jun will first introduce to everyone what is symmetric encryption and what is asymmetric encryption.

Symmetric encryption means that the same key is used for encryption and decryption. To make an analogy to help everyone understand, we compare encryption to locking and decryption to unlocking. Symmetric encryption means that the same key is used for locking and unlocking. Therefore, the disadvantage is that both parties to the transaction use the same key, and security cannot be guaranteed.

Asymmetric encryption has two keys, one of which is a public key (public key) and the other is a private key (private key). This is like a lock with two keys A and B. Key A is required to lock the lock and key B is required to open the lock.

RSA encryption algorithm is an asymmetric encryption algorithm. Many Internet protocols used RSA before, and now RSA is also the most widely used and most compatible asymmetric encryption algorithm in various browsers and email protocols.

The reason why the Internet has developed to its current scale, taking into account both security and convenience, is inseparable from the extensive use of passwords.For example, SubtleCrypto, an algorithm almost found in browsers, can even be used in small program environments; and the WebAuthn algorithm, which became a W3C recommended standard in 2019, makes browser cryptography as powerful as a hardware wallet, and using It is very convenient to use (can be unlocked by fingerprint, face scan, etc.).

Returning to the blockchain, if these Internet cryptographic infrastructures can be used directly, instead of requiring users to download wallet plug-ins and apps, and follow the process to store mnemonic phrases themselves, the user threshold for dApps can be significantly lowered.

However, the cryptography of mainstream blockchains is generally hard-coded at the bottom level.for example:

The signature algorithms of these blockchains are incompatible with the cryptography systems used on the mainstream Internet and cannot be used directly. They can only rely on re-installed facilities.

The difference between the Nervos CKB public chain is that you can use custom cryptography, and the cryptography is not hard-coded at the bottom.This means that when you develop applications on Nervos, you can use the cryptography system used by the mainstream Internet, or even directly call the existing Internet infrastructure.

Specifically, the Nervos CKB virtual machine can deploy cryptography directly in the application layer (smart contract), so that we can deploy the asymmetric encryption algorithms RSA, SHA-256, etc. mentioned above. This lays the foundation for using existing infrastructure. However, this alone is not enough. Nervos also needs the following capabilities -Account abstraction。

Account abstraction

The word “abstract” itself is very abstract.

Abstraction itself is a relatively technical word. There are two explanations. We only need to pay attention to the first one: the so-called abstraction is a process. We remove the particularity from a system, and then create generality and universality from the system. This is a process of generalization. By removing special designs and finding commonalities, the system can become more general and applicable to more scenarios.

This explanation may still be very abstract, but the key words everyone needs to remember areRemove “particularity”, remove “particularity” from the system, find more commonalities in the system, put commonalities into the design, and create “generality”。

Let’s explain with a not-so-blockchain example. You may have played the large arcade machines in the game hall. If you understand this kind of machine, you will know that each machine actually corresponds to a game. For arcade machines, system design is an integrated design from software to hardware. All designs serve one purpose, which is this game. When we need to create another new game, I need to design another new machine, so there are ten or twenty machines in the arcade, each with a different game.

As the gaming industry has developed to this day, the most popular thing is no longer arcade machines, but more general gaming platforms like XBox. XBox is a general design. You can design a variety of games for XBox, and then you can only buy different games to run on this system.

Therefore, from arcade to XBOX is a generalization process. From another perspective, XBox is a design with a higher level of abstraction and can be applied to more scenarios. There are very few, almost none, special things built for each specific game. It is precisely because it does not have those special details that developers on this platform can fill in the details so that the platform can adapt to a variety of needs.

Back to Nervos CKB. The second technical advantage of the CKB public chain is account abstraction.The so-called account abstraction refers to the ability to generalize the unlocking logic of blockchain accounts (addresses).

Currently, the unlocking logic of mainstream blockchains is relatively simple, direct, and hard-coded at the protocol level. For example, for BTC and ETH, the public key is restored based on the transaction body and signature, and then the public key is converted into an address according to established rules. Finally, it matches the address to be unlocked. If they are consistent, the unlocking is successful, otherwise the unlocking fails.

This kind of hard-coded logic cannot adapt to some broader situations, such as client-related data built into the signature, or even the signature is not specific to the transaction itself. To facilitate understanding, let us make an analogy:The unlocking logic of mainstream blockchains is the same as that of mechanical door locks, which can only open the account door in one way.

Nervos, which implements account abstraction capabilities at the bottom level, is equivalent to having an electronic lock. Its unlocking logic can be through passwords, fingerprints, Bluetooth, NFC, etc.For example, we can use the cryptography of Email to unlock it, and then execute the contract according to the instructions in the Email. The simplest example is to send CKB directly to the specified address (or another mailbox) by sending an email, and the whole process does not require any steps. Requires the participation of any “wallet”.

This is the benefit of account abstraction.

Disclaimer:

  1. This article is reprinted from [Byte CKB], All copyrights belong to the original author [Byte Jun]. If there are objections to this reprint, please contact the Gate Learn team, and they will handle it promptly.
  2. Liability Disclaimer: The views and opinions expressed in this article are solely those of the author and do not constitute any investment advice.
  3. Translations of the article into other languages are done by the Gate Learn team. Unless mentioned, copying, distributing, or plagiarizing the translated articles is prohibited.

Nervos’ two most important technical advantages

Beginner3/11/2024, 12:32:17 PM
This article introduces the two major advantages of the Nervos public chain from a technical perspective - custom cryptography and account abstraction.

Custom cryptography

Byte Jun will first introduce to everyone what cryptography is. in short,Cryptography is the science that studies how to encrypt and how to decrypt.。

Encryption and decryption have been around since ancient times, such as the famous “Caesar cipher”. Caesar is the founder of the Roman Empire. He is regarded by some historians as the uncrowned emperor of the Roman Empire and is known as “Caesar the Great”. In fact, Caesar himself was very keen on writing secret texts.

During the war in Gaul (now southern France), Caesar not only defeated his enemies, but also established an extensive and deep intelligence network. In the records of the Gallic War, it is mentioned how his friend, the Roman general Cicero, had messages passed to him in cipher text when he was surrounded. Caesar used the form of cipher text to avoid “when the message is intercepted by the enemy, our countermeasures will not be discovered by the enemy.”

This classic ciphertext is “VIMRJSVGIQIRXW SRXLI AEC”, which is encrypted through a four-bit shift, such as the initial letter R+4=V. After deciphering the cipher text, the plain text obtained is “REINFORCEMENTS ON THE WAY”, which means “reinforcements are on the way.”

Therefore, the Caesar cipher actually encrypts the letters by moving the letters in the plain text backward according to a fixed number.

With the development of the times, encryption and decryption gradually evolved into a science - cryptography.Before the emergence of blockchain, cryptography had many applications in the Internet, such as the most famous asymmetric encryption algorithm RSA. Here, Byte Jun will first introduce to everyone what is symmetric encryption and what is asymmetric encryption.

Symmetric encryption means that the same key is used for encryption and decryption. To make an analogy to help everyone understand, we compare encryption to locking and decryption to unlocking. Symmetric encryption means that the same key is used for locking and unlocking. Therefore, the disadvantage is that both parties to the transaction use the same key, and security cannot be guaranteed.

Asymmetric encryption has two keys, one of which is a public key (public key) and the other is a private key (private key). This is like a lock with two keys A and B. Key A is required to lock the lock and key B is required to open the lock.

RSA encryption algorithm is an asymmetric encryption algorithm. Many Internet protocols used RSA before, and now RSA is also the most widely used and most compatible asymmetric encryption algorithm in various browsers and email protocols.

The reason why the Internet has developed to its current scale, taking into account both security and convenience, is inseparable from the extensive use of passwords.For example, SubtleCrypto, an algorithm almost found in browsers, can even be used in small program environments; and the WebAuthn algorithm, which became a W3C recommended standard in 2019, makes browser cryptography as powerful as a hardware wallet, and using It is very convenient to use (can be unlocked by fingerprint, face scan, etc.).

Returning to the blockchain, if these Internet cryptographic infrastructures can be used directly, instead of requiring users to download wallet plug-ins and apps, and follow the process to store mnemonic phrases themselves, the user threshold for dApps can be significantly lowered.

However, the cryptography of mainstream blockchains is generally hard-coded at the bottom level.for example:

The signature algorithms of these blockchains are incompatible with the cryptography systems used on the mainstream Internet and cannot be used directly. They can only rely on re-installed facilities.

The difference between the Nervos CKB public chain is that you can use custom cryptography, and the cryptography is not hard-coded at the bottom.This means that when you develop applications on Nervos, you can use the cryptography system used by the mainstream Internet, or even directly call the existing Internet infrastructure.

Specifically, the Nervos CKB virtual machine can deploy cryptography directly in the application layer (smart contract), so that we can deploy the asymmetric encryption algorithms RSA, SHA-256, etc. mentioned above. This lays the foundation for using existing infrastructure. However, this alone is not enough. Nervos also needs the following capabilities -Account abstraction。

Account abstraction

The word “abstract” itself is very abstract.

Abstraction itself is a relatively technical word. There are two explanations. We only need to pay attention to the first one: the so-called abstraction is a process. We remove the particularity from a system, and then create generality and universality from the system. This is a process of generalization. By removing special designs and finding commonalities, the system can become more general and applicable to more scenarios.

This explanation may still be very abstract, but the key words everyone needs to remember areRemove “particularity”, remove “particularity” from the system, find more commonalities in the system, put commonalities into the design, and create “generality”。

Let’s explain with a not-so-blockchain example. You may have played the large arcade machines in the game hall. If you understand this kind of machine, you will know that each machine actually corresponds to a game. For arcade machines, system design is an integrated design from software to hardware. All designs serve one purpose, which is this game. When we need to create another new game, I need to design another new machine, so there are ten or twenty machines in the arcade, each with a different game.

As the gaming industry has developed to this day, the most popular thing is no longer arcade machines, but more general gaming platforms like XBox. XBox is a general design. You can design a variety of games for XBox, and then you can only buy different games to run on this system.

Therefore, from arcade to XBOX is a generalization process. From another perspective, XBox is a design with a higher level of abstraction and can be applied to more scenarios. There are very few, almost none, special things built for each specific game. It is precisely because it does not have those special details that developers on this platform can fill in the details so that the platform can adapt to a variety of needs.

Back to Nervos CKB. The second technical advantage of the CKB public chain is account abstraction.The so-called account abstraction refers to the ability to generalize the unlocking logic of blockchain accounts (addresses).

Currently, the unlocking logic of mainstream blockchains is relatively simple, direct, and hard-coded at the protocol level. For example, for BTC and ETH, the public key is restored based on the transaction body and signature, and then the public key is converted into an address according to established rules. Finally, it matches the address to be unlocked. If they are consistent, the unlocking is successful, otherwise the unlocking fails.

This kind of hard-coded logic cannot adapt to some broader situations, such as client-related data built into the signature, or even the signature is not specific to the transaction itself. To facilitate understanding, let us make an analogy:The unlocking logic of mainstream blockchains is the same as that of mechanical door locks, which can only open the account door in one way.

Nervos, which implements account abstraction capabilities at the bottom level, is equivalent to having an electronic lock. Its unlocking logic can be through passwords, fingerprints, Bluetooth, NFC, etc.For example, we can use the cryptography of Email to unlock it, and then execute the contract according to the instructions in the Email. The simplest example is to send CKB directly to the specified address (or another mailbox) by sending an email, and the whole process does not require any steps. Requires the participation of any “wallet”.

This is the benefit of account abstraction.

Disclaimer:

  1. This article is reprinted from [Byte CKB], All copyrights belong to the original author [Byte Jun]. If there are objections to this reprint, please contact the Gate Learn team, and they will handle it promptly.
  2. Liability Disclaimer: The views and opinions expressed in this article are solely those of the author and do not constitute any investment advice.
  3. Translations of the article into other languages are done by the Gate Learn team. Unless mentioned, copying, distributing, or plagiarizing the translated articles is prohibited.
Start Now
Sign up and get a
$100
Voucher!