Digitally Signing Document using Ethereum Smart Contracts

Just wondering if anyone is working on creating a solution for digitally signing a document similar to https://blocksign.com. Blocksign is powered by BitCoin I'm looking for a similar approach using non-bitcoin blockchain. Any inputs is highly appreciated.

Comments

  • MetalMetal Member Posts: 17
    It sounds like a simple contract that stores a list of ethereum addresses associated with the hash of a given document.
    So perhaps something like
    contract Blocksign {
        mapping(bytes32 => address[]) public verify;
        
        function sign(bytes32 document) {
            var signatures = verify[document];
            signatures.length += 1;
            signatures[signatures.length-1] = msg.sender;
        }
    }
    
    To sign, call Blocksign.sign(sha256(your_file)), and the calling account will be added as a signer.
    To verify, keep calling Blocksign.verify(sha256(your_file), 0), Blocksign.verify(sha256(your_file), 1), etc until you get 0 back.
    That'll tell you who signed the document so far.
    If you get 0 right away, it means the document isn't signed, or has been tampered with after being signed.

  • ILethereumILethereum Member Posts: 34
    Metal Thanks for the Idea. The issue I'm facing is with mapping(bytes32 => address[]) public verify. When getting the mapping value, after setting it via web3,js it always returns 0x. Not sure of Bytes32 as key is supported for mapping()? If not what is the alternative do we have. Appreciate your help.
  • ILethereumILethereum Member Posts: 34
    I'm able to call the contracts successfully. Might be the issue is related to a web3 rpc bug where string(bytes32) cannot be used as a key for mapping. Please see the related post-
    https://github.com/ethereum/web3.js/issues/314
    https://gitter.im/ethereum/web3.js?at=55e78ed62ec6bacd1e2da468

    Looking for a workaround.
  • v_k1v_k1 Member Posts: 1
    edited February 1
    does this service would be popular? I do not think so. it is wrong to store just hash of the document, so if you would store whole document you may need to encrypt it, and it would costs a lot of money for 1 MB of data. Also it would be not comfortable to use it, why should I download whole chain to sign 1 document ? Even if you would make a EVM proxy WEB API, there is still need somehow to pay. If you would integrate payment gateway there is additional fees ? I could make it, but don't think it would be popular.
Sign In or Register to comment.