Skip to content

Commit

Permalink
Merge pull request #188 from 0xPolygonMiden/dominik_change_example_to…
Browse files Browse the repository at this point in the history
…_remove_secret_input_from_output

removing the secrect input from the output
  • Loading branch information
Dominik1999 authored May 31, 2024
2 parents 0faa8f6 + 40fed4e commit f40be12
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions examples/provable_compliance.masm
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,26 @@
# sanctioned addresses. The target account ID is provided as a secret input. That means,
# if the transaction proceeds, we can prove that the target account ID is not within the
# list of sanctioned addresses without revealing the target account ID.

# Here we pretend to execute a transaction. In reality, we would have to replace the
# code with the actual transaction code.
proc.transaction
mem_load.0
push.4.3.2.1
end

begin
# Store the target account ID (secret input) at position 0
adv_push.1 mem_store.0
# => [sanctioned_address_1, sanctioned_address_2, ...]


push.1

# Check every sanctioned account ID against the target account ID
repeat.9
# Load the target account ID
mem_load.0
# => [target_account_id, sanctioned_address_1, sanctioned_address_2, ...]


# Check if the first entry is equal to the target account ID
# If the target account ID is within the list of sanctioned addresses,
Expand All @@ -27,4 +32,5 @@ begin
# The program didn't stop, so the target account ID is not within the
# list of sanctioned addresses. Thus, we can proceed with the transaction
exec.transaction
# => [1, 2, 3, 4, ...]
end

0 comments on commit f40be12

Please sign in to comment.