ambientsprotocol / research-ambients

Ambient Calculus research
Creative Commons Attribution Share Alike 4.0 International
15 stars 0 forks source link

Operations on Ambients #10

Open nud3l opened 5 years ago

nud3l commented 5 years ago

Background

I was trying to play around with the Ambients proposal to create something like a "mini" Bitcoin on Ambients where one could spend previously unspent outputs to create a new transaction.

Question

Is it possible with Ambients to create new data from existing data logs? So for example, if I have a transaction 'tx_0' with one unspent output. I want to then create a new transaction 'tx_1' that uses the output of 'tx_0' as its input and creates a new unspent output. The following things are not clear to me:

haadcode commented 5 years ago

Great question @nud3l!

Perhaps there's more to the question than I understand, but in simplified terms _"a new transaction 'tx_1' that uses the output of 'tx0'" would be written as (pseudo JS code):

const tx_0 = Tx.create() // "genesis"
const tx_1 = Tx.create(tx_0)

Does that make sense?

any node in the network would need to be aware of 'tx_0' and 'tx_1' to see if it's spent. Is that assumption correct?

Correct. Knowing tx_1 implies knowing tx_0 (as tx_1 references tx_0 in the execution log).

would the reduction of 'tx_0' and 'tx_1' only be valid if the signature is deemed valid?

Correct. Reduction of tx_0 and tx_1 is only valid if signatures for both are valid.

Hope this answers (some of) your questions!