LearnBitcoin

Bitcoin Dev Archive 2014

Getting trusted metrics from the block chain in an untrusted environment ?

5 messages, 8 to 9 Jan 2014. Started by Clément Elbaz.

Clément Elbaz (4), Rob Golding

Permalink Original thread on gnusha.org

Clément Elbaz permalink original

Hello all,

I'm designing a program that needs some metrics computed from the Bitcoin block chain (some address balances, or the occurrence or not of a specific transaction). The kind of infos you get from http://blockchain.info/, provided you trust this website (my program do not).

My program should run on lightweight/embedded hardware. The execution environment provides access to the Bitcoin network but not enough resources to set up a trusted node along with my program. Also, my program trusts the global Bitcoin network but no individual node.

I would need a way to ask an untrusted Bitcoin node to compute some 'metric request' on my behalf and having the result of that metric request validated by the network.

Is there any available or work-in-progress projects that would come close to this need ? Or should I do it myself ? :-)

Thank you all,

Clément Elbaz

Clément Elbaz in reply to Clément Elbaz permalink original

Some more thoughts :

If no such project exist yet, I thought it could work with an alternate, small and fixed-length 'metric request block chain' of some sort.

It would temporarily stores structures defined as [metric request | current block number when request was made | hash of the response] instead of financial transactions.

These structures are verifiable so it could work the same way as a regular financial blochchain.

It should not be part of the main Bitcoin protocol but could be a plugin interacting with the data managed by the fullnode bitcoin software.

Also, metrics requests can be expensive to compute and validate, so it would make sense to pay a fee everytime you ask one.

Does any of this makes any sense to you ?

Thanks,

Clément

Clément Elbaz in reply to Clément Elbaz permalink original

Hello all,

It seems there was a problem with my first email (thank you Mark for the heads up), so I'll copy paste it there :

----------------------- Hello all,

I'm designing a program that needs some metrics computed from the Bitcoin block chain (some address balances, or the occurrence or not of a specific transaction). The kind of infos you get from http://blockchain.info/, provided you trust this website (my program do not).

My program should run on lightweight/embedded hardware. The execution environment provides access to the Bitcoin network but not enough resources to set up a trusted node along with my program. Also, my program trusts the global Bitcoin network but no individual node.

I would need a way to ask an untrusted Bitcoin node to compute some 'metric request' on my behalf and having the result of that metric request validated by the network.

Is there any available or work-in-progress projects that would come close to this need ? Or should I do it myself ? :-)

Thank you all,

Clément Elbaz

-----------------------

On Wed, Jan 8, 2014 at 8:44 PM, Clément Elbaz <clem.ds@gmail•com> wrote:

Quoted text (24 lines)
> Some more thoughts :
>
> If no such project exist yet, I thought it could work with an alternate,
> small and fixed-length 'metric request block chain' of some sort.
>
> It would temporarily stores structures defined as [metric request |
> current block number when request was made | hash of the response] instead
> of financial transactions.
>
> These structures are verifiable so it could work the same way as a regular
> financial blochchain.
>
> It should not be part of the main Bitcoin protocol but could be a plugin
> interacting with the data managed by the fullnode bitcoin software.
>
> Also, metrics requests can be expensive to compute and validate, so it
> would make sense to pay a fee everytime you ask one.
>
> Does any of this makes any sense to you ?
>
> Thanks,
>
> Clément
>
Rob Golding in reply to Clément Elbaz permalink original
Quoted text (3 lines)
> My program should run on lightweight/embedded hardware. The execution
> environment provides access to the Bitcoin network but not enough
> resources to set up a trusted node along with my program.

So you want to 'benefit' from the network without contributing to it ?

Quoted text (3 lines)
> I would need a way to ask an untrusted Bitcoin node to compute some
> 'metric request' on my behalf and having the result of that metric
> request validated by the network.

Not going to happen - why would anyone be interested in providing you 'free compute resources' ?

Quoted text (2 lines)
> Is there any available or work-in-progress projects that would come
> close to this need ? Or should I do it myself ? :-)

Setup a node, create an API interface and have your 'app' use your API on yoru node :p

Rob

Clément Elbaz in reply to Clément Elbaz permalink original

Hi Rob,

Thank you for answering.

Quoted text (2 lines)
> So you want to 'benefit' from the network without contributing to it ?

> Not going to happen - why would anyone be interested in providing you

'free compute resources' ?

Not free. As I stated in my second email ("some more thoughts" etc.), it seems really fitting to pay a fee to the network for every metric request you send. 'I want to execute this request on your blockchain, and I want the response to be approved by the Bitcoin network, and here is a fee for all the computing trouble".

You either have the blockchain and the hardware resources to compute things based on it, or you have addresses that takes a few bytes of data in your environement but contains money, potentially a lot. The situation seems plausible to me.

The thing is, as soon as there is an exchange of value (hardware computing resources vs bitcoins) between parties that do not trust each other, there is a need for proof of work, and thus my idea (in my second email) of a specifc block chain that would store metric requests, current block number when they were asked, and hash of theirs responses. This can be validated by others nodes and as such can be published in a ledger just like bitcoin transaction.

Quoted text (1 line)
> Setup a node, create an API interface and have your 'app' use your API on

yoru node :p

The idea would have been actually to be able to get these computations in a trusted way without having access to a specific trusted node. Compensating absence of trust by providing actual money.

Anyways. I got quite a few answer privately, and after study it seems SPV mode of bitcoinj will be just fine for my specific needs. I would have liked the solution to be network-centric ideally (By committing to an SPV-ready API like bitcoinj, I'm committing to languages that provide a stable SPV API), but I'll be just fine with bitcoinj for now.

Thank you Rob and everyone for your time.

Clément

On Wed, Jan 8, 2014 at 8:44 PM, Clément Elbaz <clem.ds@gmail•com> wrote:

Quoted text (24 lines)
> Some more thoughts :
>
> If no such project exist yet, I thought it could work with an alternate,
> small and fixed-length 'metric request block chain' of some sort.
>
> It would temporarily stores structures defined as [metric request |
> current block number when request was made | hash of the response] instead
> of financial transactions.
>
> These structures are verifiable so it could work the same way as a regular
> financial blochchain.
>
> It should not be part of the main Bitcoin protocol but could be a plugin
> interacting with the data managed by the fullnode bitcoin software.
>
> Also, metrics requests can be expensive to compute and validate, so it
> would make sense to pay a fee everytime you ask one.
>
> Does any of this makes any sense to you ?
>
> Thanks,
>
> Clément
>