Electronic device included in blockchain network and operation method thereof
The electronic device in the blockchain network addresses inefficiencies in block addition and synchronization by verifying block information, generating new transaction data, and managing block addition through consensus processes, enhancing data integrity and reducing conflicts.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- SAMSUNG ELECTRONICS CO LTD
- Filing Date
- 2025-12-11
- Publication Date
- 2026-06-18
AI Technical Summary
In blockchain networks, existing methods for adding new blocks and managing node synchronization are inefficient and prone to consensus conflicts, leading to data integrity issues and synchronization failures.
An electronic device acting as a node in the blockchain network includes a communication circuit, processor, and memory to manage block addition and synchronization by verifying block information, generating new transaction data, and initiating consensus processes to add new blocks while deleting old blocks, ensuring data integrity and synchronization.
The solution enhances the efficiency of block addition and synchronization, reducing consensus conflicts and ensuring data integrity by implementing a method that includes verifying block information, generating new transaction data, and managing block addition through consensus processes.
Smart Images

Figure KR2025021383_18062026_PF_FP_ABST
Abstract
Description
Electronic device included in a blockchain network and method of operation thereof
[0001] The present disclosure relates to an electronic device included in a blockchain network and a method of operating the same.
[0002] Since the release of Bitcoin based on blockchain, blockchain is being applied in various fields, including not only electronic currency (cryptocurrency or virtual currency) systems like Bitcoin, but also platform provision services based on smart contracts, copyright management and trading services through NFTs (non-fungible tokens), cloud storage services, and blockchain computing services.
[0003] In a blockchain platform, data forgery or alteration is virtually impossible (reliability) because participating members (nodes) store data in a distributed manner across their respective blocks; members can each possess their own distributed information (transparency); and there is no need for a separate central server administrator.
[0004] The information described above may be provided as related art for the purpose of aiding understanding of the present disclosure. No claim or determination is made as to whether any of the foregoing may be applied as prior art related to the present disclosure.
[0005] According to one embodiment of the present disclosure, an electronic device corresponding to one of the nodes included in a blockchain network includes a communication circuit, at least one processor including a processing circuit, and a memory for storing instructions.
[0006] According to one embodiment, when the instructions are executed individually or collectively by the at least one processor, the electronic device requests the server to add a new block to the nodes based on identifying that the number of blocks accumulated in the memory identified based on the information about the confirmed block is equal to the specified block capacity, based on identifying that the number of blocks accumulated in the memory identified based on the information about the confirmed block is equal to the specified block capacity, and via the communication circuit, transmits information related to consensus to the server to extract transaction information for the last block corresponding to the number of blocks in the nodes, generate new transaction information based on the extracted transaction information, and initialize the blocks already stored in the nodes, transmits the new transaction information to the server so that the new transaction information to be stored in the new block is transmitted to the nodes via the server, and, based on the success of the consensus for the addition of the new block, adds the new block to the memory with the previously accumulated blocks deleted from the memory.
[0007] According to one embodiment of the present disclosure, an electronic device corresponding to one of the nodes included in a blockchain network includes a communication circuit, at least one processor including a processing circuit, and a memory for storing instructions.
[0008] According to one embodiment, when the instructions are executed individually or collectively by the at least one processor, the electronic device checks information regarding the last stored block in the nodes through a server configured to relay message transmission between the nodes included in the blockchain network via the communication circuit, requests the server to add a new block to the nodes based on the information regarding the checked block, checks version information for synchronization between the nodes included in the blockchain network via the server based on identifying that a new node has been added to the blockchain network via the server, transmits information related to a consensus to the server to synchronize based on the lower version based on identifying that the version information of the new node is a lower version, and, based on the success of the consensus for the addition of the new block, adds the new block of the lower version to the memory with the previously accumulated higher version blocks deleted.
[0009] According to one embodiment of the present disclosure, an electronic device that is one of the nodes included in a blockchain network comprises a communication circuit, at least one processor including a processing circuit, and a memory for storing instructions.
[0010] According to one embodiment, the instructions, when executed by the at least one processor, cause the electronic device to check information regarding the last stored block in the nodes through a server configured to relay message transmission between nodes included in the blockchain network via the communication circuit, identify a stable number and an unstable number based on identifying that synchronization between the nodes has failed, re-perform synchronization by restoring the block of the first node having the unstable number to become a stable number at the next consensus based on the blocks of the second node having the stable number, request a consensus through the server to add a new block to each node based on the stable number, and add a new block to the memory based on the success of the consensus.
[0011] According to one embodiment of the present disclosure, a method of operation in an electronic device corresponding to one of the nodes included in a blockchain network comprises: verifying information regarding the last block stored in the nodes through a server configured to relay message transmission between the nodes included in the blockchain network via a communication circuit of the electronic device; requesting the server to add a new block to the nodes based on identifying that the number of blocks accumulated in the memory verified based on the verified information regarding the block is equal to a specified block capacity; extracting transaction information regarding the last block corresponding to a number of the specified transaction capacity in the nodes via the communication circuit; generating new transaction information based on the extracted transaction information; transmitting information related to a consensus to initialize the blocks already stored in the nodes to the server; transmitting the new transaction information to the server so that the new transaction information to be stored in the new block is transmitted to the nodes via the server; and adding the new block to the memory with the previously accumulated blocks deleted from the memory based on the success of the consensus for adding the new block.
[0012] According to one embodiment of the present disclosure, in a non-transient storage medium storing one or more programs, the one or more programs, when executed by at least one processor of an electronic device, cause the electronic device to verify information regarding the last stored block in the nodes through a server configured to relay message transmission between the nodes included in the blockchain network via a communication circuit of the electronic device; request the server to add a new block to the nodes based on identifying that the number of blocks accumulated in the memory verified based on the verified information regarding the block is equal to a specified block capacity; extract transaction information regarding the last block corresponding to a number of specified transaction capacities in the nodes via the communication circuit; generate new transaction information based on the extracted transaction information; transmit information related to a consensus to the server to initialize the blocks already stored in the nodes; transmit the new transaction information to the server so that the new transaction information to be stored in the new block is transmitted to the nodes via the server; and add the new block to the memory with the previously accumulated blocks deleted from the memory based on the success of the consensus for the addition of the new block. Includes commands that cause actions to be executed.
[0013] The technical problems to be solved in this disclosure are not limited to those mentioned above, and other technical problems not mentioned will be clearly understood by those skilled in the art to which this disclosure pertains.
[0014] FIG. 1 is a block diagram of an electronic device in a network environment according to various embodiments.
[0015] FIG. 2a is a schematic diagram of an electronic system according to one embodiment.
[0016] FIG. 2b is a block diagram of nodes and servers included in a blockchain network according to one embodiment.
[0017] FIGS. 3A, FIGS. 3B, FIGS. 3C, FIGS. 3D, FIGS. 3E, and FIGS. 3F are drawings illustrating a method for an electronic device included in a blockchain network according to one embodiment to add a new block.
[0018] FIG. 4 is a drawing for explaining information related to a block according to one embodiment.
[0019] FIG. 5 is a diagram illustrating an example of data cleanup for blocks accumulated in memory when an electronic device included in a blockchain network according to one embodiment adds a new block that exceeds the block capacity.
[0020] FIG. 6 is a diagram illustrating an example of data cleanup for blocks accumulated in memory when an electronic device included in a blockchain network according to one embodiment adds a new block that exceeds the block capacity.
[0021] FIGS. 7a and 7b are drawings illustrating examples of tables for state maps stored in a server included in a blockchain network according to one embodiment.
[0022] FIG. 8 is a diagram illustrating an example of data cleanup for blocks of higher versions accumulated in memory when a lower version node is added to an electronic device included in a blockchain network according to one embodiment.
[0023] FIGS. 9A, FIGS. 9B, FIGS. 9C, and FIGS. 9D are drawings illustrating examples of blockchain operation in an electronic device included in a blockchain network according to one embodiment.
[0024] FIG. 10 is a flowchart illustrating a method for cleaning up data on blocks accumulated in memory when an electronic device included in a blockchain network according to one embodiment adds a new block that exceeds the block capacity.
[0025] FIG. 11 is a flowchart illustrating a method for cleaning up data regarding blocks of higher versions accumulated in memory when a lower version node is added to an electronic device included in a blockchain network according to one embodiment.
[0026] FIG. 12 is a flowchart illustrating a method for operating a blockchain in an electronic device included in a blockchain network according to one embodiment.
[0027] In relation to the description of the drawings, the same or similar reference numerals may be used for identical or similar components.
[0028] Hereinafter, embodiments of the present disclosure are described in detail with reference to the drawings so that those skilled in the art can easily implement them. However, the present disclosure may be embodied in various different forms and is not limited to the embodiments described herein. In relation to the description of the drawings, the same or similar reference numerals may be used for identical or similar components. Furthermore, in the drawings and related descriptions, descriptions of well-known functions and configurations may be omitted for clarity and brevity. The term "user" as used in the embodiments of the present disclosure may refer to a person using an electronic device or a device using an electronic device (e.g., an artificial intelligence electronic device).
[0029] FIG. 1 is a block diagram of an electronic device (101) in a network environment (100) according to various embodiments.
[0030] Referring to FIG. 1, in a network environment (100), an electronic device (101) may communicate with an electronic device (102) through a first network (198) (e.g., a short-range wireless communication network) or with at least one of an electronic device (104) or a server (108) through a second network (199) (e.g., a long-range wireless communication network). According to one embodiment, the electronic device (101) may communicate with the electronic device (104) through a server (108). According to one embodiment, the electronic device (101) may include a processor (120), memory (130), input module (150), sound output module (155), display module (160), audio module (170), sensor module (176), interface (177), connection terminal (178), haptic module (179), camera module (180), power management module (188), battery (189), communication module (190), subscriber identification module (196), or antenna module (197). In some embodiments, at least one of these components (e.g., connection terminal (178)) may be omitted from the electronic device (101), or one or more other components may be added. In some embodiments, some of these components (e.g., sensor module (176), camera module (180), or antenna module (197)) may be integrated into a single component (e.g., display module (160)).
[0031] The processor (120) can control at least one other component (e.g., hardware or software component) of the electronic device (101) connected to the processor (120) by executing software (e.g., program (140)), for example, and can perform various data processing or operations. According to one embodiment, as at least part of the data processing or operations, the processor (120) can store commands or data received from other components (e.g., sensor module (176) or communication module (190)) in volatile memory (132), process the commands or data stored in volatile memory (132), and store the resulting data in non-volatile memory (134). According to one embodiment, the processor (120) may include a main processor (121) (e.g., central processing unit or application processor) or an auxiliary processor (123) that can operate independently or together with it (e.g., graphics processing unit, neural processing unit (NPU), image signal processor, sensor hub processor, or communication processor). For example, if the electronic device (101) includes a main processor (121) and an auxiliary processor (123), the auxiliary processor (123) may be configured to use lower power than the main processor (121) or to be specialized for a designated function. The auxiliary processor (123) may be implemented separately from the main processor (121) or as part thereof.
[0032] The auxiliary processor (123) may control at least some of the functions or states associated with at least one component of the electronic device (101) (e.g., display module (160), sensor module (176), or communication module (190)) on behalf of the main processor (121) while the main processor (121) is in an inactive (e.g., sleep) state, or together with the main processor (121) while the main processor (121) is in an active (e.g., application execution) state. According to one embodiment, the auxiliary processor (123) (e.g., image signal processor or communication processor) may be implemented as part of another functionally related component (e.g., camera module (180) or communication module (190)). According to one embodiment, the auxiliary processor (123) (e.g., neural network processing unit) may include a hardware structure specialized for processing an artificial intelligence model. The artificial intelligence model may be generated through machine learning. Such learning may be performed, for example, on the electronic device (101) itself where the artificial intelligence model is executed, or through a separate server (e.g., server (108)). The learning algorithm may include, for example, supervised learning, unsupervised learning, semi-supervised learning, or reinforcement learning, but is not limited to the examples described above. The artificial intelligence model may include a plurality of artificial neural network layers.An artificial neural network may be a deep neural network (DNN), a convolutional neural network (CNN), a recurrent neural network (RNN), a restricted Boltzmann machine (RBM), a deep belief network (DBN), a bidirectional recurrent deep neural network (BRDNN), a deep Q-network, or a combination of two or more of the above, but is not limited to the examples described above. In addition to the hardware structure, the artificial intelligence model may include a software structure, either additionally or substantially.
[0033] The memory (130) can store various data used by at least one component of the electronic device (101) (e.g., processor (120) or sensor module (176)). The data may include, for example, input data or output data for software (e.g., program (140)) and related commands. The memory (130) may include volatile memory (132) or non-volatile memory (134).
[0034] The program (140) may be stored as software in memory (130) and may include, for example, an operating system (142), middleware (144), or an application (146).
[0035] The input module (150) can receive commands or data to be used for a component of the electronic device (101) (e.g., processor (120)) from outside the electronic device (101) (e.g., user). The input module (150) may include, for example, a microphone, a mouse, a keyboard, a key (e.g., a button), or a digital pen (e.g., a stylus pen).
[0036] The sound output module (155) can output a sound signal to the outside of the electronic device (101). The sound output module (155) may include, for example, a speaker or a receiver. The speaker may be used for general purposes, such as multimedia playback or recording playback. The receiver may be used to receive incoming calls. According to one embodiment, the receiver may be implemented separately from the speaker or as part thereof.
[0037] The display module (160) can visually provide information to an external (e.g., user) of the electronic device (101). The display module (160) may include, for example, a display, a holographic device, or a projector and a control circuit for controlling said device. According to one embodiment, the display module (160) may include a touch sensor configured to detect a touch, or a pressure sensor configured to measure the intensity of the force generated by said touch.
[0038] The audio module (170) can convert sound into an electrical signal or, conversely, convert an electrical signal into sound. According to one embodiment, the audio module (170) can acquire sound through the input module (150) or output sound through the sound output module (155) or an external electronic device (e.g., electronic device (102)) (e.g., speaker or headphones) connected directly or wirelessly to the electronic device (101).
[0039] The sensor module (176) can detect the operating state of the electronic device (101) (e.g., power or temperature) or the external environmental state (e.g., user state) and generate an electrical signal or data value corresponding to the detected state. According to one embodiment, the sensor module (176) may include, for example, a gesture sensor, a gyroscope sensor, a barometric pressure sensor, a magnetic sensor, an accelerometer sensor, a grip sensor, a proximity sensor, a color sensor, an IR (infrared) sensor, a biosensor, a temperature sensor, a humidity sensor, or an illuminance sensor.
[0040] The interface (177) may support one or more specified protocols that can be used for the electronic device (101) to be connected directly or wirelessly to an external electronic device (e.g., electronic device (102)). According to one embodiment, the interface (177) may include, for example, a high definition multimedia interface (HDMI), a universal serial bus (USB) interface, an SD card interface, or an audio interface.
[0041] The connection terminal (178) may include a connector through which the electronic device (101) can be physically connected to an external electronic device (e.g., electronic device (102)). According to one embodiment, the connection terminal (178) may include, for example, an HDMI connector, a USB connector, an SD card connector, or an audio connector (e.g., a headphone connector).
[0042] The haptic module (179) can convert an electrical signal into a mechanical stimulus (e.g., vibration or movement) or an electrical stimulus that the user can perceive through tactile or kinesthetic senses. According to one embodiment, the haptic module (179) may include, for example, a motor, a piezoelectric element, or an electric stimulation device.
[0043] The camera module (180) can capture still images and video. According to one embodiment, the camera module (180) may include one or more lenses, image sensors, image signal processors, or flashes.
[0044] The power management module (188) can manage the power supplied to the electronic device (101). According to one embodiment, the power management module (188) can be implemented, for example, as at least part of a power management integrated circuit (PMIC).
[0045] The battery (189) can supply power to at least one component of the electronic device (101). According to one embodiment, the battery (189) may include, for example, a non-rechargeable primary battery, a rechargeable secondary battery, or a fuel cell.
[0046] The communication module (190) can support the establishment of a direct (e.g., wired) communication channel or a wireless communication channel between an electronic device (101) and an external electronic device (e.g., electronic device (102), electronic device (104), or server (108)), and the performance of communication through the established communication channel. The communication module (190) may include one or more communication processors that operate independently of the processor (120) (e.g., application processor) and support direct (e.g., wired) communication or wireless communication. According to one embodiment, the communication module (190) may include a wireless communication module (192) (e.g., cellular communication module, short-range wireless communication module, or GNSS (global navigation satellite system) communication module) or a wired communication module (194) (e.g., LAN (local area network) communication module, or power line communication module). The corresponding communication module among these communication modules can communicate with an external electronic device (104) through a first network (198) (e.g., a short-range communication network such as Bluetooth, WiFi (wireless fidelity) direct, or IrDA (infrared data association)) or a second network (199) (e.g., a legacy cellular network, a 5G network, a next-generation communication network, the Internet, or a computer network (e.g., a LAN or WAN)). These various types of communication modules may be integrated into a single component (e.g., a single chip) or implemented as multiple separate components (e.g., multiple chips). The wireless communication module (192) can identify or authenticate the electronic device (101) within a communication network such as the first network (198) or the second network (199) using subscriber information (e.g., International Mobile Subscriber Identifier (IMSI)) stored in the subscriber identification module (196).
[0047] The wireless communication module (192) can support 5G networks and next-generation communication technologies following 4G networks, for example, new radio access technology. NR access technology can support high-speed transmission of high-capacity data (enhanced mobile broadband (eMBB)), minimization of terminal power and connection of multiple terminals (massive machine type communications (mMTC)), or high reliability and low latency (ultra-reliable and low-latency communications (URLLC)). The wireless communication module (192) can support a high-frequency band (e.g., mmWave band) to achieve a high data transmission rate, for example. The wireless communication module (192) can support various technologies for securing performance in the high-frequency band, such as beamforming, massive MIMO (multiple-input and multiple-output), full-dimensional MIMO (FD-MIMO), array antenna, analog beam-forming, or large-scale antenna. The wireless communication module (192) can support various requirements specified in the electronic device (101), external electronic device (e.g., electronic device (104)), or network system (e.g., second network (199)). According to one embodiment, the wireless communication module (192) can support a Peak data rate (e.g., 20 Gbps or more) for realizing eMBB, loss coverage (e.g., 164 dB or less) for realizing mMTC, or U-plane latency (e.g., downlink (DL) and uplink (UL) each 0.5 ms or less, or round trip 1 ms or less) for realizing URLLC.
[0048] An antenna module (197) can transmit a signal or power to or from an external source (e.g., an external electronic device). According to one embodiment, the antenna module (197) may include an antenna comprising a radiator made of a conductor or a conductive pattern formed on a substrate (e.g., a PCB). According to one embodiment, the antenna module (197) may include a plurality of antennas (e.g., an array antenna). In this case, at least one antenna suitable for a communication method used in a communication network, such as a first network (198) or a second network (199), may be selected from the plurality of antennas, for example, by a communication module (190). A signal or power may be transmitted or received between the communication module (190) and an external electronic device through the selected at least one antenna. According to some embodiments, in addition to the radiator, other components (e.g., a radio frequency integrated circuit (RFIC)) may be additionally formed as part of the antenna module (197).
[0049] According to various embodiments, the antenna module (197) may form a mmWave antenna module. According to one embodiment, the mmWave antenna module may include a printed circuit board, an RFIC disposed on or adjacent to a first surface (e.g., bottom surface) of the printed circuit board and capable of supporting a specified high frequency band (e.g., mmWave band), and a plurality of antennas (e.g., array antennas) disposed on or adjacent to a second surface (e.g., top surface or side surface) of the printed circuit board and capable of transmitting or receiving a signal of the specified high frequency band.
[0050] At least some of the above components can be connected to each other via a communication method between peripheral devices (e.g., bus, GPIO (general purpose input and output), SPI (serial peripheral interface), or MIPI (mobile industry processor interface)) and exchange signals (e.g., commands or data) with each other.
[0051] According to one embodiment, commands or data may be transmitted or received between the electronic device (101) and an external electronic device (104) through a server (108) connected to a second network (199). Each of the external electronic devices (102, or 104) may be the same or different type of device as the electronic device (101). According to one embodiment, all or part of the operations performed on the electronic device (101) may be performed on one or more of the external electronic devices (102, 104, or 108). For example, if the electronic device (101) needs to perform a function or service automatically or in response to a request from a user or another device, the electronic device (101) may request one or more external electronic devices to perform at least part of the function or service instead of performing the function or service itself or additionally. One or more external electronic devices that receive the above request may execute at least part of the requested function or service, or additional function or service related to the request, and transmit the result of the execution to the electronic device (101). The electronic device (101) may provide the result as is or additionally processed as at least part of the response to the request. For this purpose, for example, cloud computing, distributed computing, mobile edge computing (MEC), or client-server computing technology may be used. The electronic device (101) may provide ultra-low latency services using, for example, distributed computing or mobile edge computing. In another embodiment, the external electronic device (104) may include an Internet of Things (IoT) device. The server (108) may be an intelligent server using machine learning and / or neural networks. According to one embodiment, the external electronic device (104) or the server (108) may be included within a second network (199).The electronic device (101) can be applied to intelligent services (e.g., smart home, smart city, smart car, or healthcare) based on 5G communication technology and IoT-related technology.
[0052] FIG. 2a is a schematic diagram of an electronic system according to one embodiment.
[0053] Referring to FIG. 2a, the electronic system (200) may include a plurality of electronic devices (201, 202, 203) and a server (250).
[0054] According to one embodiment, a plurality of electronic devices (201, 202, 203) may be implemented as nodes of a blockchain network (240). For example, the plurality of electronic devices (201, 202, 203) may include various types of electronic devices. Although FIG. 2a illustrates the plurality of electronic devices (201, 202, 203) as two smartphones and one TV, this is exemplary and the number or types of electronic devices may not be limited thereto.
[0055] According to one embodiment, the server (250) may be configured to relay message transmission between nodes included in the blockchain network (240) (e.g., a plurality of electronic devices (201, 202, 203)). For example, nodes (201, 202, 203) included in the blockchain network (240) may transmit and receive information through the server (250).
[0056] According to one embodiment, the server (250) may provide information about the latest block of the nodes (201, 202, 203) included in the blockchain network (240). For example, the information about the latest block may include information about the number of the block that each of the nodes (201, 202, 203) last added and stored. Additionally, the server (250) may provide information indicating the status of the nodes (201, 202, 203) included in the blockchain network (240) (e.g., information indicating whether the node is currently in an on state or an off state). For example, the nodes (201, 202, 203) included in the blockchain network (140) may access the server (250) to view or verify the information provided by the server (250) described above.
[0057] According to one embodiment, the server (250) can manage nodes included in the blockchain network (240). According to one embodiment, the server (250) can support a mutex function to prevent consensus conflicts between nodes (201, 202, 203) included in the blockchain network (240). According to one embodiment, the server (250) can determine the consensus conditions of the nodes (201, 202, 203) included in the blockchain network (240). For example, the server (250) can minimize the consensus conditions of the nodes (201, 202, 203) included in the blockchain network (240).
[0058] According to one embodiment, the server (250) may include at least one device (e.g., a control device, a storage device, a management device). Depending on the implementation, the server (250) may be implemented as a collection of multiple servers.
[0059] The configurations and operations of the electronic system (200) described in FIG. 2a will be explained in more detail in the drawings below. Meanwhile, for convenience of explanation, the electronic devices (201, 202, 203) corresponding to the nodes included in the blockchain network (240) will be described as the nodes included in the blockchain network (240). Additionally, the first electronic device (201) among the electronic devices will be described as a client requesting the addition of a new block.
[0060] FIG. 2b is a block diagram of nodes and servers included in a blockchain network according to one embodiment.
[0061] Referring to FIG. 2b, each of the electronic devices (201, 202, 203) corresponding to nodes included in a blockchain network (e.g., the blockchain network (240) of FIG. 2a) according to one embodiment may include a control device (210, 220, or 230). Each of the said electronic devices (201, 202, 203) may further include a storage device (215, 225, or 235) for storing information about a block.
[0062] According to one embodiment, the control device (210, 220, or 230) may include a processor in hardware. Depending on the implementation, the control device (210, 220, or 230) may further include a communication circuit configured to transmit and receive information (e.g., data related to blocks, transaction information, signatures) to and from a server (250).
[0063] According to one embodiment, a control device (210, 220, 230) may execute a client agent (212, 222, 232) and a peer agent (214, 224, 234). For example, each of the client agent (212, 222, 232) and the peer agent (214, 224, 234) may be implemented as software or as a module combining hardware and software. Depending on the implementation, the control device (210, 220, 230) may execute only the client agent (212, 222, 232). In this case, the client agent (212, 222, 232) may be configured to also perform the operation of the peer agent (214, 224, 234).
[0064] According to one embodiment, the client agent (212, 222, 232) may perform a series of operations related to the data of each of the nodes (201, 202, 203). For example, the client agent (212, 222, 232) may send and receive data or messages with the server (250). For example, the client agent (212, 222, 232) may make a request to the server (250) to add a new block. Additionally, the client agent (212, 222, 232) may transmit transaction information to be included in the new block to the server (250).
[0065] According to one embodiment, a peer agent (214, 224, 234) can control and manage a storage device (215, 225, 235). For example, the peer agent (214, 224, 234) can provide data related to data (e.g., information about a block) stored in the storage device (215, 225, 235). Alternatively, the peer agent (214, 224, 234) can add and store a new block in the storage device (215, 225, 235).
[0066] According to one embodiment, the storage device (215, 225, 235) may store a plurality of blocks (e.g., B1, B2, B3) agreed upon by nodes included in the blockchain network (240). Additionally, the storage device (215, 225, 235) may store information related to the blockchain network (240) (e.g., information related to signatures). For example, the latest block number last stored in the storage device (215, 225, 235) may be "3". For example, the storage device (215, 225, 235) may include at least one memory.
[0067] A server (250) according to one embodiment may include a message relay (255) and a table (260). The server (250) may further include a control device (not shown) that controls the overall operation of the server (250).
[0068] According to one embodiment, a message relay (255) can relay and transmit messages or information between nodes (201, 202, 203) included in a blockchain network (240). For example, the message relay (255) may include a communication circuit that supports wireless communication technology (e.g., the communication circuit (250) of FIG. 1).
[0069] According to one embodiment, the message relay (255) may support a mutex function. For example, the mutex function may include a function in which the server (250) provides priority related to the operation of adding a new block to the node that first requested the addition of the new block. For example, if priority related to the operation of adding a new block is granted to a specific node, the server (250) may reject requests from other nodes while the specific node is adding the new block. Depending on the implementation, the server (250) may further support a timer function for the mutex function. For example, the server (250) may set a timer after granting priority to a specific node to limit the time during which the priority is recognized. Alternatively, the server (250) may limit the specific node from being granted priority consecutively a specified number of times.
[0070] According to one embodiment, the table (260) may display or provide information about the latest blocks stored in the nodes included in the blockchain network (240). For example, the nodes (201, 202, 203) included in the blockchain network (240) may access the server (250) to view or verify information about the latest blocks of the nodes (201, 202, 203) recorded in the table (260).
[0071] According to one embodiment, the table (260) may include device identification information (e.g., device ID), the latest block number, and node status information. For example, the table (260) may indicate that the latest block number of the first electronic device (201) (e.g., device A) is "3" and the status is "ON". The table (260) may indicate that the latest block number of the second electronic device (202) (e.g., device B) is "3" and the status is "ON". The table (260) may indicate that the latest block number of the third electronic device (203) (e.g., device C) is "3" and the status is "ON". However, the contents of the table (260) described above are exemplary, and the technical concept of the present invention may not be limited thereto.
[0072] According to one embodiment, the server (250) may further include a node management device (270) configured to manage nodes (201, 202, 203) included in the blockchain network (240). For example, the node management device (270) may determine a consensus condition (e.g., fault tolerance) of the nodes included in the blockchain network (240). For example, the node management device (270) may determine a consensus condition for adding a new block to the nodes included in the blockchain network (240). For example, the node management device (270) may relax or adjust the consensus condition so that a new block can be added with only the consensus of a specified number of nodes, rather than the consensus of all nodes.
[0073] Depending on the implementation, the server (250) may store information about blocks stored in nodes (201, 202, 203) included in the blockchain network (240) in a storage device (not shown) connected to the server (250).
[0074] FIGS. 3A, FIGS. 3B, FIGS. 3C, FIGS. 3D, FIGS. 3E, and FIGS. 3F are drawings illustrating a method for an electronic device included in a blockchain network according to one embodiment to add a new block.
[0075] Referring to FIG. 3a, according to one embodiment, a first electronic device (201) can access a server (250) (e.g., the server (108) of FIG. 1 or the server (250) of FIG. 2a) to check information about the last stored block by each of the nodes included in the blockchain network (e.g., the blockchain network (240) of FIG. 2a).
[0076] According to one embodiment, the first electronic device (201) may request a server (250) (e.g., a message relay (255)) to perform an operation to add a new block to nodes (201, 202, 203) included in the blockchain network (240) via a client agent (212). For example, the server (250) may provide a mutex function. For example, the mutex function may include a function to provide priority related to the operation of adding a new block to the node that made the request first.
[0077] According to one embodiment, if a request to add a new block from the server (250) is not rejected, the first electronic device (201) may transmit the transaction information and the first signature information (signature A) to the server (250) via the client agent (212) so that the server (250) transmits the transaction information to be stored in the new block and the first signature information (signature A) of the first electronic device (201) to other nodes (202, 203) included in the blockchain network (240). For example, the first signature information (signature A) may include unique information that can identify the first electronic device (201).
[0078] Referring to FIG. 3b, according to one embodiment, the server (250) may transmit transaction information and first signature information (signature A) to nodes (201, 202, 203) (e.g., peer agents (214, 224, 234)) included in the blockchain network (240) via a message relay (255). Depending on the implementation, the server (250) may also transmit transaction information and first signature information (signature A) to nodes (202, 203) excluding the first electronic device (201).
[0079] Referring to FIG. 3c, according to one embodiment, each of the nodes (201, 202, 203) may create a new block in response to receiving, obtaining, or verifying transaction information and first signature information (signature A). For example, the first electronic device (201) may create block A containing transaction information, the second electronic device (202) may create block B containing said transaction information, and the third electronic device (203) may create block C containing said transaction information.
[0080] According to one embodiment, each of the nodes (201, 202, 203) can transmit the generated block (block A, block B, or block C) and its own signature information (signature A, signature B, or signature C) to a server (250) (e.g., a message relay (255)) through a peer agent (214, 224, 234).
[0081] Referring to FIG. 3d, according to one embodiment, a first electronic device (201) can receive information about blocks (block B, block C) generated by other nodes (202, 203) and their signature information (signature B, signature C) from a server (250).
[0082] According to one embodiment, the first electronic device (201) can confirm a consensus regarding the addition of a new block (Block A) based on blocks (Block B, Block C) generated by other nodes (202, 203) and signature information (Signature B, Signature C) of other nodes (202, 203) through a client agent (212). For example, the first electronic device (201) can confirm the signature information (Signature B, Signature C) of other nodes (202, 203). Additionally, the first electronic device (201) can determine that a consensus to add a new block to each node (201, 202, or 203) is completed if it is confirmed that the number of blocks (Block B, Block C) generated by other nodes (202, 203) that are identical to the block (Block A) generated by the first electronic device (201) is greater than a specified number. Additionally, if the first electronic device (201) confirms that the number of blocks (block B, block C) generated by other nodes (202, 203) that are identical to the block (block A) generated by the first electronic device (201) is greater than the specified number, it may confirm or determine a new block to be added to each node (201, 202, or 203) as “block A”.
[0083] Referring to FIG. 3e, according to one embodiment, when the first electronic device (201) determines through the client agent (212) that a consensus to add a new block has been completed, it may transmit information indicating the consensus (or consensus confirmation information) (e.g., a seal) to the server (250) (or message relay (255)) so that the server (250) transmits information indicating the consensus (or consensus confirmation information) (e.g., a seal) to other nodes (202, 203). For example, the first electronic device (201) may obtain or generate information indicating the consensus using the signature information (signature A, signature B, signature C) of each of the nodes (201, 202, 203).
[0084] Referring to FIG. 3f, according to one embodiment, a server (250) can transmit information indicating consensus (or consensus confirmation information, seal) to nodes (201, 202, 203) (e.g., peer agents (214, 224, 234)) through a message relay (255).
[0085] According to one embodiment, each of the nodes (201, 202, 203) may add and store a new block in the storage device (215, 225, 235) of each of the nodes (201, 202, 203) in response to receiving or confirming information indicating consensus.
[0086] According to one embodiment, the server (250) can update information regarding the block number of the table (260). For example, the server (250) can change the block number of each node included in the table (260) from "3" to "4".
[0087] According to the operation of FIGS. 3a to 3f described above, nodes (201, 202, 203) included in the blockchain network (240) can efficiently add a new block.
[0088] FIG. 4 is a drawing for explaining information related to a block according to one embodiment.
[0089] Referring to FIG. 4, according to one embodiment, transaction information (420) may be included or stored in a block (430).
[0090] According to one embodiment, transaction information (420) may include a transaction ID, a timestamp, and at least one instruction. The transaction ID may include information identifying the transaction. The timestamp may include information about the time at which the transaction occurred. The instruction (410) may include a command (e.g., instruction 1 (PUT, key1, value1)) for performing a specific action on a specific value included in the data table (415). For example, the instruction (410) may include a key, a value corresponding to the key, and a command for performing a specific action (e.g., post, put, delete) on the key and the value. For example, the key may represent a specific key included in the data table (415), and the value may represent a value represented by the specific key included in the data table (415).
[0091] According to one embodiment, a block (430) may store information about the corresponding block. For example, information about the block may include information about the block number, transaction information (420), previous block hash information, and Merkle root. For example, the block number may include information identifying the block. The previous hash information may include hash information used in a previously created block. Information about the Merkle root may include a final hash value derived from a data structure that summarizes all transaction information included in the block (430) and represents it in a tree form. For example, the previous hash information and the information about the Merkle root may be used to verify or confirm the integrity of the block (430).
[0092] According to one embodiment, the signature (440) may be used for consensus to add a new block (430). For example, the signature (440) may include identification information of each of the nodes (201, 202, 203) included in the blockchain network (240) and their unique information (signature data).
[0093] According to one embodiment, a node (e.g., first electronic device (201)) that requested the addition of a new block may generate information indicating consensus (or consensus confirmation information) (e.g., seal) (450) when it is confirmed that consensus on the addition of the new block has been completed. For example, the information indicating consensus (or consensus confirmation information) (450) may be generated using the signatures of the nodes that agreed. For example, the information indicating consensus (450) may include signatures or information hashed from the signatures. Nodes (201, 202, 203) included in the blockchain network (240) may add and store the corresponding block (430) in a storage device (e.g., storage devices (215, 225, 235) of FIG. 2 when they receive and / or confirm the information indicating consensus (450).
[0094] FIG. 5 is a diagram illustrating an example of data cleanup for blocks accumulated in memory when an electronic device included in a blockchain network according to one embodiment adds a new block that exceeds the block capacity.
[0095] Referring to FIG. 5, nodes (201, 202, 203) (e.g., a plurality of electronic devices) included in a blockchain network (240) according to one embodiment may accumulate a block (e.g., data for a blockchain) containing information about the block (e.g., information related to the block state, such as a key and / or a value corresponding to the key) whenever consensus occurs, and store (e.g., add) (510) it in a database in memory. Since the nodes (201, 202, 203) cannot store data indefinitely in an environment where storage space is insufficient, they may specify a limiting range (e.g., 0 to n) by block number to limit the block capacity (n) of the data for the blockchain being stored. The size of the data for the blockchain may be proportional to the number of consensuses. The number of consensuses may be equal to or proportional to the number of blocks.
[0096] According to one embodiment, the nodes are all state machines that must perform consensus identically. Since a lack of consensus occurs when individual initialization takes place, the nodes can perform data initialization identically and maintain the same state even after consensus. According to one embodiment, when the nodes intend to add a new block (n+1) that exceeds the block capacity (n) identically, they can perform a consensus operation (520) to organize data for the block and perform a consensus operation (530) to add the new block. According to one embodiment, the nodes can delete only blocks for history purposes and additional accumulated data while maintaining (e.g., preserving) data for a certain level of blocks, without initializing (e.g., resetting or deleting) all blocks accumulated in the storage device.
[0097] According to one embodiment, a node (201) of a client requesting the addition of a new block among the nodes (hereinafter, the electronic device (201) is described as an example) can accumulate blocks (e.g., data for a block) in memory (510) within a specified limit range (e.g., 0 to n) based on a block capacity (n), and when the block capacity is exceeded (e.g., when adding a block with block number n+1), it can transmit information related to a consensus (compress) (520) for data extraction and data cleanup (e.g., data initialization, data deletion, or database reset) for initializing the blocks already stored in memory to a server (250). The actual data cleanup at the nodes (201, 202, 203) can be performed when the consensus to add a new block (e.g., block number n+1) that exceeds the block capacity (n) is confirmed (e.g., consensus success) or when synchronization (530). Other nodes (202, 203) (e.g., other electronic devices (202, 203)) may view or refer to a table (e.g., dashboard) for the state map of the server (250) to perform data cleanup, which deletes or initializes some blocks accumulated in memory when a new block is added, and may receive, obtain, or verify new transaction information contained in a new block (e.g., block number n+1) through the server (250) and add or store it. Here, data cleanup may be performed periodically whenever the number of blocks accumulated in memory exceeds the block capacity. Here, the block capacity (n) may represent the unit of the maximum block number that determines the total amount of data to be preserved. The transaction capacity (t) may represent the maximum number of transactions that can be contained in one block.
[0098] An electronic device (201) according to one embodiment may, when extracting data for at least one block to be preserved among blocks accumulated in memory, check the priority (e.g., the newest rank of the value) and extract data for at least one block corresponding to the transaction capacity according to the same policy agreed upon in advance (e.g., transaction information (e.g., key and / or value corresponding to the key)). An electronic device (201) according to one embodiment may determine the data to be preserved by compressing the extracted data for at least one block. The data to be preserved may be used for consensus confirmation or synchronization in the same way as a regular block. The electronic device (201) may generate a set of commands (e.g., a set) capable of reproducing the final state of the data to be preserved using an initial post-test command (POST). The electronic device (201) creates a new block (n+1) subject to consensus as a block with the compressed set of commands, and at the time of consensus confirmation and synchronization, reflects the data for the compressed block after data cleaning (e.g., data initialization) to obtain transaction information (e.g., key and / or corresponding) for the data to be preserved. The value corresponding to the key can be reproduced exactly.
[0099] FIG. 6 is a diagram illustrating an example of data cleanup for blocks accumulated in memory when an electronic device included in a blockchain network according to one embodiment adds a new block that exceeds the block capacity. FIG. 7a and FIG. 7b are diagrams illustrating examples of tables for a stored state map of a server included in a blockchain network according to one embodiment. In the description of FIG. 6, the block capacity (n) (e.g., limit range) is assumed to be, for example, 5, and the transaction capacity (t) is assumed to be, for example, 2, to explain the specific operation for the data extraction and cleanup consensus operation of each node.
[0100] Referring to FIG. 6, according to one embodiment, an electronic device (201) can identify that data cleanup is required when the block capacity (n) is in a full state (601) (e.g., block 5, PUT, Key: key 5, value: value 5). As the electronic device (201) identifies that data cleanup is required, it can perform data extraction (603) and data erasure (605) when adding a new block (n+1) (e.g., block 6), data cleanup (e.g., data initialization, data deletion, or database reset (resect DB)). The electronic device (201) can write (e.g., create or determine) (605) the transaction information (611) of a new block (e.g., transaction information (420) of FIG. 4) and transmit the transaction information (611) of the new block created through the peer agent (214) and its own signature information (signature A) to a server (250) (e.g., message relay (255)). The server (250) can update a table (e.g., dashboard) (610) for a state map that reflects the transaction information (611). Here, the transaction information (611) may include a first command (PUT) included in the instruction (e.g., PUT key: key 1, value: value 1-1)). The electronic device (201) can extract data (e.g., key 5, value 5 and key 1, value 1-1) for the last (e.g., recently stored) two blocks (e.g., block numbers 5, 6) based on the block number as the block number of the new block (e.g., 6) exceeds the block capacity (e.g., 5), preserve only the extracted data, and delete the stored data (e.g., database reset). Here, the block stamp is used only for sorting and is deleted, and the leaf index can also be deleted because the Merkle tree must be reconstructed.The actual data deletion for the database reset can be carried out during the finalize phase after the cleanup consensus is confirmed.
[0101] According to one embodiment, an electronic device (201) creates (e.g., writes or determines) and compresses new transaction information (621) (e.g., POST key 5, value 5 and POST key 1, value 1-1) based on data (e.g., key 5, value 5 and key 1, value 1-1) for the last (e.g., recently stored) two blocks (e.g., block numbers 5, 6) to create a new block (n+1) (e.g., block 6) (607), and may request a consensus from a server for data cleanup as the new block (n+1) exceeds the block capacity (n). Here, the new block may be a multi-transaction block, as transaction information for two or more recently accumulated blocks can be extracted as data to be preserved when the number corresponding to the transaction capacity is two or more. Here, the multi-transaction block is a method of rewriting each extracted state with POST OP, which allows multiple states to be reproduced at once in consensus and synchronization.
[0102] According to one embodiment, the electronic device (201) may transmit new transaction information (621) and signature information (e.g., signature A) included in information for a new block (n+1) to a server (250). When consensus for adding a new block (n+1) is successful (609), the server (250) may reset (e.g., metadata reset and refresh) a table (e.g., dashboard) (610) for a state map and reflect new transaction information (621) for the new block (n+1) (e.g., key 5, value 5, leaf index 0, block stamp 6 and key 1, value 1-1, leaf index 1, block stamp 6) for the new block (n+1) in the reset table (e.g., dashboard) (620). Here, the leaf index included in the table for the state map (e.g., dashboard) (620) is set to a newly created Merkle tree and can be automatically updated (e.g., leaf index 0, leaf index 1). The block stamp included in the state table is reflected as a new block (e.g., block 6) and can be automatically updated.
[0103] Each node (201, 202, 203) according to one embodiment may transmit to a server (250) to add (e.g., create, store, or accumulate) data for a block up to a specified block capacity (n) (e.g., 1000) and to write (e.g., register) commands for blockchain data in a table (610) for a state map (e.g., a dashboard (710) of FIG. 7a and FIG. 7b). The table (610) for the state map may write commands (e.g., data for a block) separately for each node (201, 202, 203) and be updated up to a specified block capacity (n) (e.g., 1000). When each node (201, 202, 203) requests the addition of a new block (e.g., block number 1001) after exceeding a specified block capacity (n) (e.g., 1000), the table (610) for the state map (e.g., the dashboard (710) of FIG. 7a and FIG. 7b) is cleaned up (e.g., deleted, initialized, or reset), and upon successful consensus, new transaction information for the next new block (e.g., 1001) can be reflected for each node (201, 202, 203).
[0104] FIG. 8 is a diagram illustrating an example of data cleanup for blocks of higher versions accumulated in memory when a lower version node is added to an electronic device included in a blockchain network according to one embodiment. Hereinafter, for convenience of explanation, electronic devices (201, 202, 204) corresponding to nodes included in a blockchain network (240) will be described as nodes (201, 202, 204) included in a blockchain network (240).
[0105] Referring to FIGS. 2a, 2b, and FIG. 8, according to one embodiment, an electronic device (201) can access a server (e.g., a server (250) of FIG. 2a) configured to relay message transmission between electronic devices (e.g., a plurality of electronic devices (201, 202) of FIG. 2a) corresponding to nodes (201, 202) included in a blockchain network (e.g., a blockchain network (240) of FIG. 2a) to verify information about the last stored block of each of the nodes (201, 202). For example, the server (250) can provide information about the latest block of the nodes (201, 202) included in the blockchain network (240) to each of the nodes (201, 202). For example, the information about the latest block may include information about the last stored block of each of the nodes (201, 202) included in the blockchain network (140).
[0106] According to one embodiment, an electronic device (201) corresponding to a first node acts as a client and may request the server (250) to add a new block (+1 block) to other nodes (202) based on information regarding the identified block. For example, the block number of the last stored block at each node (202, 203) may be a number that does not match the last number of a specified range (e.g., 1 to 1000).
[0107] According to one embodiment, if the electronic device (201) confirms that it has failed to synchronize to add a new block, it can confirm through the server (250) that a compatibility issue has occurred because synchronization is impossible. The electronic device (201) can confirm that a new node (204) of a lower version has been added to the blockchain network (240) by viewing or referencing a table for a state map (e.g., a table for a map (610) of FIG. 6 or a dashboard (710) of FIG. 7a and FIG. 7b) through the server (250) to check information about the confirmed block (e.g., information about the latest block). According to one embodiment, when the electronic device (201) checks for information about the latest block through the server (250) to add a new block before confirming a failure of consensus, it can check that a new node (204) has been added by viewing or referring to a table for the state map of the server (250) (e.g., a table for the map (610) of FIG. 6 or a dashboard (710) of FIG. 7a and FIG. 7b).
[0108] According to one embodiment, an electronic device (201) can verify version information of a new node (204) added via a server (250). If the electronic device (201) identifies that the version of the new node (204) is a lower version (V1) (e.g., old version) than the versions of other nodes (201, 202, 203) included in the blockchain network (240), it can verify that synchronization is impossible due to a compatibility issue. The other nodes (201, 202, 203) may be devices of a higher version (V2) (e.g., new version). If synchronization is to be performed between nodes with different version information, a compatibility issue may occur because synchronization is impossible and consensus cannot be sustained. Here, synchronization may be a method of reproducing a key / value by actually executing commands within a block received from the server (250) at each node. In the case of a node of the lower version (V1), it may be impossible to understand and process commands of the higher version (V2), so an error may occur. Since a node that fails to synchronize cannot participate in the consensus, the node of the lower version cannot continue to participate in the consensus, so a compatibility issue may occur. To resolve the compatibility issue, the electronic device (201) can perform a data cleanup consensus upon request when a node of the lower version (V1) is added.
[0109] According to one embodiment, the electronic device (201) can transmit information related to consensus to the server (250) to synchronize based on the lower version (V1) based on identifying that the version information of the new node (204) is the lower version (V1). Here, the information related to consensus may include a reset command requesting a data extraction and cleanup consensus. The server (250) may provide information related to consensus (801) to other nodes (201, 202) to perform synchronization and consensus with the reset command requesting a data extraction and cleanup consensus to the lower version (V1). Since the new node (204) cannot process the reset command included in the information related to consensus, it can synchronize with the other nodes (201, 202) and store the new block (814) of the lower version in memory. The first node (201) and the second node (202), excluding the new node (204), can each process a reset command included in the consensus-related information, thereby deleting or removing all blocks of the upper version (V2) stored in memory and adding (e.g., storing) new blocks (811, 812) of the lower version to memory. Here, the new blocks of the lower version (e.g., V1 Block) (811, 812, 814) may include a key, transaction information (e.g., multi-POST(extracted)) containing a command of the lower version (V1) containing a value for said key, a newly assigned block number (e.g., 1001), and a leaf index. The leaf index may be set and automatically updated with a newly created Merkle tree. The transaction information containing the command of the lower version (V1) may be generated using a command (e.g., POST) that can be understood or processed by all versions. The newly assigned block number above may be newly assigned starting from the starting number (e.g., 1001) of the next range (e.g., 1001 to 2000) for the specified block capacity (n).
[0110] Although the electronic device included in the blockchain network according to the description of FIG. 8 as described above has been separately described as a consensus example for cleaning up data on blocks of higher versions accumulated in memory when a lower version node is added, it is not limited thereto, and may be performed within the following range after performing a consensus operation to clean up data on blocks accumulated in memory when a new block exceeding the block capacity is added in the embodiments described in FIG. 5 and FIG. 6.
[0111] According to one embodiment, the electronic device (201) may request the server (250) to add new blocks to the nodes (201, 202, 203) based on identifying that the number of blocks accumulated in memory is not equal to the specified block capacity. Based on identifying that a new node (204) has been added to the blockchain network (240) through the server (250), the electronic device (201) can verify version information for synchronization between the nodes (201, 202, 203, 204) included in the blockchain network (240) through the server (250). According to one embodiment, based on identifying that the version information of the new node (204) is a lower version (V1), the electronic device (201) transmits information related to a consensus to the server (250) to synchronize based on the lower version, and based on the success of the consensus for the addition of a new block, the new block of the lower version can be added (e.g., stored) in memory with the previously accumulated blocks of the higher version deleted from memory.
[0112] FIGS. 9a, 9b, 9c, and 9d are drawings illustrating examples of blockchain operation in an electronic device included in a blockchain network according to one embodiment. In the description of FIGS. 9a, 9b, 9c, and 9d, an example of blockchain operation to prevent continuous failure of consensus due to a failure of a node with the latest block number (e.g., offline or inability to synchronize) will be specifically described.
[0113] Referring to FIGS. 2a, 2b, 9a, 9b, 9c and 9d, an electronic device (201) according to one embodiment may, through a communication circuit, view or check a table (910) of a server (250) configured to relay message transmission between nodes (e.g., peer 1 (201), peer 2 (202), peer 3 (203)) included in a blockchain network (240), check information about the last block stored in the nodes (201, 202, 203), and request synchronization and consensus to add a new block.
[0114] According to one embodiment, when it is confirmed that a specific node (e.g., a first node (201)) included in a blockchain network (240) has failed to synchronize with nodes (202, 203) due to a failure (e.g., being offline or unable to synchronize), the electronic device (201) can identify stable and unstable numbers by checking the block numbers of each node (201, 202, 203) through a server (250). For example, the block number of the first node (201) may be an unstable latest (e.g., "5"), and the block numbers of the second node (202) and the third node (203) may be stable latest (e.g., "3"). Each node may perform lookup, synchronization, and consensus operations based only on the stable latest. For example, if f, which indicates the number of stable numbers, is 1, it may mean that another node of the stable number has withdrawn. For example, if valid blocks received from a node with a stable number are not locally connected, it may mean that the first node was ignored as a node with an unstable number. Here, f is the fault tolerance of the Byzantine Fault Tolerance (BFT) model.
[0115] According to one embodiment, the electronic device (201) may perform a blockchain operation that ignores unstable numbers, re-synchronizes to follow the stable numbers of the second node (202) and the third node (203), and reaches consensus. For example, if the electronic device (201) identifies that the block number of its first node is an unstable number (e.g., "5"), it may ignore its block, reset the block number as the blockchain operates (e.g., set to "1"), and re-synchronize by self-recovering blocks (e.g., Block 2 and Block 3) to follow the stable numbers (e.g., "3") of the second node (202) and the third node (203). The second node (202) and the third node (203) may ignore blocks with unstable numbers and reach consensus. When ignoring unstable numbers, if the block numbers (e.g., "1") become the same, it may be impossible to distinguish between the stable latest and the unstable latest, and the node ignored as an unstable number (e.g., the first node (201)) may be unable to participate in subsequent consensus because the hash chain differs from the newly determined consensus. The node ignored as an unstable number may perform a self-recovery operation to synchronize with other nodes so that it can participate in the next consensus again, ensuring that the block number always represents a single chain.
[0116] According to one embodiment, the electronic device (201) may perform the following consensus based on the recovered stable number. The electronic device (201) may request a consensus through the server (250) to add a new block to each node (201, 202, 203) based on the stable number. The electronic device (201) may transmit information related to the consensus to the server (250).
[0117] According to one embodiment, the electronic device (201) can add a new block to memory if consensus is successful. If consensus is successful, other nodes (202, 203) can also add a new block to memory.
[0118] According to one embodiment, when the block number at the next agreement matches the unstable number, the electronic device (201) may add a dummy block (911) corresponding to the unstable number and request an agreement with the next number in sequence of the unstable number (e.g., block number 2).
[0119] The operation for blockchain operation according to the descriptions of FIGS. 9a, 9b, 9c, and 9d described above has been explained as a separate embodiment, but is not limited thereto. In the embodiment described in FIGS. 5 and 6, when a new block exceeding the block capacity is added, a data cleanup consensus operation for the blocks accumulated in memory is performed, and then the operation may be performed within the following range.
[0120] An electronic device according to one embodiment (e.g., the electronic device (101) of FIG. 1 and / or the electronic device (201) of FIG. 2a) may implement a software module related to a blockchain (e.g., the program (140) of FIG. 1). The memory of the electronic device (e.g., the memory (130) of FIG. 1 and / or the storage device (215) of FIG. 2b) may store instructions (e.g., instructions) to implement the software module. At least one processor (e.g., the processor (120) of FIG. 1 and / or the control device (210) of FIG. 2b) may execute the instructions stored in memory to implement the software module and may control hardware associated with the function of the software module (e.g., the communication module (190) of FIG. 1, the display module (160) of FIG. 1).
[0121] A software module of an electronic device (101, 201) according to one embodiment may be configured to include a kernel (or HAL), a framework (e.g., middleware (144) of FIG. 1), and an application (e.g., application (146) of FIG. 1). At least some of the software modules may be preloaded onto the electronic device (101, 201) or downloadable from a server (e.g., server (108)).
[0122] According to one embodiment, the kernel may include, for example, a system resource manager or a device driver, but may be configured to include other modules, not limited thereto. The system resource manager may perform at least one of the operations of controlling, allocating, or reclaiming system resources. The device driver may include, for example, a display driver, a camera driver, a Bluetooth driver, a shared memory driver, a USB driver, a keypad driver, a WIFI driver, an audio driver, or an IPC (inter-process communication) driver.
[0123] According to one embodiment, the framework may provide functions commonly required by the application, or provide various functions to the application through an application programming interface (API) (not shown) so that the application can efficiently use limited system resources within the electronic device (101, 201). The framework may include modules that form combinations of various functions of the components. The framework may provide modules specialized for each type of operating system to provide differentiated functions. The framework may dynamically delete some existing components or add new components.
[0124] According to one embodiment, the application may be configured to include an application (e.g., a module, a manager, or a program) related to a video streaming service. The application may include an application received from an external electronic device (e.g., the server (108) of FIG. 1, the electronic device (102, 104) of FIG. 1, the server (250) of FIG. 2a, or the external electronic device (202, 203) of FIG. 2a). According to one embodiment, the application may include a preloaded application or a third-party application downloadable from the server. The components of the software module and the names of the components according to the illustrated embodiments may vary depending on the type of operating system. According to one embodiment, at least a portion of the software module may be implemented as software, firmware, hardware, or a combination of at least two of these. At least a portion of the software module may be implemented (e.g., executed) by a processor (e.g., AP), for example. At least a portion of the software module may include, for example, a module, program, routine, set of instructions, or process for performing at least one function.
[0125] As such, in one embodiment, the main components of an electronic device have been described through the electronic device (101, 201) of FIGS. 1 and 2a. However, in various embodiments, not all components illustrated in FIGS. 1 and 2a are essential components, and the electronic device (101, 201) may be implemented with more components than those illustrated, or with fewer components. Additionally, the positions of the main components of the electronic device (101, 201) described above in FIGS. 1 and 2a may be changed according to various embodiments.
[0126] According to one embodiment, an electronic device corresponding to one of the nodes included in a blockchain network (e.g., electronic device (101) of FIG. 1, electronic device (201) of FIG. 2a) may include a communication circuit (e.g., communication module (190) of FIG. 1), at least one processor including a processing circuit (e.g., processor (120) of FIG. 1, control device (210) of FIG. 2b), and a memory for storing instructions (e.g., memory (130) of FIG. 1, storage device (215) of FIG. 2b).
[0127] According to one embodiment, when the instructions are executed individually or collectively by the at least one processor, the electronic device may be configured to verify information regarding the last block stored in the nodes through a server configured to relay message transmission between the nodes included in the blockchain network via the communication circuit, and based on identifying that the number of blocks accumulated in the verified memory is equal to the specified block capacity based on the verified information regarding the block, request the server to add a new block to the nodes, and via the communication circuit, extract transaction information regarding the last block corresponding to the number of blocks in the nodes that correspond to the specified transaction capacity, generate new transaction information based on the extracted transaction information, and transmit information related to consensus to the server to initialize the blocks already stored in the nodes, transmit the new transaction information to the server so that the new transaction information to be stored in the new block is transmitted to the nodes via the server, and based on the success of the consensus for the addition of the new block, add the new block to the memory with the previously accumulated blocks deleted from the memory.
[0128] According to one embodiment, the new block may include transaction information including a key, a newly assigned block number, an updated leaf index, and a value for the key.
[0129] According to one embodiment, when the instructions are executed individually or collectively by the at least one processor, the electronic device may generate the new transaction information to be stored in the new block by compressing the transaction information for the last two or more blocks when the number corresponding to the transaction capacity is two or more. According to one embodiment, the transaction information for the two or more blocks may have the same newly assigned block number.
[0130] According to one embodiment, when the instructions are executed individually or collectively by the at least one processor, the electronic device may be configured to send a message to the server requesting that the blocks last stored in the nodes be matched if it is determined that the blocks last stored in the nodes are different from each other.
[0131] According to one embodiment, when the instructions are executed individually or collectively by the at least one processor, the electronic device may request the server to add new blocks to the nodes based on identifying that the number of blocks accumulated in the memory is not equal to the specified block capacity; verify version information for synchronization between nodes included in the blockchain network based on identifying that a new node has been added to the blockchain network through the server; transmit information related to a consensus to the server to synchronize based on the lower version based on identifying that the version information of the new node is a lower version; and, based on the success of the consensus for adding the new blocks, add the new blocks of the lower version to the memory with the previously accumulated blocks of the higher version deleted.
[0132] According to one embodiment, when the instructions are executed individually or collectively by the at least one processor, the electronic device may identify a stable number and an unstable number based on information regarding the last stored block, identifying that synchronization between the nodes has failed and that the block number of the last block does not exceed a specified range; re-perform synchronization by restoring the block of the first node having the unstable number to become a stable number at the next consensus based on the blocks of the second node having the stable number; request a consensus through the server to add a new block to each node based on the stable number; and add a new block to the memory based on the success of the consensus.
[0133] According to one embodiment, an electronic device corresponding to one of the nodes included in a blockchain network (e.g., electronic device (101) of FIG. 1, electronic device (201) of FIG. 2a) may include a communication circuit (e.g., communication module (190) of FIG. 1), at least one processor including a processing circuit (e.g., processor (120) of FIG. 1, control device (210) of FIG. 2a), and a memory for storing instructions (e.g., memory (130) of FIG. 1, storage device (215) of FIG. 2a).
[0134] According to one embodiment, when the instructions are executed individually or collectively by the at least one processor, the electronic device may be configured to verify information regarding the last stored block in the nodes through a server configured to relay message transmission between the nodes included in the blockchain network via the communication circuit, request the server to add a new block to the nodes based on the verified information regarding the block, verify version information for synchronization between the nodes included in the blockchain network via the server based on identifying that a new node has been added to the blockchain network via the server, transmit information related to a consensus to the server to synchronize based on the lower version based on identifying that the version information of the new node is a lower version, and, based on the success of the consensus for the addition of the new block, add the new block of the lower version to the memory with the previously accumulated higher version blocks deleted.
[0135] According to one embodiment, the new block of the lower version may include transaction information including a key, a newly assigned block number, an updated leaf index, and a command of the lower version including a value for the key.
[0136] According to one embodiment, the newly assigned block number may be newly assigned starting from the starting number of the next range for the specified block capacity.
[0137] According to one embodiment, when the instructions are executed individually or collectively by the at least one processor, the electronic device may generate the transaction information including the lower version of the instruction and transmit the generated transaction information and signature information to the server through the communication circuit.
[0138] According to one embodiment, an electronic device corresponding to one of the nodes included in a blockchain network (e.g., electronic device (101) of FIG. 1, electronic device (201) of FIG. 2a) may include a communication circuit (e.g., communication module (190) of FIG. 1), at least one processor (e.g., processor (120) of FIG. 1, control device (210) of FIG. 2a), and a memory for storing instructions (e.g., memory (130) of FIG. 1, storage device (215) of FIG. 2a).
[0139] According to one embodiment, when the instructions are executed individually or collectively by the at least one processor, the electronic device may be configured to verify information regarding the last stored block in the nodes through a server configured to relay message transmission between nodes included in the blockchain network via the communication circuit, identify a stable number and an unstable number based on identifying that synchronization between the nodes has failed, re-perform synchronization by restoring the block of the first node having the unstable number to become the stable number at the next consensus based on the blocks of the second node having the stable number, request a consensus through the server to add a new block to each node based on the stable number, and add a new block to the memory based on the success of the consensus.
[0140] According to one embodiment, when the instructions are executed individually or collectively by the at least one processor, the electronic device may be configured to add a dummy block corresponding to the unstable number and request an agreement with the next sequence number of the unstable number when the block number of the next agreement matches the unstable number.
[0141] FIG. 10 is a flowchart illustrating a method for cleaning up data regarding blocks accumulated in memory when an electronic device included in a blockchain network according to one embodiment adds a new block that exceeds the block capacity. In the following embodiments, each operation may be performed sequentially, but is not necessarily performed sequentially. For example, the order of each operation may be changed, and at least two operations may be performed in parallel.
[0142] Referring to FIG. 10, according to one embodiment, in operation 1001, an electronic device (e.g., electronic device (101) of FIG. 1, electronic device (201) of FIG. 2a) can access a server (e.g., server (250) of FIG. 2a) configured to relay message transmission between electronic devices (e.g., a plurality of electronic devices (201, 202, 203) of FIG. 2a) that correspond to nodes included in a blockchain network (e.g., blockchain network (240) of FIG. 2a) to verify information about the last stored block of each of the electronic devices corresponding to the nodes. For example, the server (250) can provide information about the latest block of the electronic devices (201, 202, 203) corresponding to the nodes included in the blockchain network (240) to the electronic devices (201, 202, 203). For example, information about the latest block may include information about the last stored block by each of the electronic devices corresponding to the nodes included in the blockchain network (240).
[0143] Meanwhile, for convenience of explanation, the electronic devices (201, 202, 203) corresponding to the nodes included in the blockchain network (240) will be described as the nodes included in the blockchain network (240).
[0144] According to one embodiment, in operation 1003, the electronic device (201) can determine that the blocks stored in memory (e.g., accumulated) are full up to a specified block capacity (n) based on information about the last stored block (e.g., block number). The electronic device (201) can determine that the blocks stored in memory are full up to the block capacity by checking whether the number of blocks stored in memory corresponds to the specified block capacity (n) based on information about the last stored block (e.g., block number). Meanwhile, if the number of stored blocks does not correspond to the specified block capacity, the accumulated blocks are in a state smaller than the specified block capacity, and new blocks can be added without data cleanup. For convenience of explanation, FIG. 10 describes a method of operation for adding new blocks through data cleanup when the blocks accumulated in memory are full up to the specified block capacity (n), and the description of the operation for adding new blocks when the number is smaller than the specified block capacity is omitted. A method for adding a new block when the block capacity is smaller than the specified block capacity can be performed based on a method of agreeing to add a new block to the storage devices of each node, as described in FIG. 3a and FIG. 3f above.
[0145] According to one embodiment, in operation 1005, the electronic device identifies that data cleanup consensus (e.g., data initialization or deletion) is required and may request the server to add a new block to the nodes included in the blockchain network. For example, the server may provide a mutex function. For example, the mutex function may include a function that grants priority related to the operation of adding a new block to the node that made the request first. For example, if priority related to the operation of adding a new block is granted to a specific node, the server may reject the request of other nodes while that specific node is adding a new block.
[0146] According to one embodiment, in operation 1007, if a request to add a new block from the server is not rejected, the electronic device may perform a data cleanup (e.g., data initialization, data deletion, or database reset) consensus to initialize (e.g., clean up or delete) the blocks accumulated in memory to add (e.g., store) the new block. The actual cleanup of data in the databases of each node may be performed when the data cleanup consensus is confirmed (e.g., successful). Before the data cleanup consensus, the electronic device may extract data (e.g., transaction information) for the last number of blocks corresponding to a specified transaction capacity as data to be preserved.
[0147] According to one embodiment, in operation 1009, the electronic device may generate new transaction information based on extracted data (e.g., transaction information) so that extracted data to be preserved is maintained (e.g., preserved).
[0148] According to one embodiment, in operation 1011, the electronic device may transmit to the server information related to a consensus (e.g., data cleanup consensus) to initialize (e.g., delete or clean up) blocks stored in the memory of the nodes. Transaction information for a new block created (e.g., determined) before data cleanup may be written in the state map table of the server, and when the server receives information related to a consensus for data cleanup (reset) from the electronic device, it may clean (e.g., delete, initialize, or reset) the data written in the state map table.
[0149] According to one embodiment, in operation 1013, the electronic device may add a new block to memory with the previously accumulated blocks deleted from memory (e.g., storage device (215) of FIG. 2b, FIG. 3a to 3f) based on the success of the agreement on the addition of the new block.
[0150] According to one embodiment, an electronic device may receive information from a server regarding blocks generated by nodes included in a blockchain network based on transaction information. The electronic device may receive information from a server regarding the signatures of each node along with the blocks generated by the nodes. According to one embodiment, the electronic device may determine whether there is a consensus regarding the addition of a new block based on the information regarding the blocks generated by nodes included in the blockchain network and the signatures of each node. For example, if the electronic device confirms that the number of blocks identical to the new block generated by the electronic device among the blocks generated by other nodes included in the blockchain network is greater than a specified number, it may determine that the consensus to add a new block to each node has been completed. For example, the electronic device may compare the previous hash information included in the new block generated by the electronic device with the information regarding the Merkle root included in the blocks generated by other nodes. If the previous hash information included in the new block generated by the electronic device and the information regarding the Merkle root included in the blocks generated by other nodes are identical, the electronic device may determine that the new block generated by the electronic device and the blocks generated by other nodes are identical. According to one embodiment, the electronic device may transmit information related to consensus on the addition of a new block to store new transaction information to a server. If the electronic device determines that the number of blocks identical to the new block among the blocks generated by other nodes included in the blockchain network is greater than a specified number, the electronic device may transmit information indicating consensus (e.g., a seal) to the server so that the server transmits information indicating consensus to other nodes included in the blockchain network. For example, information indicating consensus may be obtained using information regarding the signatures of each of the nodes (201, 202, 203).Based on transmitting information indicating consensus to a server, the electronic device can add a new block in memory contained in the electronic device after the previously accumulated blocks have been deleted. After the electronic device transmits information indicating consensus to the server, the server can transmit information indicating consensus to each of the other nodes. Subsequently, the new block can be added to the storage device of each of the other nodes (e.g., the storage devices (225, 235) of FIG. 2b, FIG. 3a through FIG. 3f).
[0151] An electronic device according to one embodiment performs data cleanup at each node according to the operation method of FIG. 10 described above, thereby cleaning up (e.g., deleting or initializing) the data regarding previously accumulated blocks in the storage devices of each node, and can accumulate and store blocks again within a limited range based on block capacity. The electronic device can perform the operation method of FIG. 10 whenever the accumulated blocks reach the block capacity. Here, the block number of the accumulated blocks can be set to continue from the previous number even after data cleanup is performed, and can be initialized to 0 and set again starting from 0 if necessary (e.g., blockchain network initialization).
[0152] FIG. 11 is a flowchart illustrating a method for cleaning up data regarding blocks of higher versions accumulated in memory when a lower version node is added to an electronic device included in a blockchain network according to one embodiment. In the following embodiments, each operation may be performed sequentially, but is not necessarily performed sequentially. For example, the order of each operation may be changed, and at least two operations may be performed in parallel.
[0153] Referring to FIG. 11, according to one embodiment, in operation 1101, an electronic device (e.g., electronic device (101) of FIG. 1, electronic device (201) of FIG. 2a) may access a server (e.g., server (250) of FIG. 2a) configured to relay message transmission between electronic devices (e.g., a plurality of electronic devices (201, 202, 203) of FIG. 2a) corresponding to nodes included in a blockchain network (e.g., blockchain network (240) of FIG. 2a) to verify information regarding the last stored block of each of the electronic devices corresponding to the nodes. The server may provide information regarding the latest block of the nodes included in the blockchain network (240) to each node. Here, the information regarding the latest block may include information regarding the last stored block of each of the nodes included in the blockchain network.
[0154] In operation 1103, the electronic device may request the server to add a new block to the nodes based on information about the last saved block (e.g., information about the latest block).
[0155] In operation 1105, the electronic device can check whether a compatibility issue has occurred. If, as a result of the check, a compatibility issue has occurred because synchronization for agreement has failed, the electronic device can perform operation 1107, and if not, it can perform operation 1117.
[0156] In operation 1107, the electronic device can identify that a new node (e.g., the new node (204) of FIG. 8) has been added to the blockchain network based on information about the last stored block (e.g., information about the latest block and / or signature information) by viewing or checking the server's table. Afterward, when a consensus request or a new node is added again after the operation is terminated, the method of operation of FIG. 11 can be performed.
[0157] In operation 1109, the electronic device can check version information for synchronization between nodes included in the blockchain network through the server.
[0158] In operation 1111, the electronic device can check whether the version information of the new node is a lower version. If the result of the check is that it is a lower version, the electronic device performs operation 1113, and if it is a higher version, the electronic device performs a consensus operation to add the block of the higher version in operation 1117 and can add the block of the higher version to memory.
[0159] In operation 1113, if the electronic device identifies that a new node is a lower version, it can transmit information related to the consensus to the server to synchronize based on the lower version.
[0160] In operation 1115, the electronic device may delete the previously accumulated upper version blocks in memory and add (e.g., save) the new lower version blocks to memory based on the success of the consensus for the addition of a new block. Here, the new lower version block may include transaction information including a key, a newly assigned block number, a leaf index, and a command of said lower version containing a value for said key. The leaf index is set to a newly created Merkle tree and may be automatically updated. The newly assigned block number may be newly assigned starting from the starting number of the next range for the specified block capacity.
[0161] FIG. 12 is a flowchart illustrating a method for operating a blockchain in an electronic device included in a blockchain network according to one embodiment. In the following embodiments, each operation may be performed sequentially, but is not necessarily performed sequentially. For example, the order of each operation may be changed, and at least two operations may be performed in parallel.
[0162] Referring to FIG. 12, according to one embodiment, in operation 1201, an electronic device (e.g., electronic device (101) of FIG. 1, electronic device (201) of FIG. 2a) may access a server (e.g., server (250) of FIG. 2a) configured to relay message transmission between electronic devices (e.g., a plurality of electronic devices (201, 202, 203) of FIG. 2a) corresponding to nodes included in a blockchain network (e.g., blockchain network (240) of FIG. 2a) to verify information regarding the last stored block of each of the electronic devices corresponding to the nodes. The server may provide information regarding the latest block of the nodes included in the blockchain network (240) to each node. Here, the information regarding the latest block may include information regarding the last stored block of each of the nodes included in the blockchain network.
[0163] In operation 1203, the electronic device may request the server to add a new block to the nodes based on information about the last saved block (e.g., information about the latest block).
[0164] In operation 1205, the electronic device can check whether a failure (e.g., offline or unable to synchronize) has occurred in a specific node (e.g., the first node (201)) included in the blockchain network (240). If the check reveals that a failure has occurred, the electronic device performs operation 1207, and if not, the electronic device performs operation 1211.
[0165] In operation 1207, the electronic device can identify stable and unstable numbers by checking the block numbers of each node through the server's state map table. For example, as illustrated in FIGS. 9a through 9d, the block number of the first node (201) may be an unstable latest (e.g., "5"), and the block numbers of the second node (202) and the third node (203) may be stable latest (e.g., "3"). Each node may perform lookup, synchronization, and consensus operations based only on the stable latest. For example, if f, which represents the number of stable latests, is 1, it may mean that another node of the stable latest has withdrawn. For example, if valid blocks received from the node of the stable latest are not locally connected, it may mean that the first node has been ignored as a node of the unstable latest. Here, f is the fault tolerance of the Byzantine Fault Tolerance (BFT) model.
[0166] In operation 1209, the electronic device may ignore unstable numbers, re-synchronize to follow the stable numbers of the nodes with stable numbers (e.g., as in FIG. 9b, the second node (202) and the third node (203)), and perform a consensus operation. For example, if the electronic device identifies that the block number of its first node is an unstable number (e.g., "5"), it may ignore its block, reset the block number as the blockchain operates (e.g., set to "1"), and re-synchronize to the blocks (e.g., Block 2 and Block 3) to follow the stable numbers of the second node (202) and the third node (203) (e.g., "3") to self-recover. The second node (202) and the third node (203) may ignore the block with the unstable number and perform a consensus. When ignoring unstable numbers, if the block numbers (e.g., "1") become the same, it may be impossible to distinguish between the stable latest and the unstable latest, and the node ignored as an unstable number (e.g., the first node (201)) may be unable to participate in subsequent consensus because the hash chain differs from the newly determined consensus. The node ignored as an unstable number may perform a self-recovery operation to synchronize with other nodes so that it can participate in the next consensus again, ensuring that the block number always represents a single chain.
[0167] In operation 1211, the electronic device can perform the following consensus based on the stable number. Based on the stable number, the electronic device can request a consensus through the server to add a new block to each node. The electronic device can transmit information related to the consensus to the server.
[0168] In operation 1213, the electronic device can add (e.g., store) a new block to memory based on the success of the consensus. If the consensus is successful, other nodes can also add the new block to memory.
[0169] According to one embodiment, when the block number matches the unstable number at the next agreement, the electronic device may add a dummy block corresponding to the unstable number and request an agreement with the number next in sequence to the unstable number (e.g., block number 2).
[0170] According to one embodiment, a method of operation in an electronic device (e.g., the electronic device (101) of FIG. 1 or the electronic device (201) of FIG. 2a) corresponding to one of the nodes included in a blockchain network comprises: verifying information regarding the last block stored in the nodes through a server configured to relay message transmission between the nodes included in the blockchain network via a communication circuit of the electronic device (e.g., the communication module (190) of FIG. 1); requesting the server to add a new block to the nodes based on identifying that the number of blocks accumulated in the verified memory is equal to the specified block capacity based on the verified information regarding the block; extracting transaction information regarding the last block corresponding to the number of specified transaction capacity in the nodes via the communication circuit; generating new transaction information based on the extracted transaction information; transmitting information related to consensus to initialize the blocks already stored in the nodes to the server; transmitting the new transaction information to the server so that the new transaction information to be stored in the new block is transmitted to the nodes via the server; and when the consensus for the addition of the new block is successful Based on this, the operation may include adding the new block to the memory while the previously accumulated blocks in the memory are deleted.
[0171] According to one embodiment, the new block may include transaction information including a key, a newly assigned block number, an updated leaf index, and a value for the key.
[0172] According to one embodiment, the operation of generating the new transaction information may include, when the number corresponding to the transaction capacity is 2 or more, compressing the transaction information for the last stored 2 or more blocks to generate the new transaction information to be stored in the new block. According to one embodiment, the transaction information for the 2 or more blocks may have the same newly assigned block number.
[0173] According to one embodiment, the method may further include the operation of sending a message to the server requesting that the blocks last stored in the nodes be matched when it is confirmed that the blocks last stored in the nodes are different from each other.
[0174] According to one embodiment, the method may further include: requesting the server to add new blocks to the nodes based on identifying that the number of blocks accumulated in the memory is not equal to the specified block capacity; checking version information for synchronization between nodes included in the blockchain network through the server based on identifying that a new node has been added to the blockchain network through the server; transmitting information related to a consensus to the server to synchronize based on the lower version based on identifying that the version information of the new node is a lower version; and adding the new block of the lower version to the memory with the previously accumulated blocks of the higher version deleted, based on the success of the consensus for adding the new block.
[0175] According to one embodiment, the method may include: an operation to identify a stable number and an unstable number based on information regarding the last stored block, and identifying that synchronization between the nodes has failed, such that the block number of the last block does not exceed a specified range; an operation to re-perform synchronization by restoring the block of the first node having the unstable number to become a stable number at the next consensus, based on the blocks of the second node having the stable number; an operation to request a consensus through the server to add a new block to each node based on the stable number; and an operation to add a new block to the memory based on the success of the consensus.
[0176] According to one embodiment, in a non-transient storage medium storing one or more programs, the one or more programs, when executed by at least one processor of an electronic device, cause the electronic device to perform the following operations: verifying information regarding the last stored block in the nodes through a server configured to relay message transmission between the nodes included in the blockchain network via a communication circuit of the electronic device; requesting the server to add a new block to the nodes based on identifying that the number of blocks accumulated in the verified memory is equal to a specified block capacity based on the verified information regarding the block; extracting transaction information regarding the last block corresponding to a number of specified transaction capacities from the nodes via the communication circuit; generating new transaction information based on the extracted transaction information; transmitting information related to consensus to initialize the blocks already stored in the nodes to the server; transmitting the new transaction information to the server so that the new transaction information to be stored in the new block is transmitted to the nodes via the server; and adding the new block to the memory with the previously accumulated blocks deleted from the memory based on the success of the consensus for adding the new block. It can include commands.
[0177] According to one embodiment, the one or more programs may include a command that, when executed by at least one processor of an electronic device, causes the electronic device to execute an operation to compress transaction information for the last two or more blocks stored and generate new transaction information to be stored in the new block when the number corresponding to the transaction capacity is two or more. According to one embodiment, the transaction information for the two or more blocks may have the newly assigned block number reflected identically.
[0178] According to one embodiment, the one or more programs may include a command that, when executed by at least one processor of an electronic device, causes the electronic device to execute an operation of sending a message to the server requesting that the blocks last stored in the nodes be matched if it is determined that the blocks last stored in the nodes are different from each other.
[0179] According to one embodiment of the present disclosure, an electronic device (e.g., a node) can resolve the problem of being unable to sustain consensus when there is insufficient storage space in available memory within the system and consensus data can no longer be stored once the storage space is full. Furthermore, by ensuring the circularity of the blockchain, it can maximize efficiency to fundamentally prevent system errors and ensure that usability is not degraded. According to one embodiment of the present disclosure, when a lower version node is added, the electronic device can perform a cleanup consensus operation to delete or remove (e.g., initialize) all blocks of the nodes' higher versions through cleanup consensus, thereby enabling the addition of a new block of the lower version and the execution of a new consensus operation without compatibility issues. According to one embodiment of the present disclosure, the electronic device can sustain consensus even when failures occur, such as being offline for a long period due to reasons like power / network, or when synchronization is impossible or consensus cannot be sustained. In addition, various effects identified directly or indirectly through the present disclosure may be provided. The effects obtainable from the present disclosure are not limited to those mentioned above, and other unmentioned effects will be clearly understood by those skilled in the art to which the present disclosure belongs from the description below.
[0180] Furthermore, the embodiments disclosed in this document are presented for the purpose of explaining and understanding the disclosed technical content and are not intended to limit the scope of the technology described in this document. Accordingly, the scope of this document should be interpreted to include all modifications or various other embodiments based on the technical concept of this document.
[0181] The electronic device according to the various embodiments disclosed in this document may be of various forms. The electronic device may include, for example, a portable communication device (e.g., a smartphone), a computer device, a portable multimedia device, a portable medical device, a camera, a wearable device, or a consumer electronics device. The electronic device according to the embodiments of this document is not limited to the devices described above.
[0182] The various embodiments of this document and the terms used therein are not intended to limit the technical features described in this document to specific embodiments, and should be understood to include various modifications, equivalents, or substitutions of said embodiments. In connection with the description of the drawings, similar reference numerals may be used for similar or related components. The singular form of a noun corresponding to an item may include one or more of said items unless the relevant context clearly indicates otherwise. In this document, phrases such as "A or B," "at least one of A and B," "at least one of A or B," "A, B or C," "at least one of A, B and C," and "at least one of A, B, or C" may each include any one of the items listed together in the corresponding phrase, or all possible combinations thereof. Terms such as "first," "second," or "first" or "second" may be used simply to distinguish said components from other said components and do not limit said components in any other aspect (e.g., importance or order). Where any (e.g., 1st) component is referred to as “coupled” or “connected” to another (e.g., 2nd) component, with or without the terms “functionally” or “communicationly,” it means that said any component may be connected to said other component directly (e.g., via a wire), wirelessly, or through a third component.
[0183] The term “module” as used in the various embodiments of this document may include a unit implemented in hardware, software, or firmware, and may be used interchangeably with terms such as logic, logic block, component, or circuit, for example. A module may be a component formed integrally, or a minimum unit of said component or a part thereof that performs one or more functions. For example, according to one embodiment, a module may be implemented in the form of an application-specific integrated circuit (ASIC).
[0184] Various embodiments of the present document may be implemented as software (e.g., program (140)) comprising one or more instructions stored in a storage medium (e.g., internal memory (136) or external memory (138)) readable by a machine (e.g., electronic device (101)). For example, a processor (e.g., processor (120)) of the machine (e.g., electronic device (101)) may call at least one of the one or more instructions stored in the storage medium and execute it. This enables the machine to be operated to perform at least one function according to the at least one called instruction. The one or more instructions may include code generated by a compiler or code that can be executed by an interpreter. The storage medium readable by the machine may be provided in the form of a non-transitory storage medium. Here, 'non-temporary' simply means that the storage medium is a tangible device and does not contain a signal (e.g., electromagnetic waves), and the term does not distinguish between cases where data is stored semi-permanently and cases where it is stored temporarily.
[0185] According to one embodiment, the method according to the various embodiments disclosed herein may be provided by being included in a computer program product. The computer program product may be traded between a seller and a buyer as a product. The computer program product may be distributed in the form of a device-readable storage medium (e.g., compact disc read-only memory (CD-ROM)) or an application store (e.g., Play Store). TM It can be distributed online (e.g., downloaded or uploaded) through ) or directly between two user devices (e.g., smartphones). In the case of online distribution, at least a portion of the computer program product may be temporarily stored or temporarily created on a device-readable storage medium, such as the memory of a manufacturer's server, an application store's server, or a relay server.
[0186] According to various embodiments, each component (e.g., module or program) of the components described above may include a singular or multiple entities, and some of the multiple entities may be separated and placed in other components. According to various embodiments, one or more of the components or operations of the aforementioned components may be omitted, or one or more other components or operations may be added. Generally or additionally, multiple components (e.g., module or program) may be integrated into a single component. In this case, the integrated component may perform one or more functions of each of the multiple components in the same or similar manner as those performed by the corresponding component among the multiple components prior to integration. According to various embodiments, operations performed by the module, program, or other components may be executed sequentially, in parallel, iteratively, or heuristically, or one or more of the operations may be executed in a different order, omitted, or one or more other operations may be added.
Claims
1. In an electronic device corresponding to one of the nodes included in a blockchain network, Communication circuit; At least one processor including a processing circuit; and It includes memory for storing instructions, When the above instructions are executed individually or collectively by the at least one processor, the electronic device: Through the above communication circuit, information regarding the last stored block in the nodes is verified through a server configured to relay message transmission between the nodes included in the blockchain network, and Based on identifying that the number of blocks accumulated in the confirmed memory is equal to the specified block capacity based on the information regarding the confirmed blocks, a request is made to the server to add new blocks to the nodes, and Through the above communication circuit, transaction information for the last number of blocks corresponding to the specified transaction capacity is extracted from the nodes, and Based on the above extracted transaction information, new transaction information is generated, and Sending information related to the consensus to the server to initialize the blocks previously stored in the above nodes, and The new transaction information to be stored in the new block is transmitted to the server so that the new transaction information is transmitted to the nodes via the server, and An electronic device that adds the new block to the memory with the previously accumulated blocks deleted, based on the success of the agreement on the addition of the new block.
2. In Paragraph 1, The above new block is an electronic device comprising transaction information including a key, a newly assigned block number, an updated leaf index, and a value for the key.
3. In paragraph 1, when the instructions are executed individually or collectively by the at least one processor, the electronic device, When the number corresponding to the above transaction capacity is 2 or more, the transaction information for the last two or more stored blocks is compressed to generate the new transaction information to be stored in the new block, and An electronic device in which transaction information for the above two or more blocks is identically reflected with the newly assigned block number.
4. In paragraph 1, when the instructions are executed individually or collectively by the at least one processor, the electronic device, An electronic device that, if it is confirmed that the blocks last stored in the nodes are different from one another, sends a message to the server requesting that the blocks last stored in the nodes be matched.
5. In paragraph 1, when the instructions are executed individually or collectively by the at least one processor, the electronic device, Based on identifying that the number of blocks accumulated in the memory is not equal to the specified block capacity, request the server to add new blocks to the nodes, and Based on identifying that a new node has been added to the blockchain network through the server, version information for synchronization between nodes included in the blockchain network is verified through the server, and Based on identifying that the version information of the new node is a lower version, information related to a consensus that synchronizes based on the lower version is transmitted to the server, and An electronic device that adds a new block of a lower version to memory, with the previously accumulated blocks of a higher version in memory deleted, based on the success of the agreement on the addition of the new block.
6. In paragraph 1, when the instructions are executed individually or collectively by the at least one processor, the electronic device, Based on the information regarding the last saved block, identify that the block number of the last block does not exceed a specified range and that synchronization between the nodes has failed, and Based on identifying that the block number of the last block above does not exceed the specified range and that synchronization between the nodes has failed, the stable number and the unstable number are identified, and Based on the blocks of the second node having the above stable number, the blocks of the first node having the above unstable number are restored to become the stable number at the next consensus to re-perform synchronization, and Based on the above stable number, a consensus to add a new block to each node is requested through the above server, and An electronic device that adds a new block to the memory based on the success of the consensus to add a new block to each of the above nodes.
7. A method of operation in an electronic device corresponding to one of the nodes included in a blockchain network, An operation to verify information regarding the last stored block in the nodes through a server configured to relay message transmission between the nodes included in the blockchain network via the communication circuit of the electronic device; An operation to request the server to add new blocks to the nodes based on identifying that the number of blocks accumulated in the confirmed memory, based on information regarding the confirmed blocks, is equal to the specified block capacity; The operation of extracting transaction information for the last number of blocks corresponding to the specified transaction capacity from the nodes through the above communication circuit; An operation to generate new transaction information based on the above extracted transaction information; The operation of transmitting information related to consensus to the server to initialize the blocks previously stored in the above nodes; The operation of transmitting the new transaction information to the server so that the new transaction information to be stored in the new block is transmitted to the nodes via the server; and A method comprising the operation of adding the new block to the memory in a state where the previously accumulated blocks in the memory are deleted, based on the success of the agreement on the addition of the new block.
8. In Paragraph 7, A method comprising the transaction information including the new block, a key, a newly assigned block number, an updated leaf index, and a value for the key.
9. In paragraph 7, the operation of generating the new transaction information is, When the number corresponding to the above transaction capacity is 2 or more, the method includes the operation of compressing transaction information for the last two or more stored blocks to generate the new transaction information to be stored in the new block, A method in which transaction information for the above two or more blocks is reflected identically with the newly assigned block number.
10. In paragraph 7, the above method is, A method further comprising the operation of sending a message to the server requesting that the blocks last stored in the nodes be matched when it is confirmed that the blocks last stored in the nodes are different from each other.
11. In paragraph 7, the above method is, An operation to request the server to add new blocks to the nodes based on identifying that the number of blocks accumulated in the memory is not equal to the specified block capacity; An operation to verify version information for synchronization between nodes included in the blockchain network through the server, based on identifying that a new node has been added to the blockchain network through the server; An operation of transmitting information related to a consensus to the server to synchronize based on the lower version, based on identifying that the version information of the new node is a lower version; and A method further comprising the operation of adding a new block of a lower version to memory while the previously accumulated blocks of a higher version in memory are deleted, based on the success of the agreement on the addition of the new block.
12. In paragraph 7, the above method is, An operation to identify, based on information regarding the last saved block, that the block number of the last block does not exceed a specified range and that synchronization between the nodes has failed; An operation to identify stable numbers and unstable numbers based on identifying that the block number of the last block does not exceed the specified range and that synchronization between the nodes has failed; An operation to re-perform synchronization by restoring the block of the first node having the unstable number to become a stable number at the next consensus, based on the blocks of the second node having the above stable number; An operation to request a consensus through the server to add a new block to each node based on the above stable number; and A method comprising the operation of adding a new block to the memory based on the success of the above agreement.
13. In a non-transient storage medium storing one or more programs, said one or more programs, when executed by at least one processor of an electronic device, cause said electronic device: An operation to verify information regarding the last stored block in the nodes through a server configured to relay message transmission between the nodes included in the blockchain network via the communication circuit of the electronic device; An operation to request the server to add new blocks to the nodes based on identifying that the number of blocks accumulated in the confirmed memory, based on information regarding the confirmed blocks, is equal to the specified block capacity; The operation of extracting transaction information for the last number of blocks corresponding to the specified transaction capacity from the nodes through the above communication circuit; An operation to generate new transaction information based on the above extracted transaction information; The operation of transmitting information related to consensus to the server to initialize the blocks previously stored in the above nodes; The operation of transmitting the new transaction information to the server so that the new transaction information to be stored in the new block is transmitted to the nodes via the server; and A non-transient storage medium comprising instructions for executing an operation to add the new block to the memory with the previously accumulated blocks in the memory deleted, based on the success of the agreement on the addition of the new block.
14. In paragraph 13, the above one or more programs, when executed by at least one processor of the electronic device, cause the electronic device: It includes a command to execute an operation to generate new transaction information to be stored in the new block by compressing transaction information for the last two or more blocks when the number corresponding to the transaction capacity is 2 or more, and A non-transient storage medium in which transaction information for the above two or more blocks is identically reflected by the newly assigned block number.
15. In paragraph 13, the above one or more programs, when executed by at least one processor of the electronic device, cause the electronic device: A non-transient storage medium comprising a command to execute an operation of sending a message to the server requesting that the blocks last stored in the nodes be matched when it is confirmed that the blocks last stored in the nodes are different from each other.