About contract kill and forensic investigation












2















Let’s say that I created a contract and, using that, I and other people, made many transactions which meaning is undoubtably proven reading the contract.



At a certain point someone kills the contract and all the code is canceled.



How can I prove the meaning of the transactions made in the past if the code has been deleted? Is there any practical method to going back to old blocks in order to extract the smart contract which have been used at the time?










share|improve this question




















  • 1





    I've not used contract kill, but does it remove the eth.getCode(contractAddress) value? Even if so,eth.getCode also takes a blockNumber parameter which will at least get you the run-time bytecode of the contract.

    – sp4c3
    Feb 1 at 7:42
















2















Let’s say that I created a contract and, using that, I and other people, made many transactions which meaning is undoubtably proven reading the contract.



At a certain point someone kills the contract and all the code is canceled.



How can I prove the meaning of the transactions made in the past if the code has been deleted? Is there any practical method to going back to old blocks in order to extract the smart contract which have been used at the time?










share|improve this question




















  • 1





    I've not used contract kill, but does it remove the eth.getCode(contractAddress) value? Even if so,eth.getCode also takes a blockNumber parameter which will at least get you the run-time bytecode of the contract.

    – sp4c3
    Feb 1 at 7:42














2












2








2


0






Let’s say that I created a contract and, using that, I and other people, made many transactions which meaning is undoubtably proven reading the contract.



At a certain point someone kills the contract and all the code is canceled.



How can I prove the meaning of the transactions made in the past if the code has been deleted? Is there any practical method to going back to old blocks in order to extract the smart contract which have been used at the time?










share|improve this question
















Let’s say that I created a contract and, using that, I and other people, made many transactions which meaning is undoubtably proven reading the contract.



At a certain point someone kills the contract and all the code is canceled.



How can I prove the meaning of the transactions made in the past if the code has been deleted? Is there any practical method to going back to old blocks in order to extract the smart contract which have been used at the time?







blockchain protocol history






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 9 at 20:28









eth

54.8k33200310




54.8k33200310










asked Feb 1 at 7:26









Rick ParkRick Park

1,5751217




1,5751217








  • 1





    I've not used contract kill, but does it remove the eth.getCode(contractAddress) value? Even if so,eth.getCode also takes a blockNumber parameter which will at least get you the run-time bytecode of the contract.

    – sp4c3
    Feb 1 at 7:42














  • 1





    I've not used contract kill, but does it remove the eth.getCode(contractAddress) value? Even if so,eth.getCode also takes a blockNumber parameter which will at least get you the run-time bytecode of the contract.

    – sp4c3
    Feb 1 at 7:42








1




1





I've not used contract kill, but does it remove the eth.getCode(contractAddress) value? Even if so,eth.getCode also takes a blockNumber parameter which will at least get you the run-time bytecode of the contract.

– sp4c3
Feb 1 at 7:42





I've not used contract kill, but does it remove the eth.getCode(contractAddress) value? Even if so,eth.getCode also takes a blockNumber parameter which will at least get you the run-time bytecode of the contract.

– sp4c3
Feb 1 at 7:42










2 Answers
2






active

oldest

votes


















5














The method to extract the code eth.getcode takes an optional block height parameter as documented here. The function signature is:



web3.eth.getCode(addressHexString [, defaultBlock] [, callback]),



where defaultBlock (Maybe "block" would have been a better name?) can be any block number or some special valued strings such as "earliest", "latest", or "pending". You can see the documentation here.



This means that you will be able to extract the code of the contract N blocks back. But you should note that you need to run a blockchain node which stores and indexes all historic information in order for you to be allowed to make the call at an arbitrary block height. In Parity wallet, this setting is referred to as --pruning archive, cf. https://wiki.parity.io/Getting-Synced#database-pruning.



You should also note that this function call will return the binary code of the contract, not the source code. If you receive the source code through some other souce, you can however, verify that the binary code returned by getcode matches the source code by compiling the source code with the option --bin-runtime as described in this answer:



Nothing that takes place on the blockchain is ever deleted :)






share|improve this answer


























  • A note about 'nothing ... is ever deleted': logs may get deleted at some point in the future: ethereum.stackexchange.com/q/66336/31933

    – Lauri Peltonen
    Feb 1 at 9:28











  • @LauriPeltonen the past blocks will likely always be available though, so you'll still be able to calculate the logs given the history

    – flygoing
    Feb 3 at 22:28



















0














You may try to access historic ETH data accumulated by explorers (e.g. ORS CryptoHound)






share|improve this answer








New contributor




Lewis Andersson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "642"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fethereum.stackexchange.com%2fquestions%2f66488%2fabout-contract-kill-and-forensic-investigation%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    5














    The method to extract the code eth.getcode takes an optional block height parameter as documented here. The function signature is:



    web3.eth.getCode(addressHexString [, defaultBlock] [, callback]),



    where defaultBlock (Maybe "block" would have been a better name?) can be any block number or some special valued strings such as "earliest", "latest", or "pending". You can see the documentation here.



    This means that you will be able to extract the code of the contract N blocks back. But you should note that you need to run a blockchain node which stores and indexes all historic information in order for you to be allowed to make the call at an arbitrary block height. In Parity wallet, this setting is referred to as --pruning archive, cf. https://wiki.parity.io/Getting-Synced#database-pruning.



    You should also note that this function call will return the binary code of the contract, not the source code. If you receive the source code through some other souce, you can however, verify that the binary code returned by getcode matches the source code by compiling the source code with the option --bin-runtime as described in this answer:



    Nothing that takes place on the blockchain is ever deleted :)






    share|improve this answer


























    • A note about 'nothing ... is ever deleted': logs may get deleted at some point in the future: ethereum.stackexchange.com/q/66336/31933

      – Lauri Peltonen
      Feb 1 at 9:28











    • @LauriPeltonen the past blocks will likely always be available though, so you'll still be able to calculate the logs given the history

      – flygoing
      Feb 3 at 22:28
















    5














    The method to extract the code eth.getcode takes an optional block height parameter as documented here. The function signature is:



    web3.eth.getCode(addressHexString [, defaultBlock] [, callback]),



    where defaultBlock (Maybe "block" would have been a better name?) can be any block number or some special valued strings such as "earliest", "latest", or "pending". You can see the documentation here.



    This means that you will be able to extract the code of the contract N blocks back. But you should note that you need to run a blockchain node which stores and indexes all historic information in order for you to be allowed to make the call at an arbitrary block height. In Parity wallet, this setting is referred to as --pruning archive, cf. https://wiki.parity.io/Getting-Synced#database-pruning.



    You should also note that this function call will return the binary code of the contract, not the source code. If you receive the source code through some other souce, you can however, verify that the binary code returned by getcode matches the source code by compiling the source code with the option --bin-runtime as described in this answer:



    Nothing that takes place on the blockchain is ever deleted :)






    share|improve this answer


























    • A note about 'nothing ... is ever deleted': logs may get deleted at some point in the future: ethereum.stackexchange.com/q/66336/31933

      – Lauri Peltonen
      Feb 1 at 9:28











    • @LauriPeltonen the past blocks will likely always be available though, so you'll still be able to calculate the logs given the history

      – flygoing
      Feb 3 at 22:28














    5












    5








    5







    The method to extract the code eth.getcode takes an optional block height parameter as documented here. The function signature is:



    web3.eth.getCode(addressHexString [, defaultBlock] [, callback]),



    where defaultBlock (Maybe "block" would have been a better name?) can be any block number or some special valued strings such as "earliest", "latest", or "pending". You can see the documentation here.



    This means that you will be able to extract the code of the contract N blocks back. But you should note that you need to run a blockchain node which stores and indexes all historic information in order for you to be allowed to make the call at an arbitrary block height. In Parity wallet, this setting is referred to as --pruning archive, cf. https://wiki.parity.io/Getting-Synced#database-pruning.



    You should also note that this function call will return the binary code of the contract, not the source code. If you receive the source code through some other souce, you can however, verify that the binary code returned by getcode matches the source code by compiling the source code with the option --bin-runtime as described in this answer:



    Nothing that takes place on the blockchain is ever deleted :)






    share|improve this answer















    The method to extract the code eth.getcode takes an optional block height parameter as documented here. The function signature is:



    web3.eth.getCode(addressHexString [, defaultBlock] [, callback]),



    where defaultBlock (Maybe "block" would have been a better name?) can be any block number or some special valued strings such as "earliest", "latest", or "pending". You can see the documentation here.



    This means that you will be able to extract the code of the contract N blocks back. But you should note that you need to run a blockchain node which stores and indexes all historic information in order for you to be allowed to make the call at an arbitrary block height. In Parity wallet, this setting is referred to as --pruning archive, cf. https://wiki.parity.io/Getting-Synced#database-pruning.



    You should also note that this function call will return the binary code of the contract, not the source code. If you receive the source code through some other souce, you can however, verify that the binary code returned by getcode matches the source code by compiling the source code with the option --bin-runtime as described in this answer:



    Nothing that takes place on the blockchain is ever deleted :)







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Feb 1 at 9:08

























    answered Feb 1 at 7:57









    Thorkil VærgeThorkil Værge

    2,240527




    2,240527













    • A note about 'nothing ... is ever deleted': logs may get deleted at some point in the future: ethereum.stackexchange.com/q/66336/31933

      – Lauri Peltonen
      Feb 1 at 9:28











    • @LauriPeltonen the past blocks will likely always be available though, so you'll still be able to calculate the logs given the history

      – flygoing
      Feb 3 at 22:28



















    • A note about 'nothing ... is ever deleted': logs may get deleted at some point in the future: ethereum.stackexchange.com/q/66336/31933

      – Lauri Peltonen
      Feb 1 at 9:28











    • @LauriPeltonen the past blocks will likely always be available though, so you'll still be able to calculate the logs given the history

      – flygoing
      Feb 3 at 22:28

















    A note about 'nothing ... is ever deleted': logs may get deleted at some point in the future: ethereum.stackexchange.com/q/66336/31933

    – Lauri Peltonen
    Feb 1 at 9:28





    A note about 'nothing ... is ever deleted': logs may get deleted at some point in the future: ethereum.stackexchange.com/q/66336/31933

    – Lauri Peltonen
    Feb 1 at 9:28













    @LauriPeltonen the past blocks will likely always be available though, so you'll still be able to calculate the logs given the history

    – flygoing
    Feb 3 at 22:28





    @LauriPeltonen the past blocks will likely always be available though, so you'll still be able to calculate the logs given the history

    – flygoing
    Feb 3 at 22:28











    0














    You may try to access historic ETH data accumulated by explorers (e.g. ORS CryptoHound)






    share|improve this answer








    New contributor




    Lewis Andersson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.

























      0














      You may try to access historic ETH data accumulated by explorers (e.g. ORS CryptoHound)






      share|improve this answer








      New contributor




      Lewis Andersson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.























        0












        0








        0







        You may try to access historic ETH data accumulated by explorers (e.g. ORS CryptoHound)






        share|improve this answer








        New contributor




        Lewis Andersson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.










        You may try to access historic ETH data accumulated by explorers (e.g. ORS CryptoHound)







        share|improve this answer








        New contributor




        Lewis Andersson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        share|improve this answer



        share|improve this answer






        New contributor




        Lewis Andersson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        answered 11 hours ago









        Lewis AnderssonLewis Andersson

        1




        1




        New contributor




        Lewis Andersson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.





        New contributor





        Lewis Andersson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.






        Lewis Andersson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Ethereum Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fethereum.stackexchange.com%2fquestions%2f66488%2fabout-contract-kill-and-forensic-investigation%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Index of /

            Tribalistas

            Listed building