简体   繁体   English

使用区块链和 IPFS 签署文件

[英]Signing Documents with Blockchain and IPFS

For my little project I need help and if it's possible.对于我的小项目,我需要帮助,如果可能的话。 The project is about signing documents using blockchain and IPFS.该项目是关于使用区块链和 IPFS 签署文件。 I try to create a DApp with following features:我尝试创建具有以下功能的 DApp:

  1. Signer has to LogIn签名者必须登录
  2. After LogIn has been successful you can upload a document.登录成功后,您可以上传文件。
  3. You can sign uploaded document.您可以签署上传的文件。
  4. DocumentHash is generated.生成 DocumentHash。 DocumentHash should be stored on Ethereum Blockchain. DocumentHash 应该存储在以太坊区块链上。 Signed document is stored on IPFS.签名文件存储在 IPFS 上。

Now I am trying to write my smart contract.现在我正在尝试编写我的智能合约。 The signature should be created as a object.签名应创建为 object。 So a signature is made of Name and actual time.因此,签名由名称和实际时间组成。 This means signature should be created out of the information of the LogIn-process (first Name, last Name, SignerID (is unique, like password).这意味着应该根据登录过程的信息(名字、姓氏、SignerID(是唯一的,如密码))创建签名。

Is this possible with a Smart Contract?这可以通过智能合约实现吗? I don't know what to do so I don't know how to create this Signature within a Smart Contract and put the signature to the document.我不知道该怎么做,所以我不知道如何在智能合约中创建此签名并将签名放入文档中。 Then I know what to do with hashing the whole document and push it to IPFS... Thank you!然后我知道如何对整个文档进行哈希处理并将其推送到 IPFS ......谢谢!

The good news is: All your problems are already solved.好消息是:你所有的问题都已经解决了。 The bad news (for you): Without blockchain.坏消息(对你来说):没有区块链。

I'm also not smart which this is smart in any way, but typically that's the way you want to go:我也不聪明,这在任何方面都很聪明,但通常这就是你想要 go 的方式:

  1. Take a hash over all the documents you want to sign拿 hash 来检查您要签署的所有文件

  2. Looking at the public key cryptography ( https://en.wikipedia.org/wiki/Public-key_cryptography ), sign the hash with your private key.查看公钥加密( https://en.wikipedia.org/wiki/Public-key_cryptography ),用您的私钥签署 hash。 Signing the hash will proof the authenticy later.签署 hash 将在以后证明真实性。

  3. Put the hash in any blockchain you want将 hash 放入您想要的任何区块链中

By the way: There are a lot of Certificate Authorities that would also sign your hash from 2) without any high engery-consuming smart and inefficient blockchain stuff.顺便说一句:有很多证书颁发机构也会从 2) 签署您的 hash,而不需要任何高能耗的智能和低效的区块链内容。 Just saying.只是说。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM