Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
220 commits
Select commit Hold shift + click to select a range
d6e153d
connector, remove rainbowkit details field
zeluisping Jun 8, 2025
51c9efe
update usage of giano connector create fn
zeluisping Jun 8, 2025
5644403
provider revamp
zeluisping Jun 8, 2025
2cffcbc
dependencies fixes
zeluisping Jun 8, 2025
6f57d09
create example provider injection (local storage)
zeluisping Jun 8, 2025
a2dbb0c
update wagmi configs and setup
zeluisping Jun 8, 2025
b7cd161
remove rainbowkit provider
zeluisping Jun 8, 2025
f79ca8e
update example with custom button example
zeluisping Jun 8, 2025
eee737f
ABI-241 - fix SDR package versions in pnpm-lock file
timfbfbfbfb Jun 12, 2025
f8e9753
ABI-241 - pass credentialKeyMapperAddress and gianoSmartWalletFactory…
timfbfbfbfb Jun 12, 2025
dfffc28
ABI-241 - remove debug console log
timfbfbfbfb Jun 12, 2025
6bc12d7
Normal webauth protocol to be supported
diogopalhais Jun 13, 2025
0a58b1e
Signing of the global/blob data
diogopalhais Jun 13, 2025
49161ac
ABI-244 - Add wallet factory and chain ID descriptor
timfbfbfbfb Jun 13, 2025
8a2b032
ABI-244 - add encode / decode User ID function in injection object
timfbfbfbfb Jun 13, 2025
1b96456
ABI-241 - extract contract addresses to env config
timfbfbfbfb Jun 13, 2025
0d6b38b
fix SSR errors
timfbfbfbfb Jun 18, 2025
247d6e0
persist provider connection
timfbfbfbfb Jun 19, 2025
cb18e2c
Fixes build and getting started issues
jophj Jun 20, 2025
8d36ad7
Remove debug logging from personal_sign and eth_sign methods
jophj Jun 20, 2025
6990799
Merge pull request #28 from appliedblockchain/portafino-injected-flow…
Jun 20, 2025
59c6c6f
Merge pull request #30 from appliedblockchain/ABI-241-extract_hardcod…
Jun 20, 2025
72fc22b
Normal webauth protocol to be supported
diogopalhais Jun 13, 2025
0b3e7dc
Signing of the global/blob data
diogopalhais Jun 13, 2025
672a215
Fixes build and getting started issues
jophj Jun 20, 2025
90684b4
Remove debug logging from personal_sign and eth_sign methods
jophj Jun 20, 2025
53a6c75
ABI-241 - fix SDR package versions in pnpm-lock file
timfbfbfbfb Jun 12, 2025
587c0a0
ABI-241 - pass credentialKeyMapperAddress and gianoSmartWalletFactory…
timfbfbfbfb Jun 12, 2025
bfa226f
ABI-241 - remove debug console log
timfbfbfbfb Jun 12, 2025
4693ff4
ABI-241 - extract contract addresses to env config
timfbfbfbfb Jun 13, 2025
6efdb14
ABI-244 - Add wallet factory and chain ID descriptor
timfbfbfbfb Jun 13, 2025
56983e9
ABI-244 - add encode / decode User ID function in injection object
timfbfbfbfb Jun 13, 2025
5c33b4c
Fixing merge conflict
jophj Jun 20, 2025
b19c0c4
fix merge conflicts
timfbfbfbfb Jun 20, 2025
f9111b2
Merge pull request #29 from appliedblockchain/ABI-244-wallet_factory_…
Jun 20, 2025
6ea8ab8
Merge remote-tracking branch 'origin/portafino-minimum-req' into pres…
timfbfbfbfb Jun 20, 2025
cb7c15d
Merge pull request #32 from appliedblockchain/presist_provider_connec…
Jun 20, 2025
9f76f72
add support to build tx, sign, and send in separete steps
diogopalhais Jun 17, 2025
a5ad3eb
Merge pull request #31 from appliedblockchain/portafino-tx-steps
Jun 20, 2025
cf6ce2b
fix read balance error in custom-example
timfbfbfbfb Jun 23, 2025
9d1b740
avoid calling getWebAuthnAccount in eth_call and eth_sendTransaction
timfbfbfbfb Jun 23, 2025
ec9cf16
remove keymapper and add to injector
diogopalhais Jun 23, 2025
2fd1b62
merge getCredentialId and getChallenge to getCredentialInfo
timfbfbfbfb Jun 24, 2025
17869d1
fe example with injector methods
diogopalhais Jun 25, 2025
d5a6c7b
Merge pull request #34 from appliedblockchain/fix_read_balance_error
Jun 25, 2025
50a808e
Merge pull request #36 from appliedblockchain/provider_refactoring
Jun 25, 2025
3d3a0ad
Merge pull request #35 from appliedblockchain/portafino-key-mapper-re…
Jun 25, 2025
2f3e920
Linting auto fixes
jophj Jun 26, 2025
e40f899
removed signature requirement for eth_call
jophj Jun 26, 2025
2977ce4
Fixed the balanceOf eth_call
jophj Jun 26, 2025
06b2dbb
misc: add connector build step to readme
zeluisping Jun 26, 2025
7295855
add hook for provider for user op submission on backend
timfbfbfbfb Jun 25, 2025
040de94
Merge pull request #37 from appliedblockchain/backend_validation_user…
Jun 27, 2025
92a009a
Using the coinbase bundler
jophj Jun 27, 2025
a0a3502
use the rawId on the credential id
diogopalhais Jun 27, 2025
966176e
fix: frontend-example use config for rpc url
zeluisping Jun 30, 2025
3bd3f04
chore: use test coinbase rpc url
zeluisping Jun 30, 2025
a5dda6d
fix: improve estimations and get it working with the paymaster
zeluisping Jun 30, 2025
e5b63d3
decouple local storage
timfbfbfbfb Jun 30, 2025
36fa8a2
Changed account-abstraction submodule to v0.7
zeluisping Jul 1, 2025
ee0d1e3
fix: base-sepolia deploy not using create2
zeluisping Jul 1, 2025
6e411dc
Merge pull request #41 from appliedblockchain/portafino-raw-credential
Jul 1, 2025
b6ecaae
Downgrade account-abstraction submodule from v0.8 to v0.7
zeluisping Jul 1, 2025
665724c
simplify eth_sendTransaction
zeluisping Jul 1, 2025
d1bcbd3
fix: downgrade account abstraction dependency to 0.7
gabspeck Jul 1, 2025
1296eb6
fix: update forge tests to expect entrypoint 0.7
gabspeck Jul 1, 2025
9afd844
Merge pull request #43 from appliedblockchain/downgrade-aa-dependency…
zeluisping Jul 1, 2025
20710c5
cleanup
timfbfbfbfb Jul 1, 2025
fc219cd
deprecate onUserOperationSigned
zeluisping Jul 1, 2025
d4537e5
added base sepolia hardhat config + updated env example
zeluisping Jul 1, 2025
9e49336
clean up and create demo page for server storage
timfbfbfbfb Jul 1, 2025
5beab0e
deploy only wallet contracts cmd
diogopalhais Jul 1, 2025
c6fc6d2
Merge pull request #42 from appliedblockchain/feat/change-account-abs…
Jul 2, 2025
5b16478
Configuration improvements and transaction submission feedback
jophj Jul 2, 2025
816cbdd
Merge remote-tracking branch 'origin/portafino-minimum-req' into deco…
timfbfbfbfb Jul 2, 2025
d269d51
Merge remote-tracking branch 'origin/portafino-minimum-req' into deco…
timfbfbfbfb Jul 2, 2025
343858e
move storage implementations to custom-example
timfbfbfbfb Jul 2, 2025
a4fee9e
fix storage clear function
timfbfbfbfb Jul 2, 2025
f99b5e7
fix merge conflicts
timfbfbfbfb Jul 2, 2025
e407546
Configuration improvements for using Coinbase bundler and other configs
jophj Jul 2, 2025
3409265
Update the README info
jophj Jul 2, 2025
0477f6b
Merge pull request #44 from appliedblockchain/portafino-deploy-cmd
Jul 2, 2025
bb5f756
use the rawId on the credential id
diogopalhais Jun 27, 2025
2445265
deploy only wallet contracts cmd
diogopalhais Jul 1, 2025
c608522
Misc fixes
jophj Jul 2, 2025
da1ecc2
Merge branch 'portafino-minimum-req' into coinbase_bundler
Jul 2, 2025
a891793
Merge pull request #40 from appliedblockchain/coinbase_bundler
Jul 2, 2025
8b59c05
seperate clear session button and delete passkey button
timfbfbfbfb Jul 2, 2025
edabc59
Merge remote-tracking branch 'origin/portafino-minimum-req' into deco…
timfbfbfbfb Jul 2, 2025
251f821
Merge pull request #40 from appliedblockchain/coinbase_bundler
Jul 2, 2025
4ee457c
Merge pull request #38 from appliedblockchain/misc/readme-add-connect…
Jul 3, 2025
ee7f676
Using the correct salt for the create2 strategy
jophj Jul 3, 2025
df778a5
feat: default to CREATE2 addresses when not specified
gabspeck Jul 3, 2025
059b975
Fixes a required env var error
jophj Jul 3, 2025
e0eee69
Merge remote-tracking branch 'origin/portafino-minimum-req' into deco…
timfbfbfbfb Jul 3, 2025
8afbfa8
fix merge conflicts
timfbfbfbfb Jul 3, 2025
6f390f7
Lint fixes
jophj Jul 3, 2025
4023333
Removed localStorage usage from the Giano provider
jophj Jul 3, 2025
609536a
Updated viem and wagmi to the latest version
jophj Jul 3, 2025
6275fb9
fix: changes to make giano work both locally and on testnet
gabspeck Jul 3, 2025
1f114b8
Merge remote-tracking branch 'origin/portafino-minimum-req' into fix-…
gabspeck Jul 3, 2025
bb92d13
Merge pull request #47 from appliedblockchain/fix-local-env
Jul 3, 2025
e0205c3
Merge remote-tracking branch 'origin/portafino-minimum-req' into deco…
timfbfbfbfb Jul 3, 2025
ef08346
remove all storage logic from provider
timfbfbfbfb Jul 4, 2025
1f54e8a
update server storage demo
timfbfbfbfb Jul 4, 2025
bc86666
clean up leftover arguments
timfbfbfbfb Jul 7, 2025
17d30c4
add injection docs / readme
timfbfbfbfb Jul 7, 2025
efe54f4
fix: do not wait for receipt on eth_sendTransaction
zeluisping Jul 7, 2025
2713f2d
chore: remove unused helper submitUserOperation
zeluisping Jul 7, 2025
bd52ed4
chore: remove deprecated onUserOperationSigned
zeluisping Jul 7, 2025
eeb74db
chore: add access to bundler instance
zeluisping Jul 7, 2025
0bd443b
feat: wait for transaction receipt example
zeluisping Jul 7, 2025
05a6364
chore: fully type eth_sendTransaction
zeluisping Jul 7, 2025
b7f4960
TODO comment: configMap creates unnecessary instances
zeluisping Jul 7, 2025
576e523
fix: use proper hex validation in local storage injection
zeluisping Jul 7, 2025
7d3110b
chore: add a brief description for local storage injection example
zeluisping Jul 7, 2025
a9a3dfb
Merge pull request #46 from appliedblockchain/decouple_local_storage
Jul 8, 2025
0265d6a
feat: provider added waitForUserOperationReceipt request
zeluisping Jul 8, 2025
e055fc3
feat: wagmi connector add waitForUserOperationReceipt
zeluisping Jul 8, 2025
569611b
feat: use connector to wait for user op receipt
zeluisping Jul 8, 2025
933dd5b
generate challenge on backend for server side storage demo
timfbfbfbfb Jul 8, 2025
0bdf305
Merge pull request #49 from appliedblockchain/decouple_local_storage
Jul 9, 2025
b4c3bbf
fix user operation backend submission
timfbfbfbfb Jul 9, 2025
54e90e2
improve server storage example page and bug fix
timfbfbfbfb Jul 9, 2025
8777c8d
Merge remote-tracking branch 'origin/eth-send-transaction-eip-1474-co…
timfbfbfbfb Jul 10, 2025
7d09943
created giano entry point definition file
zeluisping Jul 10, 2025
3405a6a
fix: non-injected user op submission must return hash
zeluisping Jul 10, 2025
b48b247
fix: added proper typings to submitUserOperation injection
zeluisping Jul 10, 2025
8c4e343
chore: remove unnecessary spread
zeluisping Jul 10, 2025
563f597
invert condition, reduce indentation
zeluisping Jul 10, 2025
07a6809
added missing typings for injection hook submitUserOperation
zeluisping Jul 10, 2025
0df6581
return transaction hash instead of receipt in the submit user op endp…
timfbfbfbfb Jul 11, 2025
7528950
wait for smart account deployment
timfbfbfbfb Jul 11, 2025
0e49910
feat: add waiting for user operation to server storage demo
zeluisping Jul 14, 2025
53bc314
chore: improve giano injection readme
zeluisping Jul 14, 2025
41276f5
api: rename to be more explicit hash -> userOperationHash
zeluisping Jul 14, 2025
86dad4c
replace ownerIndex with ownerBytes to simplify signing process
timfbfbfbfb Jul 10, 2025
55fa704
update append-address-env-vars.js script
timfbfbfbfb Jul 10, 2025
294e801
update next.config.js
timfbfbfbfb Jul 10, 2025
de9533d
chore: fix incorrect comment example
zeluisping Jul 14, 2025
f12fb8d
add multiple owners demo page
timfbfbfbfb Jul 11, 2025
a2443b9
Merge pull request #50 from appliedblockchain/fix-user-op-backend-sub…
Jul 15, 2025
07c1c69
chore: add export for giano entry point
zeluisping Jul 16, 2025
6f2cef6
make use of the second passkey owner
zeluisping Jul 16, 2025
8ed83bd
add base mainnet hardhat config
zeluisping Jul 16, 2025
7a84f13
deployed contracts to base mainnet
zeluisping Jul 16, 2025
b2c1d3f
add base (mainnet) to config map
zeluisping Jul 16, 2025
bf747d7
add env example for base (mainnet)
zeluisping Jul 16, 2025
06e9a2e
add a step in multiple owners demo page to demonstrate the capability…
timfbfbfbfb Jul 16, 2025
19cd638
minor UI improvements
timfbfbfbfb Jul 16, 2025
1683a65
Merge remote-tracking branch 'origin/portafino-minimum-req' into mult…
timfbfbfbfb Jul 16, 2025
f3a8f23
Merge pull request #52 from appliedblockchain/add-config-for-base-mai…
Jul 18, 2025
346f46e
update contract addresses in .env-local
timfbfbfbfb Jul 18, 2025
1d39228
Merge remote-tracking branch 'origin/portafino-minimum-req' into mult…
timfbfbfbfb Jul 18, 2025
0e3fd49
update notes in step 4 in multiple owners demo page
timfbfbfbfb Jul 18, 2025
8d6551d
move injection type + async encodeUserId
zeluisping Jul 21, 2025
3128369
create hex assertions
zeluisping Jul 21, 2025
92a0722
implement provider injection types and assertions
zeluisping Jul 21, 2025
a616ca3
feat: create injection validation wrapper
zeluisping Jul 21, 2025
d507d76
fix address type wanted
zeluisping Jul 21, 2025
e1c8687
replace crypto.randomUUID with uuid package to ensure the UUID genera…
timfbfbfbfb Jul 18, 2025
b21a371
simple android passkey test page
timfbfbfbfb Jul 18, 2025
4c50969
add hardhat and bundler proxy api for demo pages for mobile testing
timfbfbfbfb Jul 21, 2025
4570d9a
add readme file for android testing
timfbfbfbfb Jul 21, 2025
212f34f
Provider implementation with new smart account features and event han…
Jul 21, 2025
4488b47
rename test file
zeluisping Jul 22, 2025
36b14e9
update contracts to v1.1.0
zeluisping Jul 22, 2025
bf41504
update test contracts to v1.1.0
zeluisping Jul 22, 2025
27f9dd5
add foundry deployment optimisations
zeluisping Jul 22, 2025
c9b9257
update local env addresses
zeluisping Jul 22, 2025
9da81f6
remove obsolete credential key mapper env
zeluisping Jul 22, 2025
705bb67
sort local env to match the others
zeluisping Jul 22, 2025
a190c3b
Merge remote-tracking branch 'origin/android_compatibility' into feat…
Jul 22, 2025
4efc069
update android-passkey-test page to test different webauthn config
timfbfbfbfb Jul 23, 2025
0b8bec8
update android testing readme file
timfbfbfbfb Jul 23, 2025
554cee0
fix: bad undefined check
zeluisping Jul 23, 2025
141786c
chore: cleaner read on undefined checks
zeluisping Jul 23, 2025
3754ea6
Merge pull request #51 from appliedblockchain/multiple_owners
Jul 23, 2025
7c44bc9
Merge branch 'portafino-minimum-req' of github.com:appliedblockchain/…
jophj Jul 23, 2025
137acbf
add signed_eth_call and demo call
diogopalhais Jul 23, 2025
02413d7
Enhance GianoProvider by adding getSmartAccount method and local smar…
Jul 23, 2025
8146673
Merge branch 'portafino-minimum-req' of github.com:appliedblockchain/…
jophj Jul 23, 2025
a9ff2ac
Merge branch 'portafino-minimum-req' of github.com:appliedblockchain/…
jophj Jul 23, 2025
99c6f65
Merge pull request #56 from appliedblockchain/android_compatibility
Jul 23, 2025
e25cc9c
Merge branch 'portafino-minimum-req' of github.com:appliedblockchain/…
jophj Jul 23, 2025
0703247
Merge pull request #54 from appliedblockchain/feat/injection-validation
Jul 23, 2025
34a414f
Merge branch 'portafino-minimum-req' into feature/ABI-279/giano-provider
Jul 23, 2025
5cd8b32
Enhance README with WebAuthn configuration details, including user ve…
Jul 23, 2025
0d3e45a
Merge pull request #55 from appliedblockchain/feature/ABI-279/giano-p…
Jul 24, 2025
8157e3c
Merge branch 'portafino-minimum-req' of github.com:appliedblockchain/…
jophj Jul 24, 2025
cdb6274
Merge pull request #57 from appliedblockchain/port-coinbase-wallet-v1…
Jul 24, 2025
71374e0
Merge pull request #58 from appliedblockchain/signed-eth-call-method
Jul 24, 2025
80eb651
fix: added missing ensureAccountDeployed (prob. merge artifact)
zeluisping Jul 24, 2025
f61edef
Merge pull request #59 from appliedblockchain/fix-missing-ensure-acco…
stvkoch Jul 24, 2025
3d028f1
feat: add web and node exports to Giano connector, enhance README wit…
Jul 24, 2025
f75715d
Refactor: Demo UI and prepare page to dinamic create injection
Jul 24, 2025
044938c
feat: add credential list mode toggle and enhance provider injection …
Jul 24, 2025
d085382
refactor: streamline Giano provider injection and enhance credential …
Jul 25, 2025
d2ed5d9
update android testing readme file for latest testing results
timfbfbfbfb Jul 25, 2025
74bff76
update Android Firefox behavior in README
timfbfbfbfb Jul 25, 2025
7358eb6
refine CredentialInfo and add credential fields configs
zeluisping Jul 28, 2025
f6846c5
extract getCredential logic
zeluisping Jul 28, 2025
91ecf8b
extract and expand getWebAuthnAccount
zeluisping Jul 28, 2025
68f8668
update injection type & hook jsdocs
zeluisping Jul 28, 2025
0c210ce
use new getWebAuthnAccount implementation
zeluisping Jul 28, 2025
c887119
update credential creation & fix double getCredentialInfo call
zeluisping Jul 28, 2025
b32fd63
remove old mediation and userVerification handling
zeluisping Jul 28, 2025
9f79f31
add button in android-passkey-test to demonstrate that Firefox Androi…
timfbfbfbfb Jul 28, 2025
d6e3ce5
add working example for Firefox Android + Google password manager
timfbfbfbfb Jul 29, 2025
d65b7fc
Merge pull request #60 from appliedblockchain/feature/ABI-280/segraga…
Jul 31, 2025
d85ec25
Merge pull request #62 from appliedblockchain/expand-credential-creat…
Jul 31, 2025
7cec74e
Merge pull request #63 from appliedblockchain/android_compatibility
Jul 31, 2025
4e9e2dd
Merge pull request #61 from appliedblockchain/feature/ABI-285/showlis…
stvkoch Aug 3, 2025
0e6f3a8
Add EIP-712 message approval functionality to PrivateERC20 contract a…
Aug 12, 2025
d06a278
Related origin requests (ROR) demo page (#65)
timfbfbfbfb Aug 26, 2025
6002432
Add deployment files for GianoAccountFactory and GianoSmartWallet (#70)
stvkoch Aug 26, 2025
de32173
Replaced html element by material ui (#66)
stvkoch Aug 26, 2025
90ccd3c
Merge branch 'portafino-minimum-req' into feature/ABI-294/demo-verify…
Aug 26, 2025
e9c7a1a
Merge pull request #67 from appliedblockchain/feature/ABI-294/demo-ve…
stvkoch Aug 26, 2025
68adecb
Remove CredentialKeyMapper contract and related references from the c…
stvkoch Aug 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,094 changes: 1,094 additions & 0 deletions README-GIANO-INJECTION.md

Large diffs are not rendered by default.

253 changes: 253 additions & 0 deletions README-ROR.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,253 @@
# Related Origin Requests (ROR) Demo

A comprehensive demonstration of WebAuthn's Related Origin Requests feature, allowing passkeys to be shared across multiple domains owned by the same entity.

## 🌐 What is Related Origin Requests?

Related Origin Requests (ROR) is a WebAuthn feature that allows passkeys to be reused across multiple domains that belong to the same organization. Normally, passkeys are tied to a specific Relying Party ID (RP ID) and can only be used on the exact domain where they were created.

### Problems ROR Solves

- **Multi-domain sites**: Users can't use the same passkey across `example.com` and `example.co.uk`
- **Branded domains**: Can't share passkeys between `acme.com` and `acmerewards.com`
- **Mobile apps**: Apps often don't have their own domain, making credential management challenging

### How ROR Works

1. **Configuration**: The "parent" domain serves a special JSON file at `https://{RP_ID}/.well-known/webauthn`
2. **Cross-origin requests**: When a site uses a different RP ID than its origin, the browser checks the `.well-known` file
3. **Validation**: If the requesting origin is listed in the allowed origins, authentication proceeds
4. **Seamless experience**: Users can authenticate with the same passkey across all configured domains

## 🔄 ROR Flow Diagram

The following diagram illustrates the complete Related Origin Requests flow using our demo setup with two different domains (ngrok and localtunnel):

```mermaid
sequenceDiagram
participant UserAgent as 🌐 Browser
participant DomainA as 📍 Domain A<br/>(xyz.loca.lt)<br/>RP ID Owner
participant DomainB as 📍 Domain B<br/>(abc123.ngrok.io)<br/>Cross-Origin Tester
participant WellKnown as 📄 .well-known/webauthn<br/>Configuration

Note over UserAgent,WellKnown: 🔧 Phase 1: Setup Configuration

UserAgent->>DomainA: 1. Visit Domain A (localtunnel)
DomainA->>UserAgent: Serve ROR Demo Page
UserAgent->>DomainA: 2. Add Domain B (ngrok) to allowed origins
DomainA->>WellKnown: Update .well-known/webauthn<br/>{"origins": ["https://abc123.ngrok.io"]}

Note over UserAgent,WellKnown: 🔑 Phase 2: Cross-Origin Passkey Creation

UserAgent->>DomainB: 3. Visit Domain B (ngrok)
DomainB->>UserAgent: Serve ROR Demo Page
UserAgent->>UserAgent: 4. Configure:<br/>• RP ID = "xyz.loca.lt"<br/>• Passkey Name = "test-ror-demo"
UserAgent->>DomainA: 5. Check .well-known/webauthn
DomainA->>UserAgent: Return allowed origins list
UserAgent->>UserAgent: 6. Verify Domain B is allowed
UserAgent->>UserAgent: 7. navigator.credentials.create({<br/> rp: { id: "xyz.loca.lt" }<br/>})
UserAgent->>UserAgent: 8. Create passkey locally<br/>✅ Passkey belongs to Domain A (localtunnel)<br/>✅ Created while on Domain B (ngrok)

Note over UserAgent,WellKnown: 🔐 Phase 3: Cross-Origin Authentication

UserAgent->>UserAgent: 9. Test authentication<br/>RP ID = "xyz.loca.lt"
UserAgent->>DomainA: 10. Verify .well-known allows Domain B
DomainA->>UserAgent: ✅ Domain B is in origins list
UserAgent->>UserAgent: 11. navigator.credentials.get({<br/> rpId: "xyz.loca.lt"<br/>})
UserAgent->>UserAgent: 12. Find matching passkey<br/>✅ Authenticate successfully
UserAgent->>DomainB: 13. Display success result

Note over UserAgent,WellKnown: 🎉 Result: Cross-Origin Authentication Success!<br/>Passkey for Domain A (localtunnel) works on Domain B (ngrok)
```

### Key Flow Points

1. **Configuration Setup**: Domain A (localtunnel - RP ID owner) adds Domain B (ngrok) to its `.well-known/webauthn` file
2. **Cross-Origin Creation**: User creates a passkey FOR Domain A (localtunnel) WHILE ON Domain B (ngrok)
3. **Browser Validation**: Browser checks Domain A's `.well-known` file and finds Domain B is allowed
4. **Success**: Passkey creation and authentication work seamlessly across domains

> **💡 Why localtunnel as RP ID owner?** We use localtunnel as the RP ID owner because ngrok can have issues serving `.well-known/webauthn` to external domains. Localtunnel doesn't have this limitation, making it more reliable for cross-origin testing.

## 🖥️ Browser Support

According to [web.dev](https://web.dev/articles/webauthn-related-origin-requests#browser_support):

| Browser | Support Status |
|---------|----------------|
| **Chrome** | ✅ Supported from Chrome 128+ |
| **Safari** | ✅ Supported from macOS 15 beta 3, iOS 18 beta 3+ |
| **Firefox** | ❌ Not supported (awaiting position) |

### ⚠️ Important Limitations

- **Firefox users**: Will receive `SecurityError` when attempting ROR
- **Detection**: [`PublicKeyCredential.getClientCapabilities()`](https://developer.mozilla.org/en-US/docs/Web/API/PublicKeyCredential/getClientCapabilities_static) isn't widely available yet for feature detection
- **Maximum labels**: Chrome supports maximum 5 eTLD+1 labels in the origins list
- **Content-type**: Must serve `.well-known/webauthn` with `application/json` content-type

## 🚀 Demo Features

Our ROR demo provides:

1. **Browser Support Detection** - Automatically detects ROR compatibility
2. **Dynamic .well-known Management** - Add/remove origins via UI
3. **Cross-origin Passkey Creation** - Create passkeys for different RP IDs
4. **Authentication Testing** - Test cross-origin passkey authentication
5. **Real-time Feedback** - See exactly what's happening at each step

## 🛠️ Setup & Testing

### Prerequisites

- **Supported browser**: Chrome 128+ or Safari on macOS 15+/iOS 18+
- **HTTPS**: ROR requires secure origins
- **Two domains**: You need at least two different domains/origins to test

### Running the Demo

1. **Start the development server**:
```bash
cd services/custom-example
npm run dev
```

2. **Set up tunnels for testing**:

**Start HTTPS proxies for 2 different domains**:
```bash
# Terminal 1: ngrok (will be the cross-origin testing domain)
ngrok http 4000

# Terminal 2: localtunnel (will be the RP ID domain)
lt -p 4000
```

3. **Access the demo**:
- Navigate to `/related-origin-requests` on both tunnel URLs
- You now have the same app on two different domains, perfect for testing ROR
- **Setup**: localtunnel domain = RP ID owner, ngrok domain = cross-origin tester

### Step-by-Step Testing Guide

#### Phase 1: Setup Configuration

1. **Allow Cross-Origin Access**:
- Open Domain A - localtunnel (e.g., `https://xyz.loca.lt/related-origin-requests`)
- Go to **Step 2** and click "Add Current Origin"
- This adds the ngrok domain to the allowed list for ROR

#### Phase 2: Cross-Origin Passkey Creation

2. **Create Passkey for localtunnel domain**:
- On Domain B - ngrok (e.g., `https://abc123.ngrok.io/related-origin-requests`)
- Go to **Step 4**
- Set **Passkey Name**: `test-ror-demo`
- Set **RP ID**: Domain A's hostname (e.g., `xyz.loca.lt`)
- Click "Create Cross-Origin Passkey"
- ✅ Success: You've created a passkey FOR localtunnel domain WHILE ON ngrok

#### Phase 3: Authentication Testing

3. **Test Cross-Origin Authentication**:
- Still on Domain B - ngrok
- In **Step 5**, click "Test Cross-Origin Authentication"
- ✅ Success: Passkey works cross-origin thanks to ROR!

4. **Optional: Test on localtunnel domain**:
- Go to Domain A - localtunnel (e.g., `https://xyz.loca.lt/related-origin-requests`)
- In **Step 4**, set **RP ID** to the localtunnel hostname (same as above)
- In **Step 5**, click "Test Cross-Origin Authentication"
- ✅ Success: Same passkey also works on its "home" domain

### Expected Results

When ROR is working correctly:

- ✅ **Cross-origin creation**: Passkey creation succeeds on ngrok with localtunnel RP ID
- ✅ **Cross-origin auth**: Authentication works on ngrok with localtunnel passkey
- ✅ **Home domain auth**: Same passkey also works on localtunnel domain
- ✅ **Browser behavior**: No security errors, smooth authentication flow

**Note**: We use localtunnel as the RP ID owner because ngrok can have issues serving `.well-known/webauthn` to external domains, while localtunnel doesn't have this limitation.

## 🔧 Technical Implementation

### .well-known/webauthn Structure

```json
{
"origins": [
"https://example.co.uk",
"https://example.de",
"https://example-rewards.com"
]
}
```

### API Endpoints

Our demo includes these API endpoints:

- `GET /api/well-known/webauthn` - Retrieve current configuration
- `POST /api/well-known/webauthn` - Add origin to allowed list
- `DELETE /api/well-known/webauthn` - Remove origin from allowed list

### WebAuthn Integration

```javascript
// Create passkey with cross-origin RP ID
const credential = await navigator.credentials.create({
publicKey: {
rp: {
name: 'My App',
id: 'other-domain.com', // Different from current origin
},
// ... other options
},
});

// Authenticate with cross-origin RP ID
const assertion = await navigator.credentials.get({
publicKey: {
challenge: challenge,
rpId: 'other-domain.com', // Same RP ID as creation
// ... other options
},
});
```

## 🐛 Troubleshooting

### Common Issues

1. **SecurityError during creation/authentication**:
- Check browser support (Chrome 128+, Safari macOS 15+/iOS 18+)
- Verify `.well-known/webauthn` file is accessible
- Ensure current origin is listed in the origins array
- Confirm file serves with `application/json` content-type

2. **ngrok .well-known access issues**:
- ngrok may block external domains from accessing `.well-known/webauthn`
- Solution: Visit the ngrok URL in browser first to bypass warning
- Alternative: Test primarily on localtunnel (recommended approach in our guide)

3. **File not found at .well-known URL**:
- Check Next.js rewrites configuration in `next.config.js`
- Verify API route exists at `/api/well-known/webauthn.ts`
- Ensure proper CORS headers are set

4. **Passkey not found during authentication**:
- Verify same RP ID is used for both creation and authentication
- Check that passkey was actually created (not cancelled by user)
- Ensure platform authenticator is available

### Debug Tools

- **Chrome DevTools**: Check Network tab for `.well-known` requests
- **Console logs**: Demo logs all ROR operations to browser console
- **Demo feedback**: Each step shows detailed success/error messages

---

**Note**: This is a demonstration implementation. For production use, implement proper security measures, error handling, and user experience considerations.
39 changes: 37 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,23 @@ pnpm hh:initlocal
```sh
pnpm bundler:dev
```
7. Start the demo app:
8. Build the connector package:
```sh
pnpm build:connector
```
9. Start the demo app:
```sh
pnpm demo:dev
```

# Using the Coinbase bundler on Base Sepolia
To use the Coinbase bundler, you need to copy the .env.base-sepolia file to .env and set the `NEXT_PUBLIC_BUNDLER_RPC_URL` to the Coinbase bundler URL.

There is no need to deploy the smart contracts again, as the addresses are already set in the `.env` file.
There is also no need to run the local bundler, as the Coinbase bundler is already running on the Base Sepolia network.
Moreover, you don't need to run the local blockchain node, as the Coinbase bundler will use the Base Sepolia network.


### Important tips

- Remember to run `build` every time you make changes to the contracts or connector packages, so that changes are picked up by packages that import them
Expand All @@ -57,6 +69,30 @@ pnpm demo:dev

Application available at <http://localhost:3000>.

## Troubleshooting

### Heap Out of Memory Error

If you encounter a "heap out of memory" error when running the build command, this is typically due to Node.js running out of memory during the build process. This can happen when building large projects or when the default memory allocation is insufficient.

**Solution:**

Run the build command with increased memory allocation:

```sh
NODE_OPTIONS='--max-old-space-size=16384' pnpm build
```

This increases the maximum heap size to 16GB. You can adjust the value (in MB) based on your system's available memory:
- `8192` for 8GB
- `16384` for 16GB
- `32768` for 32GB

**Alternative solutions:**
- Close other memory-intensive applications before building
- Clear Node.js cache: `pnpm store prune`
- Restart your development environment

### Test contracts

#### Coinbase tests (Foundry-based)
Expand All @@ -73,7 +109,6 @@ pnpm hh:test

- `GianoSmartWallet`: the smart wallet itself, which validates the signatures and executes the calls.
- `GianoSmartWalletFactory`: the contract responsible for deploying the smart wallet contracts
- `CredentialKeyMapper`: the contract that stores a mapping between WebAuthn credential IDs and the public key of each. Needed because WebAuthn public keys are only returned on creation, not retrieval.
- `toGianoSmartAccount.ts`: module that instantiates a Viem client for the Giano Smart Wallet
- `provider.ts`: `EIP-1193`-compatible provider that intercepts EVM RPC requests and repackages transactions as user ops to be passed to the bundler
- `connector.ts`: WAGMI connector
Expand Down
4 changes: 2 additions & 2 deletions alto-local.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"entrypoints": "0x4337084D9E255Ff0702461CF8895CE9E3b5Ff108",
"entrypoints": "0x0000000071727De22E5E9d8BAf0edAc6f37da032",
"_executor-private-keys": "0x211899abe67f2ef5fc79849d05fd075a4c0150d0ff517946a0a1c257136153fa",
"executor-private-keys": "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80",
"utility-private-key": "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80",
"rpc-url": "http://localhost:8545",
"rpc-log-level": "trace",
"safe-mode": false
}
}
Loading