Coder Social home page Coder Social logo

Comments (5)

vogel avatar vogel commented on July 20, 2024

Do you mean DataEntry values from Stellar-ledger-entries.x (added with ManageData?). These are held by LedgerEntry structure that contains lastModifiedLedgerSeq number, and this looks like the "field revision id" you need.

Not sure if horizon exposes that field.

from stellar-protocol.

MikeFair avatar MikeFair commented on July 20, 2024

Yes that's the Manged Data I'm talking about. :)

For data sync purposes, that one works great.

For encryption purposes (the use case I'm coding for first), the writer can't predict what that value is going to be before it actually happens (so can't use it as part of the encryption key). Readers can't really hunt for the right sequence number "near that one" because they don't know what the values are supposed to be; so I'm not sure how'd they test to see if they got it right (with a data hash, they could check the value to ensure it decrypted properly).

And no, Horizon doesn't currently expose it; and while I didn't personally look, my understanding is it also isn't in the postgresql database schema at the moment either.

from stellar-protocol.

jedmccaleb avatar jedmccaleb commented on July 20, 2024

Isn't the one in the ledger always the most current?

from stellar-protocol.

MikeFair avatar MikeFair commented on July 20, 2024

No, not if the value on the ledger is a publication of a value sync'd through third party systems.

Picture two federated environments that are sync'ing a value for the same userid.
EnvA and EnvB (say two different data centers) both have the ability to update or be updated by the data on AcctC.

Neither needs "exclusive control" over the value, but they want to ensure their internal systems either reflect the most recent value, or push the updated value to the ledger.

It's easy to detect that the value EnvA locally has is different than the value on AcctC, but it can't immediately tell which "direction" the update should go. This third 'revision id' value can rectify that.

LedgerSequenceNumber is almost enough, but it's not predictable in advance.
The reason that matters is that the "writer" needs to be able to communicate/store what it wrote.


Without thinking about encrypted data values, ledger sequence number might be enough. There's probably a way for a third party database writer/sync algo to figure out the sequence id of its update.

For encrypted values though, this third field could also serve as a "salt" or "initialization vector" for an encryption key to ensure that the same encryption key is never used more than once.

You'd take the "base secret key", modify it by this third field, and that new derivative key would be the decryption key for the field's value. You could require that an encrypted value must use part of its data to store this secret transform, but I believe a third writable field would be "better"...

from stellar-protocol.

theaeolianmachine avatar theaeolianmachine commented on July 20, 2024

Hey @MikeFair — if you have any interest in pushing this forward, writing a CAP draft, or moving conversation to our mailing list (link in the main README) to get some feedback will push things along further.

from stellar-protocol.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.