@@ -37,9 +37,9 @@ The DA server signs transactions using a Celestia keyring. You have two options:
3737- The key name must match your configuration (` default_key_name ` )
3838
3939** Option 2: AWS KMS Keyring** (Recommended for production)
40- - Key names are mapped to aliases
41- - Supports importing existing keys for e.g.: keys generated by ` cel-key `
42- - Supports auto-creation of keys for simplified setup
40+ - Uses a single pre-configured KMS key
41+ - Minimal permissions: only ` kms:GetPublicKey ` and ` kms:Sign ` required
42+ - Key name ` default_key_name ` in the configuration corresponds to the KMS key alias or key ID
4343- Works with LocalStack for local development
4444
4545** The server will not work without a properly configured keyring.**
@@ -70,48 +70,18 @@ celestia-appd keys show my_celes_key --keyring-backend test \
7070#### Alternative: AWS KMS Keyring Backend
7171
7272Instead of a local keyring, you can use AWS KMS for signing Celestia transactions. This provides:
73- - ** Hardware security** - Keys are generated and stored in AWS KMS HSMs
73+ - ** Hardware security** - Keys are stored in AWS KMS HSMs
7474- ** Remote signing** - No local key material needed
75- - ** Auto-creation ** - Keys can be automatically created on first use
75+ - ** Minimal permissions ** - Only ` kms:GetPublicKey ` and ` kms:Sign ` required
7676- ** LocalStack support** - Test locally before deploying to AWS
7777
78- ##### LocalStack Setup (Development/Testing)
79-
80- For local development, use LocalStack to emulate AWS KMS:
78+ ##### Step 1: Create a KMS Key
8179
8280``` bash
83- # Start LocalStack with KMS service
81+ # For LocalStack (development)
8482docker run -d -p 4566:4566 localstack/localstack
8583
86- # Configure op-alt-da to use AWS KMS with auto-creation
87- cat > config.toml << EOF
88- [celestia]
89- keyring_backend = "awskms"
90- default_key_name = "my_celes_key"
91- # ... other celestia settings ...
92-
93- [celestia.awskms]
94- region = "us-east-1"
95- endpoint = "http://localhost:4566" # LocalStack endpoint
96- alias_prefix = "alias/op-alt-da/"
97- auto_create = true # Automatically create keys if they don't exist
98- EOF
99-
100- # Run the server - the key will be auto-created on startup!
101- ./bin/da-server --config=config.toml
102- ```
103-
104- With ` auto_create = true ` , the server will automatically:
105- 1 . Check if a KMS key with alias ` alias/op-alt-da/<default_key_name> ` exists
106- 2 . If not found, create a new secp256k1 key in KMS
107- 3 . Create the alias and start using it for signing
108-
109- ** Manual Key Creation (Optional)**
110-
111- If you prefer to create keys manually or need to use existing keys:
112-
113- ``` bash
114- # Create a secp256k1 key in LocalStack
84+ # Create a secp256k1 key
11585KEY_ID=$( aws --endpoint-url=http://localhost:4566 kms create-key \
11686 --key-spec ECC_SECG_P256K1 \
11787 --key-usage SIGN_VERIFY \
@@ -120,35 +90,43 @@ KEY_ID=$(aws --endpoint-url=http://localhost:4566 kms create-key \
12090
12191# Create an alias for the key
12292aws --endpoint-url=http://localhost:4566 kms create-alias \
123- --alias-name alias/op-alt-da/ my_celes_key \
93+ --alias-name alias/my_celes_key \
12494 --target-key-id $KEY_ID
125-
126- # Set auto_create = false in config.toml
12795```
12896
129- ##### AWS Production Setup
97+ For production AWS, omit ` --endpoint-url ` .
13098
131- For production use with AWS KMS:
99+ ##### Step 2: Configure the Server
132100
133101``` toml
134102[celestia ]
135103keyring_backend = " awskms"
136- default_key_name = " my_celes_key"
104+ default_key_name = " alias/my_celes_key" # Use full alias name
105+ # ... other celestia settings ...
137106
138107[celestia .awskms ]
139108region = " us-east-1"
140- endpoint = " " # Leave empty for AWS
141- alias_prefix = " alias/op-alt-da/"
142- auto_create = false # Disable auto-creation in production
143-
144- # Optional: Import an existing private key
145- import_key_name = " my_celes_key"
146- import_key_hex = " your-32-byte-hex-private-key"
109+ endpoint = " http://localhost:4566" # Leave empty for AWS production
147110```
148111
149- ** Important: ** Ensure your AWS credentials are configured via environment variables, IAM role, or AWS credentials file. The server requires ` kms:CreateKey ` , ` kms:CreateAlias ` , ` kms:GetPublicKey ` , ` kms:Sign ` , and ` kms:ListAliases ` permissions.
112+ ##### Step 3: Run the Server
150113
151- To export a key from celestia keystore, use ` cel-key export --keyring-dir /path/to/keyring --unarmored-hex --unsafe my_celes_key `
114+ ``` bash
115+ ./bin/da-server --config=config.toml
116+ ```
117+
118+ ** IAM Permissions Required:**
119+
120+ ``` json
121+ {
122+ "Version" : " 2012-10-17" ,
123+ "Statement" : [{
124+ "Effect" : " Allow" ,
125+ "Action" : [" kms:GetPublicKey" , " kms:Sign" ],
126+ "Resource" : " arn:aws:kms:REGION:ACCOUNT:key/KEY_ID"
127+ }]
128+ }
129+ ```
152130
153131### 2. Build the Server
154132
@@ -257,17 +235,13 @@ core_grpc_tls_enabled = true
257235# Keyring
258236keyring_backend = " test" # or "awskms" for AWS KMS
259237keyring_path = " ~/.celestia-light-mocha-4/keys"
260- default_key_name = " my_celes_key"
238+ default_key_name = " my_celes_key" # For awskms, use full alias: "alias/my_celes_key"
261239p2p_network = " mocha-4"
262240
263- # AWS KMS keyring
241+ # AWS KMS keyring (when keyring_backend = "awskms")
264242[celestia .awskms ]
265243region = " us-east-1"
266244endpoint = " " # Set to http://localhost:4566 for localstack
267- alias_prefix = " alias/op-alt-da/"
268- auto_create = false # Automatically create keys if they don't exist
269- import_key_name = " my_celes_key"
270- import_key_hex = " 1234..."
271245
272246[submission ]
273247timeout = " 60s"
0 commit comments