Skip to content

Add ability to blind only value in the PSET output #301

Open

Description

@KyrylR

As the title says, it would be nice to allow the conditional blinding of an output where only the value should be blinded

This would help with writing protocols with Simplicity contracts that care only about the asset but are fine with the value being confidential

I would like to understand whether it is Ok to add an opt-in API for explicit, value-only, and asset-and-value outputs. It should preserve the behavior of existing blinding methods and reuse the existing balancing and proof machinery

Based on the validation in elements:
https://github.com/ElementsProject/elements/blob/ca172806f66f03712b1050f7ee0020fd588a30bb/src/confidential_validation.cpp#L361-L377
the asset and amount fields are treated independently:

Asset Amount Required output proofs
Explicit Explicit Neither
Explicit Confidential Rangeproof
Confidential Explicit Surjection proof
Confidential Confidential Both

So such transactions are Ok from consensus perspective as far as I can see

Activity

  1. apoelstra commented on Oct 14, 2026

    @apoelstra
    Member

    Yep, concept ACK, though I'm not exactly sure what the API should look like. But we did deliberately design the consensus protocol and PSET so that this should be possible.

  2. KyrylR commented on Oct 20, 2026

    @KyrylR
    ContributorAuthor

    Opened #302 for the discussion of API

    The implementation there is just to prove that the concept works, I would rewrite it after we align on API itslef

  3. KyrylR commented on Oct 20, 2026

    @KyrylR
    ContributorAuthor

    4. Opened #302 for the discussion of API
    The implementation there is just to prove that the concept works, I would rewrite it after we align on API itslef

        pub fn blind_last_with_modes<C: secp256k1_zkp::Signing, R: RngCore + CryptoRng>(
            &mut self,
            rng: &mut R,
            secp: &secp256k1_zkp::Secp256k1<C>,
            inp_txout_sec: &HashMap<usize, TxOutSecrets>,
            modes: &BTreeMap<usize, BlindingMode>,
        ) -> Result<BTreeMap<CtLocation, (AssetBlindingFactor, ValueBlindingFactor, SecretKey)>, BlindingModeError> { ... }
    #[allow(missing_docs)]
    #[derive(Debug, Clone, Copy, PartialEq, Eq)]
    pub enum BlindingMode {
        ValueOnly,
        AssetAndValue,
    }

    Above are core API choices

    Overall user could provide an empty set and the blinding will happen for both value and asset

    If user wants to value only blind, the user would need to explicitly specify so

    I was not able to avoid re-implementing the blinding (reusing blind last, or something like that)

    Will wait for your feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions