CN112835855A - File storage method and system based on block chain - Google Patents

File storage method and system based on block chain Download PDF

Info

Publication number
CN112835855A
CN112835855A CN202110195865.8A CN202110195865A CN112835855A CN 112835855 A CN112835855 A CN 112835855A CN 202110195865 A CN202110195865 A CN 202110195865A CN 112835855 A CN112835855 A CN 112835855A
Authority
CN
China
Prior art keywords
file
storage
task
block chain
node
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110195865.8A
Other languages
Chinese (zh)
Inventor
张扬
李刘海
吴飞鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Peersafe Technology Co ltd
Original Assignee
Beijing Peersafe Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Peersafe Technology Co ltd filed Critical Beijing Peersafe Technology Co ltd
Priority to CN202110195865.8A priority Critical patent/CN112835855A/en
Publication of CN112835855A publication Critical patent/CN112835855A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • G06F16/134Distributed indices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • G06F16/137Hash-based
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/182Distributed file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage systems
    • G06F3/0619Improving the reliability of storage systems in relation to data integrity, e.g. data losses, bit errors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0625Power saving in storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0643Management of files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/067Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/21Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/2107File encryption

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Human Computer Interaction (AREA)
  • Computer Security & Cryptography (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • Storage Device Security (AREA)

Abstract

The invention provides a file storage method based on a block chain, which comprises the following steps: calling a storage file task list from a block chain, and registering a pick-up task to a task contract of the block chain, wherein the storage file task list is uploaded to the file task contract of the block chain by a file storage party; obtaining a random file initial position generated according to a preset strategy, and reading a file to be stored, wherein the file content with a specified length can be read from the position; and after the file to be stored is obtained, periodically submitting a storage certificate to a file task contract of the block chain. The invention also provides a file storage system based on the block chain. The invention is based on the block chain, forms a completely decentralized file storage scheme, and ensures that a storage party cannot make a fake.

Description

File storage method and system based on block chain
Technical Field
The invention relates to the technical field of block chains, in particular to a file storage method and system based on a block chain.
Background
In daily production and life, a large amount of files or data can be used, and storage is an irremediable problem.
Storage may be selected to be local, thus resulting from the large number of hardware devices that have been purchased, requiring a large capital investment. If the file only needs to be stored for a period of time and can be destroyed later, the equipment that is invested is wasted. In addition, the purchase of hardware equipment by oneself brings troublesome work such as maintenance, updating and the like. Therefore, selecting local storage may consume manpower and material resources, which may result in resource waste.
The file is stored in the cloud space, so that some defects of local storage are avoided, but the mechanism of the cloud disk is a centralized storage mode, so that data cannot be guaranteed not to be modified, the data is easy to lose, and more importantly, the cost for storing the file by using the cloud disk is higher.
Disclosure of Invention
Based on the above practical problems, the invention provides a block chain-based file storage system method, which comprises the following steps:
calling a storage file task list from a block chain, and registering a pick-up task to a task contract of the block chain, wherein the storage file task list is uploaded to the file task contract of the block chain by a file storage party;
obtaining a random file initial position generated according to a preset strategy, and reading a file to be stored, wherein the file content with a specified length can be read from the position;
and after the file to be stored is obtained, periodically submitting a storage certificate to a file task contract of the block chain.
Optionally, the method for generating the storage attestation includes: 1) calculating the abstract value of the current block of the task and the abstract value of the address when the file is stored to obtain a random abstract value; 2) determining a reading position of the random digest value; 3) calculating to obtain a fragment index to be read according to the reading position, the fragment size and the file size; 4) performing digest operation on the contents of the M bytes read from the reading position of the fragment index to obtain an original image hash1, and performing digest operation on the original image hash1 to obtain a check value hash 2; 5) the check value hash2 is stored as a proof of storage in the file job contract.
Optionally, the method of the present invention further comprises the step of verifying said stored certificate: acquiring a task to be verified from a block chain network; and generating a second check value for the file of the task to be verified by using the same method as the method for generating the storage certificate, comparing the second check value with the file storage certificate in the file task contract, and if the second check value is the same as the file storage certificate, successfully verifying.
Optionally, the method of the present invention further comprises: requesting to download a file and registering a pledge token in a pick-up task to a block chain network; and after the storage certification is passed, returning tokens of the pledges in proportion.
Optionally, the file task contract comprises: the file uploading party address, the target storage file abstract, the target storage file name, the encrypted file abstract, the file size and the encrypted secret key seed of the file uploading party public key.
Optionally, the method of the present invention further comprises: and downloading the stored file according to the information in the file task contract, and decrypting the file by using the private key of the uploading party.
The invention also provides a file storage system based on the block chain, which comprises: the file transfer node transfers the storage file task list to the block chain and registers a pickup task to a task contract of the block chain; generating a random file initial position according to a preset strategy, and reading a file to be stored; and periodically submitting a storage certificate to a file task contract of the block chain after the file to be stored is obtained, wherein the storage file task list is uploaded to the file task contract of the block chain by a file storage party.
Optionally, the file retrieval node generates the storage certificate by: 1) calculating the abstract value of the current block of the task and the abstract value of the address when the file is stored to obtain a random abstract value; 2) determining a reading position of the random digest value; 3) calculating to obtain a fragment index to be read according to the reading position, the fragment size and the file size; 4) performing digest operation on the contents of the M bytes read from the reading position of the fragment index to obtain an original image hash1, and performing digest operation on the original image hash1 to obtain a check value hash 2; 5) the check value hash2 is stored as a proof of storage in the file job contract.
Optionally, the system of the present invention further comprises: the file storage node receives the target storage file, encrypts the target storage file to generate a plurality of encrypted files and stores the encrypted files; and the file task node stores the storage certificate periodically submitted by the file calling node into the block chain network, and calls the file task contract stored in the block chain network to the file calling node. And the storage verification node acquires the storage information of the file to be downloaded from the file task contract acquired by the block chain, and verifies whether the storage information is consistent with the storage certificate submitted by the file calling node.
Optionally, the storage verification node verifies the storage attestation by: acquiring a task to be verified from a block chain network; and generating a second check value for the file of the task to be verified by using the same method as the method for generating the storage certificate by the file calling node, comparing the second check value with the file storage certificate in the file task contract, and if the second check value is the same as the file storage certificate, successfully verifying the file.
The system stores the file in the distributed system, and enables the individual user to provide the idle storage resource, and the storage in the way ensures the distribution of file storage, and the data resource is not easy to lose, and the cost is lower. And the problems of centralized data management and higher cost of the current data storage are solved.
On the other hand, storing files in a distributed system, when a storage party provides storage resources, how to prove that the storage party stores file data, are important problems to be solved. The system of the invention is based on the block chain, forms a completely decentralized file storage system, and realizes that:
1) the disclosed task mechanism enables users to compare, and greatly reduces the storage cost of the network disk.
2) A reliable file storage attestation mechanism ensures that the storage party does not make a fake.
3) Reasonable incentive measures enable the participants to have the enthusiasm for participating in distributed file storage, and idle storage and bandwidth are fully utilized.
Drawings
In order that the invention may be more readily understood, it will be described in more detail with reference to specific embodiments thereof that are illustrated in the accompanying drawings. These drawings depict only typical embodiments of the invention and are not therefore to be considered to limit the scope of the invention.
Figure 1 shows a flow chart of the method of the invention.
Fig. 2 shows an architecture diagram of the system of the present invention.
Detailed Description
Embodiments of the present invention will be described below with reference to the accompanying drawings so that those skilled in the art can better understand the present invention and can carry out the present invention, but the illustrated embodiments are not intended to limit the present invention, and technical features in the following embodiments and embodiments can be combined with each other without conflict, wherein like parts are denoted by like reference numerals.
First embodiment
As shown in FIG. 1, in one embodiment, the system of the present invention includes a file storage node. The file storage node receives a target storage file uploaded by a client (a file uploading party) and the redundant backup number N of the file. The file storage node generates (can randomly generate) N keys according to the redundant backup number N, encrypts the target storage file by the N keys respectively to generate N encrypted files, and stores the encrypted files in the network. Meanwhile, the file storage node encrypts the N keys (may use the public key of the user to perform asymmetric encryption, and the subsequent client may use the private key of the user to perform decryption), and stores the key seed.
Optionally, a plurality of file storage nodes form a distributed network. In the distributed network, a file is divided into several small blocks and stored in one or several nodes of the distributed network (for example, a PDFS file storage system).
Further, after the storage is completed, the file storage node returns the storage information to the client, including: the digest value of the target storage file, the digest value of the encrypted file, and the encrypted encryption key (key seed) corresponding to each encrypted file.
And after receiving the storage information, the client side issues a file storage task to a file task contract of the block chain network. The necessary elements contained in the document task contract include: the address of a depositor (the address of a task publisher on a blockchain), the digest of a target storage file, the name of the target storage file, the digest of an encrypted file, the size of the file, and the secret key seed after encryption of a user public key.
Optionally, the uploaded files are determined by a user, for example, the user selects files that the user wants to store on the network disk, and the number N of redundant backups may also be set by the user or determined by the client or the file storage node.
Referring to fig. 1, the system of the present invention further comprises: and (5) calling a node by the file.
And the file calling node calls an existing task list from the blockchain network through the file task node and registers a pickup task to a task contract of the blockchain. Alternatively, the file retrieval node may select an appropriate (price, size) storage task from the task list. And after the file calling node receives the task, the file designated in the task is obtained from the file storage node. The file calling node can obtain the file in a PIN file mode, and the obtained file is an encrypted file.
When the file transfer node obtains the task, all information of a file task contract is obtained, including: target storage file abstract, target storage file name, various encrypted file abstracts, various file sizes and a secret key seed after encryption of a user public key.
When the file calling node requests the stored file from the file storage node. The sent request information comprises a file abstract, and the content of the file can be obtained according to the file abstract.
In addition, after obtaining the encrypted file, the file retrieval node needs to periodically submit a storage certificate to a file task contract of the blockchain network.
In one embodiment, the storage attestation may be submitted by: the file calling node obtains a random file starting position according to a preset strategy, and the file content with the specified length can be read from the position. The start position is then stored in the task contract. Wherein the file holder proves to be able to read the file content of the specified length from this location.
In another embodiment, the storage attestation may be submitted by:
1) and the file transfer node performs exclusive OR operation on the digest value of the current block (the block number when the file transfer node issues the task + the sending storage certification period) and the digest value of the address of the storage person to obtain a random digest value.
2) The read position of the random digest value is determined, and the read position is bignumber% (file _ size-32).
3) And calculating the slice index to be read according to the reading position, the slice (shading) size and the file size.
4) For M (e.g., 32 bytes) bytes read from the read position of the slice index ((R))
Figure BDA0002946466560000061
Degree 0-32), namely, performing digest operation on the content to obtain an original image hash1, and performing digest operation on the original image to obtain a check value hash 2.
5) The check value hash2 is stored as a proof of storage in the file job contract.
In one embodiment, a PDFS (functional Distributed File System) File storage system may be employed. The file storage node and the file retrieval node are both nodes in the PDFS file system.
Referring to fig. 1, the system of the present invention further comprises: the verification node is stored. The storage verification node is used for verifying the correctness of the storage certificate submitted by the file retrieval node. The method comprises the following steps:
1) and the storage verification node acquires the task to be verified from the block chain network through the file task node.
2) And the storage verification node calculates the fragments to be downloaded. The calculation method is consistent with the calculation method of the production fragment of the file transfer node, and specifically comprises the following steps: A) and the storage verification node performs exclusive OR operation on the digest value of the current block (the block number when the file retrieval node issues the task + the storage certification sending period) and the digest value of the address of the storage person to obtain a random digest value. B) The read position of the random digest value is determined, and the read position is bignumber% (file _ size-32). C) And calculating the slice index to be read according to the reading position, the slice (shading) size and the file size.
3) And the storage verification node downloads the corresponding fragment data from the distributed file system. In the present invention, only this fragment needs to be downloaded. The storage verification node may be deployed as a pdfs node. The storage verification node can be understood as an identity of a user, and a verification method and a pdfs node are loaded in the storage verification node.
4) The storage verification node calculates a pre-image hash 1.
5) The storage verification node compares the pre-image with the check value and submits the pre-image hash1 to the file task contract in the blockchain network if the pre-image hash1 equals the check value hash 2.
Optionally, the blockchain network may validate file task contracts submitted by the storage validation nodes. The verification process is as follows: the blockchain network hashes 1 of the primary image submitted by the storage verification node again to see whether the result is equal to the hash2 of the check value submitted by the file retrieval node before.
When the client wants to download the file stored by the client, the following operations are carried out:
1) the client obtains the file digests of the redundant files and the encryption keys according to the original file digests in the task details in the block chain network.
2) The client downloads the file from the file storage node through the 'file abstract of the redundant file', and only any one of the redundancies needs to be downloaded successfully. The download file is an encrypted file.
3) The client decrypts the "encryption key" of the downloaded encrypted file using the user's private key, and then decrypts the file using the obtained key.
In one embodiment, the file fetching node is a running distributed file storage service (PDFS) and a file task management service, which anyone can access. The storage verification node runs the distributed file storage service PDFS and the storage certification verification service, and can be accessed after applying for verification. The file storage solution is matched with a PDFS super node of the client, is provided by an official party, and can be set up by a user. The file task node can be an API, is used for exporting data of all file task intelligent contracts, provides nodes of inquiry and statistic related APIs, and can be accessed by anyone. A PIN file refers to a file pulled from another node.
Second embodiment
And after receiving the storage information, the client (file uploading party) issues a file storage task to a file task contract of the blockchain network. In addition to the essential elements (target storage file digest, target storage file name, each encrypted file digest, each file size, key seed after encryption of the user public key) as in the first embodiment, the essential elements contained in the task may include an incentive element: store prices, reward distribution cycles, etc.
Moreover, the client (distributor of the task, that is, the depositor, the file uploading party) when issuing the task, reserves a certain token for the reward of file storage to the "file task contract" of the blockchain network.
The file transfer node requests the file storage node to download the file, and registers a certain token required for the pledge of the task to the block chain network for penalty when the task is not completed.
After the contract submitted by the storage verification node passes verification, the blockchain network returns tokens of the document retrieval node pledge in proportion, and distributes awarded tokens to the document retrieval node and the storage verification node respectively in proportion from the tokens of the pledge of the task (namely, a depositor). If the verification does not pass (if the hash (hash1) does not equal hash2), the token storing the verification node pledge will not get returned.
Third embodiment
As shown in fig. 2, the present invention further provides a method comprising:
s1, the client uploads the target storage file and the redundant backup number N of the file to the file storage node.
The uploaded files are determined by a user, for example, the user selects files which the user wants to store on a network disk, and the number N of redundant backups can be set by the user or determined by a client or a file storage node.
S2, the file storage node generates (can randomly generate) N keys according to the redundant backup number N, encrypts the target storage file by the N keys respectively to generate N encrypted files, and stores the encrypted files in the PDFS network.
Further, the file storage node may return relevant information to the user, including: the digest value of the target storage file, the digest value of the encrypted file, and the encrypted encryption key corresponding to each encrypted file.
Optionally, the file storage node may encrypt the file by: asymmetric encryption is performed using the user's public key.
S3, the client user issues a file storage task into the blockchain network.
Specifically, the client issues file storage tasks into a task contract for the blockchain network. The essential elements involved in a task are: target storage file abstract, target storage file name, various encrypted file abstracts, various file sizes and a secret key seed after encryption of a user public key.
In one embodiment, the necessary elements included in the task may also include an incentive element: store prices, reward distribution cycles, etc. At this time, the client needs to reserve a certain token for the "task intelligence contract" of the blockchain network, and the token is used for rewarding file storage.
S4, the file retrieval node downloads the file from the file storage node, and registers the pick-up job with the job contract, and retrieves the specified encrypted file (retrieved by the PIN file) from the file storage node.
Specifically, the PDFS storage node may look up an already existing task list from the file API service, and select a storage task that the PDFS storage node finds appropriate (price, size).
In one embodiment, when the task contains the incentive elements again in S3, the file invocation node downloads the file and registers the pick-up task, and a certain token is required for the pledge of the penalty of not completing the task.
S5, the file retrieval node periodically sends a storage certificate to the blockchain network.
In one embodiment, the storage attestation is generated as follows:
1) and the file transfer node performs exclusive OR operation on the digest value of the current block (the block number when the task is issued + the sending storage certification period) and the digest value of the address of the depositor to obtain a random digest value.
2) Bignumber% (file _ size-32) of random digest value, read position
3) And calculating to obtain the fragment index to be read according to the reading position, the fragment size and the file size.
4) For M (e.g., 32 bytes) bytes of content read from the read location of the slice (R) ((R))
Figure BDA0002946466560000091
Degree 0-32) to obtain the original image hash 1. And performing a digest operation on the digest value to obtain a check value hash2, and sending the check value hash2 to the task contract.
S6, the storage verification node verifies the correctness of the storage certification, including S61-S65.
S61) obtaining the task to be verified from the blockchain network, optionally obtaining the task to be verified from the blockchain network through the file task API service.
S62) calculates the segment to be downloaded. The calculation method is the same as that of the file pickup node in S5.
S63) downloading the corresponding shard data from the PDFS system. In the present invention, only this fragment needs to be downloaded.
S64) to obtain a pre-image hash 1.
S65) comparing the pre-image with the check value, and if the pre-image hash1 is equal to the check value hash2, submitting the pre-image hash1 to the file contract.
S7, the blockchain network validates the contract submitted by the storage validation node. Including S71-S73.
S71, the contract hashes the hash1 of the verifying node again to see if the result equals the hash2 submitted by the storage node
S72, after the contract verification is passed, proportionally returning tokens of the storage node pledges, and proportionally distributing reward tokens to the storage node and the storage verification node from the tokens of the task distributor pledges
S73, if the hash (hash1) is not equal to hash2, the token of the storage node pledge is not returned.
And S8, the client acquires (by means of PIN) files belonging to the client from the distributed storage network.
And S81, the client obtains the file digests of the redundant files and the encryption keys according to the original file digests in the task details.
S81, the client downloads the file from the PDFS through the "file digest of the redundant file" as long as any one of the redundancies is successfully downloaded.
S81, the client decrypts the "encryption key" of the downloaded encrypted file using the user' S private key, and then decrypts the file using the obtained key.
The invention provides an overall architecture scheme based on a block chain and a distributed file storage network. Moreover, a periodic storage certification and verification scheme is provided to ensure the reliability of storage.
The embodiments described above are merely preferred specific embodiments of the present invention, and the present specification uses the phrases "in one embodiment," "in another embodiment," "in yet another embodiment," or "in other embodiments," which may each refer to one or more of the same or different embodiments in accordance with the present disclosure. General changes and substitutions by those skilled in the art within the technical scope of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A file storage method based on a block chain is characterized by comprising the following steps:
calling a storage file task list from a block chain, and registering a pick-up task to a task contract of the block chain, wherein the storage file task list is uploaded to the file task contract of the block chain by a file storage party;
obtaining a random file initial position generated according to a preset strategy, and reading a file to be stored, wherein the file content with a specified length can be read from the position;
and after the file to be stored is obtained, periodically submitting a storage certificate to a file task contract of the block chain.
2. The file storage method according to claim 1, wherein the method of generating the storage attestation comprises:
1) calculating the abstract value of the current block of the task and the abstract value of the address when the file is stored to obtain a random abstract value;
2) determining a reading position of the random digest value;
3) calculating to obtain a fragment index to be read according to the reading position, the fragment size and the file size;
4) performing digest operation on the contents of the M bytes read from the reading position of the fragment index to obtain an original image hash1, and performing digest operation on the original image hash1 to obtain a check value hash 2;
5) the check value hash2 is stored as a proof of storage in the file job contract.
3. The file storage method according to claim 2, further comprising the step of verifying the storage certificate:
acquiring a task to be verified from a block chain network;
and generating a second check value for the file of the task to be verified by using the same method as the method for generating the storage certificate, comparing the second check value with the file storage certificate in the file task contract, and if the second check value is the same as the file storage certificate, successfully verifying.
4. The file storage method according to claim 3, further comprising:
requesting to download a file and registering a pledge token in a pick-up task to a block chain network;
and after the storage certification is passed, returning tokens of the pledges in proportion.
5. The file storage method according to claim 4,
the file task contract comprises: the file uploading party address, the target storage file abstract, the target storage file name, the encrypted file abstract, the file size and the encrypted secret key seed of the file uploading party public key.
6. The file storage method according to claim 5,
and downloading the stored file according to the information in the file task contract, and decrypting the file by using the private key of the uploading party.
7. A blockchain-based file storage system, comprising:
the file transfer node transfers the storage file task list to the block chain and registers a pickup task to a task contract of the block chain; generating a random file initial position according to a preset strategy, and reading a file to be stored; and periodically submitting a storage certificate to a file task contract of the block chain after the file to be stored is obtained, wherein the storage file task list is uploaded to the file task contract of the block chain by a file storage party.
8. The file storage system of claim 7, wherein the file retrieval node generates the storage attestation by:
1) calculating the abstract value of the current block of the task and the abstract value of the address when the file is stored to obtain a random abstract value;
2) determining a reading position of the random digest value;
3) calculating to obtain a fragment index to be read according to the reading position, the fragment size and the file size;
4) performing digest operation on the contents of the M bytes read from the reading position of the fragment index to obtain an original image hash1, and performing digest operation on the original image hash1 to obtain a check value hash 2;
5) the check value hash2 is stored as a proof of storage in the file job contract.
9. The file storage system according to claim 8, further comprising:
the file storage node receives the target storage file, encrypts the target storage file to generate a plurality of encrypted files and stores the encrypted files;
the file task node stores a storage certificate periodically submitted by the file calling node into the block chain network, and calls a file task contract stored in the block chain network to the file calling node;
and the storage verification node acquires the storage information of the file to be downloaded from the file task contract acquired by the block chain, and verifies whether the storage information is consistent with the storage certificate submitted by the file calling node.
10. The file storage system of claim 9, wherein the storage validation node validates the storage attestation by:
acquiring a task to be verified from a block chain network;
and generating a second check value for the file of the task to be verified by using the same method as the method for generating the storage certificate by the file calling node, comparing the second check value with the file storage certificate in the file task contract, and if the second check value is the same as the file storage certificate, successfully verifying the file.
CN202110195865.8A 2021-02-22 2021-02-22 File storage method and system based on block chain Pending CN112835855A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110195865.8A CN112835855A (en) 2021-02-22 2021-02-22 File storage method and system based on block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110195865.8A CN112835855A (en) 2021-02-22 2021-02-22 File storage method and system based on block chain

Publications (1)

Publication Number Publication Date
CN112835855A true CN112835855A (en) 2021-05-25

Family

ID=75934219

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110195865.8A Pending CN112835855A (en) 2021-02-22 2021-02-22 File storage method and system based on block chain

Country Status (1)

Country Link
CN (1) CN112835855A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115412275A (en) * 2022-05-23 2022-11-29 蚂蚁区块链科技(上海)有限公司 Trusted execution environment-based private computing system and method
CN115529319A (en) * 2022-08-04 2022-12-27 熵链科技(厦门)有限公司 Storage service regulation and control method, system, equipment and storage medium based on IPFS network

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109426567A (en) * 2017-08-22 2019-03-05 汇链丰(北京)科技有限公司 A kind of node deployment and electoral machinery of block chain
CN109740375A (en) * 2018-12-19 2019-05-10 深圳市汇星数字技术有限公司 A kind of shared and dissemination method of original audio production
CN109889498A (en) * 2019-01-16 2019-06-14 余炀 Calculating verification method and system based on block chain
CN110062034A (en) * 2019-04-01 2019-07-26 中科天御(苏州)科技有限公司 A kind of big file safety storage method of block chain and system
CN110442561A (en) * 2019-07-08 2019-11-12 南京邮电大学 Distributed file storage system and its storage method based on block chain
CN110611701A (en) * 2018-08-21 2019-12-24 汇链丰(北京)科技有限公司 Parameter configuration and transaction processing method based on block chain
CN110647503A (en) * 2019-10-09 2020-01-03 重庆特斯联智慧科技股份有限公司 Distributed storage method and device
CN110674533A (en) * 2019-09-25 2020-01-10 浙江大学 Block chain consensus excitation system and method based on large-scale scientific core calculation
CN110855760A (en) * 2019-10-29 2020-02-28 上海海加网络科技有限公司 Block chain-based distributed secure storage system deployment method
CN111177265A (en) * 2019-12-27 2020-05-19 安徽讯呼信息科技有限公司 Block chain domain division method
CN111475821A (en) * 2020-01-17 2020-07-31 吉林大学 Block chain consensus mechanism method based on file storage certification
CN111966657A (en) * 2020-08-17 2020-11-20 南京邮电大学 Distributed file classified storage system and storage method based on block chain

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109426567A (en) * 2017-08-22 2019-03-05 汇链丰(北京)科技有限公司 A kind of node deployment and electoral machinery of block chain
CN110611701A (en) * 2018-08-21 2019-12-24 汇链丰(北京)科技有限公司 Parameter configuration and transaction processing method based on block chain
CN109740375A (en) * 2018-12-19 2019-05-10 深圳市汇星数字技术有限公司 A kind of shared and dissemination method of original audio production
CN109889498A (en) * 2019-01-16 2019-06-14 余炀 Calculating verification method and system based on block chain
CN110062034A (en) * 2019-04-01 2019-07-26 中科天御(苏州)科技有限公司 A kind of big file safety storage method of block chain and system
CN110442561A (en) * 2019-07-08 2019-11-12 南京邮电大学 Distributed file storage system and its storage method based on block chain
CN110674533A (en) * 2019-09-25 2020-01-10 浙江大学 Block chain consensus excitation system and method based on large-scale scientific core calculation
CN110647503A (en) * 2019-10-09 2020-01-03 重庆特斯联智慧科技股份有限公司 Distributed storage method and device
CN110855760A (en) * 2019-10-29 2020-02-28 上海海加网络科技有限公司 Block chain-based distributed secure storage system deployment method
CN111177265A (en) * 2019-12-27 2020-05-19 安徽讯呼信息科技有限公司 Block chain domain division method
CN111475821A (en) * 2020-01-17 2020-07-31 吉林大学 Block chain consensus mechanism method based on file storage certification
CN111966657A (en) * 2020-08-17 2020-11-20 南京邮电大学 Distributed file classified storage system and storage method based on block chain

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115412275A (en) * 2022-05-23 2022-11-29 蚂蚁区块链科技(上海)有限公司 Trusted execution environment-based private computing system and method
CN115529319A (en) * 2022-08-04 2022-12-27 熵链科技(厦门)有限公司 Storage service regulation and control method, system, equipment and storage medium based on IPFS network

Similar Documents

Publication Publication Date Title
JP6690066B2 (en) Validating the integrity of data stored on the consortium blockchain using the public sidechain
CN108734576B (en) Block chain-based educational resource sharing method and system
CN108462568B (en) Block chain-based secure file storage and sharing method and cloud storage system
CN102170440B (en) Method suitable for safely migrating data between storage clouds
TW202024944A (en) Data sharing method, apparatus, and system, and electronic device
WO2018119892A1 (en) Method and device for publishing and validating software application program
Khovratovich et al. Sovrin: digital identities in the blockchain era
CN108848080A (en) Data-sharing systems based on the storage verification of alliance's chain
US9893896B1 (en) System and method for remote storage auditing
CN109600366A (en) The method and device of protection user data privacy based on block chain
US11133936B1 (en) Methods and systems for introducing self-contained intent functionality into decentralized computer networks
CN112131227A (en) Data query method and device based on alliance chain
CA3066479A1 (en) Secure token passing via blockchains
CN112835855A (en) File storage method and system based on block chain
US20220052921A1 (en) Methods and systems for introducing self-contained intent functionality into decentralized computer networks
US20230138102A1 (en) Method and system for managing decentralized data using attribute-based encryption
CN108667917A (en) A kind of method, apparatus, computer storage media and terminal for realizing data storage
CN109146479A (en) Data ciphering method based on block chain
WO2021179840A1 (en) Methods and devices for providing privacy-preserving blockchain-based auction
CN111259439A (en) Intangible asset management service platform based on block chain and implementation method thereof
CN113704357A (en) Smart city data sharing method and system based on block chain
CN107094075A (en) A kind of data block dynamic operation method based on convergent encryption
Kothari et al. A distributed peer-to-peer storage network
CN111091381A (en) Hardware wallet and management method thereof
Xiao et al. A collaborative auditing scheme with dynamic data updates based on blockchain

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination