sidetree
sidetree copied to clipboard
Investigate custom pruning of non-Sidetree txns
It's possible to set a Bitcoin node to allow custom pruning of select transactions. Investigate what it would take to prune all non-Sidetree transactions, which should reduce retained storage considerably.
A temporal workaround would be to prune everything before the sidetree genesis, this way allows to keep a Bitcoin node with small space requirements for a good amount of time.
@AlexITC I agree that we should automatically prune all txns before Sidetree genesis - @thehenrytsai, perhaps we can take a look at this to avoid even iterating those txns to inspect for sidetree hashes?
I wonder if @jlopp has any experience using the prune utilities in Core to prune txns selectively?
I'm only familiar with the high-level setting of "keep X megabytes of trailing blocks"
Regarding not pruning specific transactions, I suspect that it won't prune any transactions that are added to the wallet, though I'm not sure if you could add sidetree transactions as watch-only in order to achieve that goal.
It looks like you MAY be able to achieve this with the 'importPrunedFunds' RPC https://bitcoin.org/en/developer-reference#importprunedfunds
If you store the raw transaction for each side tree transaction, you shouldn't care if bitcoind prunes those transactions, and you can setup bitcoind to just prune blocks where a rollback is improbable (keeping last 100 blocks on bitcoin is more than enough, which should take around 500 MB on disk).
@csuwildcat Sidetree core only inspect bitcoin transactions for Sidetree hashes from the Sidetree genesis block already. But pruning Bitcoin transaction before Sidetree genesis block is a good idea.
@csuwildcat to propose a solution on the issue, and get this ready for a reference implementation PR.